PageSourceSearch

https://wpnj.us/data/layout/js/qContentApi.js?_=63918084995

js wpnj.us collected 2026-10-02 19:10:00 UTC 37,061 bytes, 1,384 lines download raw bytes

1var toString = Object.prototype.toString;
2var url = document.URL;
3var urlArr = url.split("/");
4var parentfolder = urlArr[5];
5var currentfolder = urlArr[6];
6var slice = Array.prototype.slice;
7var cleanup = /\s{2,}/g;
8var ws = /\s+/;
9var whitespaceRE = /[\t\r\n\f]/g;
10var trimRE = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
11var toString = Object.prototype.toString;
12var nativeIsArray = Array.isArray;
13var iamCount = 0;
14var upBtn = document.getElementById('up');
15var downBtn = document.getElementById('down');
16
17// date checks
18var dateObj = new Date();
19var month = dateObj.getUTCMonth() + 1;
20var day = dateObj.getUTCDate();
21var year = dateObj.getUTCFullYear();
22var newdate = month + "/" + day + "/" + year;
23
24
25
26if (isInPage(document.querySelector('.slick-token'))) {
27  /*! loadCSS: load a CSS file asynchronously. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */
28(function(w){
29  "use strict";
30  /* exported loadCSS */
31  var loadCSS = function( href, before, media ){
32    // Arguments explained:
33    // `href` [REQUIRED] is the URL for your CSS file.
34    // `before` [OPTIONAL] is the element the script should use as a reference for injecting our stylesheet <link> before
35      // By default, loadCSS attempts to inject the link after the last stylesheet or script in the DOM. However, you might desire a more specific location in your document.
36    // `media` [OPTIONAL] is the media type or query of the stylesheet. By default it will be 'all'
37    var doc = w.document;
38    var ss = doc.createElement( "link" );
39    var ref;
40    if( before ){
41      ref = before;
42    }
43    else {
44      var refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes;
45      ref = refs[ refs.length - 1];
46    }
47
48    var sheets = doc.styleSheets;
49    ss.rel = "stylesheet";
50    ss.href = href;
51    // temporarily set media to something inapplicable to ensure it'll fetch without blocking render
52    ss.media = "only x";
53
54    // wait until body is defined before injecting link. This ensures a non-blocking load in IE11.
55    function ready( cb ){
56      if( doc.body ){
57        return cb();
58      }
59      setTimeout(function(){
60        ready( cb );
61      });
62    }
63    // Inject link
64      // Note: the ternary preserves the existing behavior of "before" argument, but we could choose to change the argument to "after" in a later release and standardize on ref.nextSibling for all refs
65      // Note: `insertBefore` is used instead of `appendChild`, for safety re: http://www.paulirish.com/2011/surefire-dom-element-insertion/
66    ready( function(){
67      ref.parentNode.insertBefore( ss, ( before ? ref : ref.nextSibling ) );
68    });
69    // A method (exposed on return object for external use) that mimics onload by polling until document.styleSheets until it includes the new sheet.
70    var onloadcssdefined = function( cb ){
71      var resolvedHref = ss.href;
72      var i = sheets.length;
73      while( i-- ){
74        if( sheets[ i ].href === resolvedHref ){
75          return cb();
76        }
77      }
78      setTimeout(function() {
79        onloadcssdefined( cb );
80      });
81    };
82
83    function loadCB(){
84      if( ss.addEventListener ){
85        ss.removeEventListener( "load", loadCB );
86      }
87      ss.media = media || "all";
88    }
89
90    // once loaded, set link's media back to `all` so that the stylesheet applies once it loads
91    if( ss.addEventListener ){
92      ss.addEventListener( "load", loadCB);
93    }
94    ss.onloadcssdefined = onloadcssdefined;
95    onloadcssdefined( loadCB );
96    return ss;
97  };
98  // commonjs
99  if( typeof exports !== "undefined" ){
100    exports.loadCSS = loadCSS;
101  }
102  else {
103    w.loadCSS = loadCSS;
104  }
105}( typeof global !== "undefined" ? global : this ));
106  
107/*! loadJS: load a JS file asynchronously. [c]2014 @scottjehl, Filament Group, Inc. (Based on http://goo.gl/REQGQ by Paul Irish). Licensed MIT */
108(function( w ){
109  var loadJS = function( src, cb ){
110    "use strict";
111    var ref = w.document.getElementsByTagName( "script" )[ 0 ];
112    var script = w.document.createElement( "script" );
113    script.src = src;
114    script.async = true;
115    ref.parentNode.insertBefore( script, ref );
116    if (cb && typeof(cb) === "function") {
117      script.onload = cb;
118    }
119    return script;
120  };
121  // commonjs
122  if( typeof module !== "undefined" ){
123    module.exports = loadJS;
124  }
125  else {
126    w.loadJS = loadJS;
127  }
128}( typeof global !== "undefined" ? global : this ));
129  
130  loadCSS('//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.css');
131  loadCSS('/data/layout/css/slick-theme.css');
132  loadCSS('//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
133  loadJS('//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js', function () {
134    var urlArr = window.location.href.split("/");
135    var url = urlArr[urlArr.length - 2];
136    var folder = document.body.getAttribute('data-qcparentfolder');
137    var toString = Object.prototype.toString;
138    
139    qContentApi({
140      api: 'files',
141      folder: folder
142    },  function (err, data) {
143      if (err) return console.error(err);
144      data = JSON.parse(data);
145      var imgArr = [];
146      var imgArrUnordered = [];
147      
148      data.forEach( function(obj) { 
149        imgArr.push( {
150          path: obj.href, 
151          link: obj.description,
152          title: obj.title,
153          thumbnail: obj.thumb,
154          number: parseBracket(obj.keywords)
155        });
156      });
157      
158      imgArr.map(function(obj) { 
159        if (isNaN(obj.number) || !isNumber(obj.number)) { 
160          var notnum = imgArr.splice(imgArr.indexOf(obj), 1);
161          imgArr.push(notnum[0]);
162        }
163      });
164      
165      imgArr.sort(compareNumbers);
166
167      loadSlickToken(imgArr, '.slick-token');
168      loadThumb(imgArr, '.thumb-token');
169      
170
171      $('.slick-token').slick({
172        slidesToShow: 1,
173        slidesToScroll: 1,
174        arrows: false,
175        fade: true,
176        autoplay: true,
177        asNavFor: '.thumb-token',
178        autoplaySpeed: 3000,
179        adaptiveHeight: false
180      });
181      
182      $('.thumb-token').slick({
183        slidesToShow: 4,
184        slidesToScroll: 1,
185        asNavFor: '.slick-token',
186        arrows: true,
187        infinite: true,
188        focusOnSelect: true,
189        variableWidth: true,
190        responsive: [
191          
192          {
193            breakpoint: 1100,
194            settings: {
195              slidesToShow: 2,
196              slidesToScroll: 1,
197              infinite: true,
198              dots: false,
199              arrows: true,
200              centerMode: false
201            }
202          },
203          {
204            breakpoint: 600,
205            settings: {
206              slidesToShow: 1,
207              slidesToScroll: 1,
208              infinite: true,
209              arrows: true,
210              dots: false,
211              centerMode: false
212            }
213            
214          }]
215      }); 
216      
217    });
218  });
219}
220
221
222
223// Mayor Banner Image
224if (isInPage(document.querySelector('.internal-banner_mayor'))) {
225qContentApi({
226
227   api: 'files',
228   folder: 303
229  },
230  function (err, data) {
231         data = JSON.parse(data);
232         var imgArr = [];
233         var imgArrUnordered = [];
234
235         data.forEach( function(obj) {
236           imgArr.push( {
237             path: obj.href,
238             link: obj.description,
239             title: obj.title,
240             thumbnail: obj.thumb,
241             keyword: obj.keywords
242           });
243         });
244
245         loadUnlinkedItem (imgArr, '.internal-banner_mayor');     
246
247});
248
249}
250
251// Boards Banner Image
252if (isInPage(document.querySelector('.internal-banner_boards'))) {
253qContentApi({
254
255   api: 'files',
256   folder: 305
257  },
258  function (err, data) {
259         data = JSON.parse(data);
260         var imgArr = [];
261         var imgArrUnordered = [];
262
263         data.forEach( function(obj) {
264           imgArr.push( {
265             path: obj.href,
266             link: obj.description,
267             title: obj.title,
268             thumbnail: obj.thumb,
269             keyword: obj.keywords
270           });
271         });
272
273         loadUnlinkedItem (imgArr, '.internal-banner_boards');     
274
275});
276
277}
278
279
280// Department Banner Image
281if (isInPage(document.querySelector('.internal-banner_departments'))) {
282qContentApi({
283
284   api: 'files',
285   folder: 307
286  },
287  function (err, data) {
288         data = JSON.parse(data);
289         var imgArr = [];
290         var imgArrUnordered = [];
291
292         data.forEach( function(obj) {
293           imgArr.push( {
294             path: obj.href,
295             link: obj.description,
296             title: obj.title,
297             thumbnail: obj.thumb,
298             keyword: obj.keywords
299           });
300         });
301
302         loadUnlinkedItem (imgArr, '.internal-banner_departments');     
303
304});
305
306}
307
308// Recreation Banner Image
309if (isInPage(document.querySelector('.internal-banner_recreation'))) {
310qContentApi({
311
312   api: 'files',
313   folder: 2431
314  },
315  function (err, data) {
316         data = JSON.parse(data);
317         var imgArr = [];
318         var imgArrUnordered = [];
319
320         data.forEach( function(obj) {
321           imgArr.push( {
322             path: obj.href,
323             link: obj.description,
324             title: obj.title,
325             thumbnail: obj.thumb,
326             keyword: obj.keywords
327           });
328         });
329
330         loadUnlinkedItem (imgArr, '.internal-banner_recreation');     
331
332});
333
334}
335
336
337// Public Safety Banner Image
338if (isInPage(document.querySelector('.internal-banner_safety'))) {
339qContentApi({
340
341   api: 'files',
342   folder: 309
343  },
344  function (err, data) {
345         data = JSON.parse(data);
346         var imgArr = [];
347         var imgArrUnordered = [];
348
349         data.forEach( function(obj) {
350           imgArr.push( {
351             path: obj.href,
352             link: obj.description,
353             title: obj.title,
354             thumbnail: obj.thumb,
355             keyword: obj.keywords
356           });
357         });
358
359         loadUnlinkedItem (imgArr, '.internal-banner_safety');     
360
361});
362
363}
364
365// Municipal Court Banner Image
366if (isInPage(document.querySelector('.internal-banner_court'))) {
367qContentApi({
368
369   api: 'files',
370   folder: 311
371  },
372  function (err, data) {
373         data = JSON.parse(data);
374         var imgArr = [];
375         var imgArrUnordered = [];
376
377         data.forEach( function(obj) {
378           imgArr.push( {
379             path: obj.href,
380             link: obj.description,
381             title: obj.title,
382             thumbnail: obj.thumb,
383             keyword: obj.keywords
384           });
385         });
386
387         loadUnlinkedItem (imgArr, '.internal-banner_court');     
388
389});
390
391}
392
393
394// About W.P. Banner Image
395if (isInPage(document.querySelector('.internal-banner_about'))) {
396qContentApi({
397
398   api: 'files',
399   folder: 315
400  },
401  function (err, data) {
402         data = JSON.parse(data);
403         var imgArr = [];
404         var imgArrUnordered = [];
405
406         data.forEach( function(obj) {
407           imgArr.push( {
408             path: obj.href,
409             link: obj.description,
410             title: obj.title,
411             thumbnail: obj.thumb,
412             keyword: obj.keywords
413           });
414         });
415
416         loadUnlinkedItem (imgArr, '.internal-banner_about');     
417
418});
419
420}
421
422// Default Banner Image
423if (isInPage(document.querySelector('.internal-banner_default'))) {
424qContentApi({
425
426   api: 'files',
427   folder: 313
428  },
429  function (err, data) {
430         data = JSON.parse(data);
431         var imgArr = [];
432         var imgArrUnordered = [];
433
434         data.forEach( function(obj) {
435           imgArr.push( {
436             path: obj.href,
437             link: obj.description,
438             title: obj.title,
439             thumbnail: obj.thumb,
440             keyword: obj.keywords
441           });
442         });
443
444         loadUnlinkedItem (imgArr, '.internal-banner_default');     
445
446});
447
448}
449
450
451
452
453
454
455if (isInPage(document.querySelector('.home-slideshow'))) {
456qContentApi({
457  
458   api: 'files',
459   folder: 299
460   },
461     function (err, data) {
462         if (err) return console.error(err);
463         data = JSON.parse(data);
464         var imgArr = [];
465         var imgArrUnordered = [];
466        
467         
468         data.forEach( function(obj) { 
469           imgArr.push( {
470             path: obj.href, 
471             link: obj.description,
472             title: obj.title,
473             thumbnail: obj.thumb,
474             number: parseBracket(obj.keywords)
475           });
476         });
477         
478         imgArr.map(function(obj) { 
479           if (isNaN(obj.number) || !isNumber(obj.number)) { 
480             var notnum = imgArr.splice(imgArr.indexOf(obj), 1);
481             imgArr.push(notnum[0]);
482           }
483         });
484   
485         imgArr.sort(compareNumbers);
486         loadSlick(imgArr, '.slick');
487     
488          $('.slick').slick({
489           slidesToShow: 1,
490           slidesToScroll: 1,
491           arrows: false,
492           dots: false,
493           autoplay: true,
494           infinite: true,
495           autoplaySpeed: 6000
496          });
497          
498      });
499
500} // End Slick Full-Width Slider
501
502
503if (isInPage(document.querySelector('.home-onpoint'))) {
504qContentApi({
505  
506   api: 'files',
507   folder: 410
508   },
509     function (err, data) {
510         if (err) return console.error(err);
511         data = JSON.parse(data);
512         var imgArr = [];
513         var imgArrUnordered = [];
514        
515         
516         data.forEach( function(obj) { 
517           imgArr.push( {
518             path: obj.href, 
519             link: obj.description,
520             title: obj.title,
521             thumbnail: obj.thumb,
522             number: parseBracket(obj.keywords)
523           });
524         });
525         
526         imgArr.map(function(obj) { 
527           if (isNaN(obj.number) || !isNumber(obj.number)) { 
528             var notnum = imgArr.splice(imgArr.indexOf(obj), 1);
529             imgArr.push(notnum[0]);
530           }
531         });
532   
533         imgArr.sort(compareNumbers);
534         loadItem(imgArr, '.slick-onpoint');
535     
536          $('.slick-onpoint').slick({
537           slidesToShow: 1,
538           slidesToScroll: 1,
539           arrows: false,
540           dots: true,
541           autoplay: true,
542           infinite: true,
543           autoplaySpeed: 10000
544          });
545          
546      });
547
548} // End Slick Full-Width Slider
549
550if (isInPage(document.querySelector('.footer-carousel'))) {
551qContentApi({
552  
553   api: 'files',
554   folder: 449
555   },
556     function (err, data) {
557         if (err) return console.error(err);
558         data = JSON.parse(data);
559         var imgArr = [];
560         var imgArrUnordered = [];
561        
562         
563         data.forEach( function(obj) { 
564           imgArr.push( {
565             path: obj.href, 
566             link: obj.description,
567             title: obj.title,
568             thumbnail: obj.thumb,
569             number: parseBracket(obj.keywords)
570           });
571         });
572         
573         imgArr.map(function(obj) { 
574           if (isNaN(obj.number) || !isNumber(obj.number)) { 
575             var notnum = imgArr.splice(imgArr.indexOf(obj), 1);
576             imgArr.push(notnum[0]);
577           }
578         });
579   
580         imgArr.sort(compareNumbers);
581         loadItem(imgArr, '.slick-footer');
582     
583          $('.slick-footer').slick({
584           slidesToShow: 4,
585           slidesToScroll: 1,
586           arrows: true,
587           dots: false,
588           autoplay: true,
589           infinite: true,
590           autoplaySpeed: 10000
591          });
592          
593      });
594
595} // End Slick Full-Width Slider
596
597
598
599
600
601// Sidebar Links -  Mayor & Council (SlickNav)
602if (isInPage(document.querySelector('.mayor-sidebar-links'))) {
603qContentApi({
604  api: 'navigation',
605  folder: 165,
606  endpoint: 'megamenu'},
607  function (err, data) {
608     if (err) return console.error(err);
609
610    var nav = document.querySelector('.mayor-sidebar-links');
611    nav.innerHTML = data;
612
613    var youareheretarget = window.location.pathname;
614    if (isInPage(document.querySelector(".mayor-sidebar-links a[href='"+youareheretarget+"\']"))) {
615    var datafolder = document.querySelector(".mayor-sidebar-links a[href='"+youareheretarget+"\']");
616      
617    datafolder.className += ' active-folder';
618    $("a.active-folder").parents('li').addClass("active-li");
619    }
620    
621    var firstUl = document.querySelector('.mayor-sidebar-links > ul');
622    firstUl.className += "";
623    firstUl.id = "menu2";
624    
625    //Initializes Sidebar Links
626    $(function(){
627      $('#menu2').slicknav({
628        label: '',
629        duplicate: true,
630        duration: 350,
631        'allowParentLinks': true,
632        easingOpen: "linear", //available with jQuery UI
633        prependTo:'.mayor-sidebar-links',
634        openedSymbol:'&#45;',
635        closedSymbol:'&#43;',
636        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
637      });
638      $(function(autoOpen) { //correlates with init above
639        $('#menu2').slicknav('toggle');
640      });  
641    });
642    
643  });
644  
645
646}
647
648// Sidebar Links -  Boards (SlickNav)
649if (isInPage(document.querySelector('.boards-sidebar-links'))) {
650qContentApi({
651  api: 'navigation',
652  folder: 167,
653  endpoint: 'megamenu'},
654  function (err, data) {
655     if (err) return console.error(err);
656
657    var nav = document.querySelector('.boards-sidebar-links');
658    nav.innerHTML = data;
659
660    var youareheretarget = window.location.pathname;
661    if (isInPage(document.querySelector(".boards-sidebar-links a[href='"+youareheretarget+"\']"))) {
662    var datafolder = document.querySelector(".boards-sidebar-links a[href='"+youareheretarget+"\']");
663      
664    datafolder.className += ' active-folder';
665    $("a.active-folder").parents('li').addClass("active-li");
666    }
667    
668    var firstUl = document.querySelector('.boards-sidebar-links > ul');
669    firstUl.className += "";
670    firstUl.id = "menu2";
671    
672    //Initializes Sidebar Links
673    $(function(){
674      $('#menu2').slicknav({
675        label: '',
676        duplicate: true,
677        duration: 350,
678        'allowParentLinks': true,
679        easingOpen: "linear", //available with jQuery UI
680        prependTo:'.boards-sidebar-links',
681        openedSymbol:'&#45;',
682        closedSymbol:'&#43;',
683        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
684      });
685      $(function(autoOpen) { //correlates with init above
686        $('#menu2').slicknav('toggle');
687      });  
688    });
689    
690  });
691  
692
693}
694
695// Sidebar Links -  Departments (SlickNav)
696if (isInPage(document.querySelector('.dep-sidebar-links'))) {
697qContentApi({
698  api: 'navigation',
699  folder: 169,
700  endpoint: 'megamenu'},
701  function (err, data) {
702     if (err) return console.error(err);
703
704    var nav = document.querySelector('.dep-sidebar-links');
705    nav.innerHTML = data;
706
707    var youareheretarget = window.location.pathname;
708    if (isInPage(document.querySelector(".dep-sidebar-links a[href='"+youareheretarget+"\']"))) {
709    var datafolder = document.querySelector(".dep-sidebar-links a[href='"+youareheretarget+"\']");
710      
711    datafolder.className += ' active-folder';
712    $("a.active-folder").parents('li').addClass("active-li");
713    }
714    
715    var firstUl = document.querySelector('.dep-sidebar-links > ul');
716    firstUl.className += "";
717    firstUl.id = "menu2";
718    
719    //Initializes Sidebar Links
720    $(function(){
721      $('#menu2').slicknav({
722        label: '',
723        duplicate: true,
724        duration: 350,
725        'allowParentLinks': true,
726        easingOpen: "linear", //available with jQuery UI
727        prependTo:'.dep-sidebar-links',
728        openedSymbol:'&#45;',
729        closedSymbol:'&#43;',
730        init:function(autoOpen){}
730 //called after SlickNav Creation. To open nav by default
731      });
732      $(function(autoOpen) { //correlates with init above
733        $('#menu2').slicknav('toggle');
734      });  
735    });
736    
737  });
738  
739
740}
741
742// Sidebar Links -  Recreation (SlickNav)
743if (isInPage(document.querySelector('.rec-sidebar-links'))) {
744qContentApi({
745  api: 'navigation',
746  folder: 2289,
747  endpoint: 'megamenu'},
748  function (err, data) {
749     if (err) return console.error(err);
750
751    var nav = document.querySelector('.rec-sidebar-links');
752    nav.innerHTML = data;
753
754    var youareheretarget = window.location.pathname;
755    if (isInPage(document.querySelector(".rec-sidebar-links a[href='"+youareheretarget+"\']"))) {
756    var datafolder = document.querySelector(".rec-sidebar-links a[href='"+youareheretarget+"\']");
757      
758    datafolder.className += ' active-folder';
759    $("a.active-folder").parents('li').addClass("active-li");
760    }
761    
762    var firstUl = document.querySelector('.rec-sidebar-links > ul');
763    firstUl.className += "";
764    firstUl.id = "menu2";
765    
766    //Initializes Sidebar Links
767    $(function(){
768      $('#menu2').slicknav({
769        label: '',
770        duplicate: true,
771        duration: 350,
772        'allowParentLinks': true,
773        easingOpen: "linear", //available with jQuery UI
774        prependTo:'.rec-sidebar-links',
775        openedSymbol:'&#45;',
776        closedSymbol:'&#43;',
777        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
778      });
779      $(function(autoOpen) { //correlates with init above
780        $('#menu2').slicknav('toggle');
781      });  
782    });
783    
784  });
785  
786
787}
788
789// Sidebar Links -  Public Safety (SlickNav)
790if (isInPage(document.querySelector('.safety-sidebar-links'))) {
791qContentApi({
792  api: 'navigation',
793  folder: 171,
794  endpoint: 'megamenu'},
795  function (err, data) {
796     if (err) return console.error(err);
797
798    var nav = document.querySelector('.safety-sidebar-links');
799    nav.innerHTML = data;
800
801    var youareheretarget = window.location.pathname;
802    if (isInPage(document.querySelector(".safety-sidebar-links a[href='"+youareheretarget+"\']"))) {
803    var datafolder = document.querySelector(".safety-sidebar-links a[href='"+youareheretarget+"\']");
804      
805    datafolder.className += ' active-folder';
806    $("a.active-folder").parents('li').addClass("active-li");
807    }
808    
809    var firstUl = document.querySelector('.safety-sidebar-links > ul');
810    firstUl.className += "";
811    firstUl.id = "menu2";
812    
813    //Initializes Sidebar Links
814    $(function(){
815      $('#menu2').slicknav({
816        label: '',
817        duplicate: true,
818        duration: 350,
819        'allowParentLinks': true,
820        easingOpen: "linear", //available with jQuery UI
821        prependTo:'.safety-sidebar-links',
822        openedSymbol:'&#45;',
823        closedSymbol:'&#43;',
824        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
825      });
826      $(function(autoOpen) { //correlates with init above
827        $('#menu2').slicknav('toggle');
828      });  
829    });
830    
831  });
832  
833
834}
835
836// Sidebar Links -  Municipal Court (SlickNav)
837if (isInPage(document.querySelector('.court-sidebar-links'))) {
838qContentApi({
839  api: 'navigation',
840  folder: 173,
841  endpoint: 'megamenu'},
842  function (err, data) {
843     if (err) return console.error(err);
844
845    var nav = document.querySelector('.court-sidebar-links');
846    nav.innerHTML = data;
847
848    var youareheretarget = window.location.pathname;
849    if (isInPage(document.querySelector(".court-sidebar-links a[href='"+youareheretarget+"\']"))) {
850    var datafolder = document.querySelector(".court-sidebar-links a[href='"+youareheretarget+"\']");
851      
852    datafolder.className += ' active-folder';
853    $("a.active-folder").parents('li').addClass("active-li");
854    }
855    
856    var firstUl = document.querySelector('.court-sidebar-links > ul');
857    firstUl.className += "";
858    firstUl.id = "menu2";
859    
860    //Initializes Sidebar Links
861    $(function(){
862      $('#menu2').slicknav({
863        label: '',
864        duplicate: true,
865        duration: 350,
866        'allowParentLinks': true,
867        easingOpen: "linear", //available with jQuery UI
868        prependTo:'.court-sidebar-links',
869        openedSymbol:'&#45;',
870        closedSymbol:'&#43;',
871        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
872      });
873      $(function(autoOpen) { //correlates with init above
874        $('#menu2').slicknav('toggle');
875      });  
876    });
877    
878  });
879  
880
881}
882
883
884// Sidebar Links -  Municipal Court (SlickNav)
885if (isInPage(document.querySelector('.about-sidebar-links'))) {
886qContentApi({
887  api: 'navigation',
888  folder: 177,
889  endpoint: 'megamenu'},
890  function (err, data) {
891     if (err) return console.error(err);
892
893    var nav = document.querySelector('.about-sidebar-links');
894    nav.innerHTML = data;
895
896    var youareheretarget = window.location.pathname;
897    if (isInPage(document.querySelector(".about-sidebar-links a[href='"+youareheretarget+"\']"))) {
898    var datafolder = document.querySelector(".about-sidebar-links a[href='"+youareheretarget+"\']");
899      
900    datafolder.className += ' active-folder';
901    $("a.active-folder").parents('li').addClass("active-li");
902    }
903    
904    var firstUl = document.querySelector('.about-sidebar-links > ul');
905    firstUl.className += "";
906    firstUl.id = "menu2";
907    
908    //Initializes Sidebar Links
909    $(function(){
910      $('#menu2').slicknav({
911        label: '',
912        duplicate: true,
913        duration: 350,
914        'allowParentLinks': true,
915        easingOpen: "linear", //available with jQuery UI
916        prependTo:'.about-sidebar-links',
917        openedSymbol:'&#45;',
918        closedSymbol:'&#43;',
919        init:function(autoOpen){} //called after SlickNav Creation. To open nav by default
920      });
921      $(function(autoOpen) { //correlates with init above
922        $('#menu2').slicknav('toggle');
923      });  
924    });
925    
926  });
927  
928
929}
930
931
932
933// CARDS - City Council
934if(isInPage(document.querySelector('.cards.mayor-council'))) {
935qContentApi({ api: 'files', folder: document.body.getAttribute('data-qcparentfolder')},
936    function(err, data) {
937    if (err) return console.error(err);
938    data = JSON.parse(data);
939    var imgArr = [];
940    var imgArrUnordered = [];
941    
942    var cardTemplate = [];
943	
944	data.forEach( function(obj) { 
945       imgArr.push( {
946         href: obj.href, //image url link
947         readmore: obj.description, //full description
948         title: obj.title, //title given in files + docs
949         thumbnail: obj.thumb, //thumbnail version of image in files + docs
950         //readMore: obj.keywords
951         number: parseBracket(obj.keywords) //Only used if numbering should be considered in keywords field
952       });
953     });
954	
955	//Following corresponds to having a number in keywords field.
956	imgArr.map(function(obj) { 
957       if (isNaN(obj.number) || !isNumber(obj.number)) { 
958         var notnum = imgArr.splice(imgArr.indexOf(obj), 1);
959         imgArr.push(notnum[0]);
960       }
961     });
962	imgArr.sort(compareNumbers);
963    //End of numbering-keyworkd field  
964
965	imgArr.forEach(function (obj) {
966    
967        
968        var cardItem = [
969          '<li class="cardItem">',
970				'<div class="col-one">',
971						'<span class="card-preview"><img src="'+obj.href+'" alt="'+obj.title+'" /></span>',
972				'</div>',
973				'<div class="col-two">',
974                        '<span class="title"><h2>'+obj.title+'</h2></span>',
975						'<p><a href="'+obj.readmore+'">Learn more about '+obj.title+'</a></p>',
976				'</div>',
977          '</li>'
978		].join("");
979
980        cardTemplate.push(cardItem);
981		
982    });
983	
984	document.querySelector('.cardList').innerHTML = cardTemplate.join("");
985	});
986} 
987
988
989//START - Convert 2 Column Editor TABLE layout to semantic DIV
990	
991  // PART I - Hide #dupTo from view if #dupFrom is not being utilized
992    if (isInPage (document.getElementById('dupFrom'))) {
993        (document.getElementById('dupTo')).style.display="block";
994    }
995
996  // PART II - Dup content
997    
998if (isInPage (document.getElementById('dupFrom'))) {
999   
1000  var dupFrom = 
1001    {
1002	main: function () {
1003      return document.querySelector('#dupFrom .ContentTemp_MainCol');
1004	},
1005	side: function () {
1006      return document.querySelector('#dupFrom .ContentTemp_SideCol');
1007	}
1008};
1009  
1010	
1011
1012 var dupTo = {
1013	main: function () {
1014      return document.querySelector('#dupTo div.ContentTemp_MainCol');
1015	},
1016	side: function () {
1017      return document.querySelector('#dupTo aside');
1018	}
1019  };
1020	
1021  domNodeTransfer(dupFrom.side(), dupTo.side(), function () {
1022	//dupFrom.side().style.display = 'block'
1023      //console.log("domNodeTransfer DupFrom Side initiated");
1024
1025	moveOut(document.querySelector('.ContentTemp_SideCol .ContentTemp_SideCol'));
1026  });
1027	
1028  domNodeTransfer(dupFrom.main(), dupTo.main(), function () {
1029          //console.log("domNodeTransfer DupFrom Main initiated");
1030
1031	// dupFrom.main().style.display = 'block'
1032	moveOut(document.querySelector('.ContentTemp_MainCol .ContentTemp_MainCol'));
1033  });
1034}
1035
1036
1037
1038
1039/* Start function declaration for 2 Column Editor Table Layout  transfer to DIVs */
1040  function domNodeTransfer (node1, node2, cb) {
1041    var dupFrom = node1.cloneNode(true);
1042    node2.appendChild(dupFrom);
1043    node1.parentNode.removeChild(node1);
1044    if (!cb) cb = function(){};
1045    cb();
1046  }
1047  
1048  function moveOut (el) {
1049    while (el.firstChild) {
1050      el.parentNode.insertBefore(el.firstChild, el);
1051    }
1052  }
1053  
1054//End 2 Column Layout to Div */
1055
1056function isInPage(node) {
1057  return (node === document.body) ? false : document.body.contains(node);
1058}
1059
1060
1061forEachEl('iframe[src*="google.com/maps"]', function (el) {
1062  el.style.width = '100%';
1063});
1064
1065
1066var eventDate = document.querySelector(".publish_date");
1067
1068
1069forEachEl('publish_date', function (obj) {
1070    obj.textContent = (eventDate.textContent)[0];
1071    obj.textContent = (eventDate.textContent)[1];
1072});
1073
1074
1075function qContentApi (opts, callback) {
1076  var querystring = '&';
1077 
1078  if (!opts) opts = {};
1079  if (!opts.folder) opts.folder = '';
1080  if (!opts.params) opts.params = '';
1081  if (!opts.endpoint) opts.endpoint = 'get';
1082 
1083  if (opts.params) {
1084    for (var key in opts.params) {
1085      querystring += key + '=';
1086      querystring += opts.params[key] + '&';
1087    }
1088 
1089  }
1090 
1091  // remove trailing '&'
1092  querystring = querystring.substring(0, querystring.length - 1);
1093
1094            
1095  var xhr = new XMLHttpRequest();
1096  
1097  /* IE 10/11 & EDGE don't like xhr.responseType : https://connect.microsoft.com/IE/feedback/details/795580/ie11-xmlhttprequest-incorrectly-throws-invalidstateerror-when-setting-responsetype 
1098  xhr.responseType = opts.api === 'navigation' ?
1099    'text' :
1100    'json';
1101    
1102  */
1103  xhr.onreadystatechange = function () {
1104    if (xhr.readyState === 4) {
1105      xhr.status === 200 ?
1106        callback(null, xhr.responseText) :
1107        callback('We reached our target server, but it returned an error');
1108    }
1109  };
1110
1111  xhr.open('GET', '/qcontent/api/v1/' + opts.api + '/' + opts.endpoint + '/?folder=' + opts.folder + querystring);
1112  xhr.send();
1113
1114            
1115}
1116
1117
1118function loadSlick(arr, container) {
1119  var img = '';
1120  
1121  arr.forEach( function(Obj) {
1122      img += '<div><img src="'+Obj.path+'" alt="'+Obj.title+'" /></div>';
1123    
1124  });
1125  document.querySelector(container).innerHTML = img;
1126}
1127
1128function loadServicesSlick(arr, container) {
1129  var img = '';
1130  
1131  arr.forEach( function(Obj) {
1132      img += '<div><a href="'+Obj.link+'"><img alt="'+Obj.title+'" src="'+Obj.path+'"><div class="slideshow-caption"><h3>'+Obj.title+'</h3></div></a></div>';
1133    
1134  });
1135  document.querySelector(container).innerHTML = img;
1136}
1137
1138 function loadSlickToken(arr, container) {
1139    var img = '';
1140    
1141    arr.forEach( function(Obj) {
1142      img += '<div><img alt="'+Obj.title+'" src="'+Obj.path+'"><div class="slideshow-caption"><h3>'+Obj.title+'</h3></div></div>';
1143
1144    });
1145    document.querySelector(container).innerHTML = img;
1146  }
1147  
1148  function loadThumb(arr, container) {
1149    var img = '';
1150    
1151    arr.forEach( function(Obj) {
1152      img += '<div><img alt="'+Obj.title+'" src="'+Obj.thumbnail+'"></div>';
1153      
1154    });
1155    document.querySelector(container).innerHTML = img;
1156  }
1157
1158function loadItem (arr, container) {
1159  var img = '';
1160
1161  arr.forEach( function(Obj) {
1162    img += '<a href="'+Obj.link+'"><img src="'+Obj.path+'" alt="'+Obj.title+'" /></a>';
1163
1164  });
1165  document.querySelector(container).innerHTML = img;
1166}
1167
1168function loadUnlinkedItem (arr, container) {
1169  var img = '';
1170
1171  arr.forEach( function(Obj) {
1172    img += '<img src="'+Obj.path+'" alt="'+Obj.title+'" />';
1173
1174  });
1175  document.querySelector(container).innerHTML = img;
1176}
1177
1178function isInPage(node) {
1179  return (node === document.body) ? false : document.body.contains(node);
1180}
1181
1182function loadFeaturedItem (arr, container) {
1183  var img = '';
1184
1185  arr.forEach( function(Obj) {
1186    img += '<a href="'+Obj.link+'"><img src="'+Obj.path+'" alt="'+Obj.title+'" /><p>'+Obj.title+'</p></a>';
1187
1188  });
1189  document.querySelector(container).innerHTML = img;
1190}
1191
1192function isUndefined(obj) {
1193    return obj === void 0;
1194}
1195
1196function isString(obj) {
1197    return toString.call(obj) === '[object String]';
1198}
1199
1200function hasClass(el, cls) {
1201    var cName = (isString(el) ? el : el.className).replace(whitespaceRE, ' ');
1202    return (' ' + cName + ' ').indexOf(' ' + cls + ' ') !== -1;
1203}
1204
1205function isArray(obj) {
1206    return toString.call(obj) === '[object Array]';
1207}
1208
1209function trim(string) {
1210    return string.replace(trimRE, '');
1211}
1212
1213function removeClass(el, cls) {
1214    if (arguments.length === 2 && isString(cls)) {
1215        cls = trim(cls).split(ws);
1216    } else {
1217        cls = isArray(cls) ? cls : slice.call(arguments, 1);
1218    }
1219    // optimize for best, most common case
1220    if (cls.length === 1 && el.classList) {
1221        if (cls[0]) el.classList.remove(cls[0]);
1222        return el;
1223    }
1224    // store two copies
1225    var clsName = ' ' + el.className + ' ';
1226    var result = clsName;
1227    var current;
1228    var start;
1229    for (var i = 0, l = cls.length; i < l; i++) {
1230        current = cls[i];
1231        start = current ? result.indexOf(' ' + current + ' ') : -1;
1232        if (start !== -1) {
1233            start += 1;
1234            result = result.slice(0, start) + result.slice(start + current.length);
1235        }
1236    }
1237    // only write if modified
1238    if (clsName !== result) {
1239        el.className = trim(result.replace(cleanup, ' '));
1240    }
1241    return el;
1242}
1243
1244function formatDate (inputDate) {
1245  // +formatDate(obj.pubDate)[0]+ --> month
1246  // +formatDate(obj.pubDate)[1]+ --> day
1247  // +formatDate(obj.pubDate)[2]+ --> year
1248  var defaultDate = new Date(inputDate).toString();
1249  var eventDateArr = defaultDate.split(' ');
1250  return eventDateArr.splice(1, 3);
1251}
1252
1253function forEachEl(el, cb) {
1254  [].forEach.call(document.querySelectorAll(el), cb);
1255}
1256
1257function parseBracket (obj) {
1258  obj = obj.toString();
1259  if (obj.indexOf("[") > -1) return filterInt(parse(obj, "[", "]"));
1260  return obj;
1261}
1262
1263function compareNumbers(a, b) {
1264    if (isNumber(filterInt(a.number)) && isNumber(filterInt(b.number))) return a.number - b.number;
1265    return;
1266}
1267
1268function isNumber (obj) {
1269    return toString.call(obj) === '[object Number]';
1270}
1271
1272function hasNumbers (body) {
1273    return (/\d/).test(body);
1274}
1275
1276function parse (obj, start, end) {
1277  return obj.substring((obj.indexOf(start) + 1), obj.indexOf(end));
1278}
1279
1280function filterInt (value) {
1281  if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value)) return Number(value);
1282  return NaN;
1283}
1284
1285function limitText (text, length) {
1286  return text.substring(0, length);
1287}
1288
1289function truncateText (text) {
1290  var textArr = text.split(" ");
1291  textArr.pop();
1292  return textArr.join(" ");
1293}
1294
1295function uniq(a) {
1296    var prims = {"boolean":{}, "number":{}, "string":{}}, objs = [];
1297
1298    return a.filter(function(item) {
1299        var type = typeof item;
1300        if(type in prims)
1301            return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true);
1302        else
1303            return objs.indexOf(item) >= 0 ? false : objs.push(item);
1304    });
1305}
1306
1307
1308/**
1309 * cbpFWTabs.js v1.0.0
1310 * http://www.codrops.com
1311 *
1312 * Licensed under the MIT license.
1313 * http://www.opensource.org/licenses/mit-license.php
1314 * 
1315 * Copyright 2014, Codrops
1316 * http://www.codrops.com
1317*/
1318
1319if (isInPage(document.querySelector('#tabs'))) {
1320
1321;( function( window ) {
1322  
1323  'use strict';
1324
1325  function extend( a, b ) {
1326    for( var key in b ) { 
1327      if( b.hasOwnProperty( key ) ) {
1328        a[key] = b[key];
1329      }
1330    }
1331    return a;
1332  }
1333
1334  function CBPFWTabs( el, options ) {
1335    this.el = el;
1336    this.options = extend( {}, this.options );
1337      extend( this.options, options );
1338      this._init();
1339  }
1340
1341  CBPFWTabs.prototype.options = {
1342    start : 0
1343  };
1344
1345  CBPFWTabs.prototype._init = function() {
1346    // tabs elemes
1347    this.tabs = [].slice.call( this.el.querySelectorAll( 'nav > ul > li' ) );
1348    // content items
1349    this.items = [].slice.call( this.el.querySelectorAll( '.content > section' ) );
1350    // current index
1351    this.current = -1;
1352    // show current content item
1353    this._show();
1354    // init events
1355    this._initEvents();
1356  };
1357
1358  CBPFWTabs.prototype._initEvents = function() {
1359    var self = this;
1360    this.tabs.forEach( function( tab, idx ) {
1361      tab.addEventListener( 'click', function( ev ) {
1362        ev.preventDefault();
1363        self._show( idx );
1364      } );
1365    } );
1366  };
1367
1368  CBPFWTabs.prototype._show = function( idx ) {
1369    if( this.current >= 0 ) {
1370      this.tabs[ this.current ].className = '';
1371      this.items[ this.current ].className = '';
1372    }
1373    // change current
1374    this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0;
1375    this.tabs[ this.current ].className = 'tab-current';
1376    this.items[ this.current ].className = 'content-current';
1377  };
1378
1379  // add to global namespace
1380  window.CBPFWTabs = CBPFWTabs;
1381
1382})( window );
1383  
1384}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.