1jQuery(document).ready(function($){ 2 "use strict"; 3 //back to top button 4 // hide #pe-back-top first 5 jQuery("#pe-back-top").hide(); 6 // fade in #pe-back-top 7 jQuery(function () { 8 jQuery(window).scroll(function () { 9 if (jQuery(this).scrollTop() > 100) { 10 jQuery('#pe-back-top').fadeIn(); 11 } else { 12 jQuery('#pe-back-top').fadeOut(); 13 } 14 }); 15 // scroll body to 0px on click 16 jQuery('#pe-back-top a').click(function () { 17 jQuery('body,html').animate({ 18 scrollTop: 0 19 }, 800); 20 return false; 21 }); 22 }); 23 24 //jQuery Off-Canvas 25 var scrollsize; 26 27 jQuery(function() { 28 "use strict"; 29 // Toggle Nav on Click 30 jQuery('a.toggle-nav').click(function() { 31 // Get scroll size on offcanvas open 32 if(!jQuery('body').hasClass('off-canvas')) scrollsize = jQuery(window).scrollTop(); 33 // Calling a function 34 toggleNav(); 35 }); 36 }); 37 function toggleNav() { 38 "use strict"; 39 var y = jQuery(window).scrollTop(); 40 if (jQuery('body').hasClass('off-canvas')) { 41 // Do things on Nav Close 42 jQuery('body').removeClass('off-canvas'); 43 setTimeout(function() { 44 jQuery('.sticky-bar #pe-bar-wrapp').removeAttr('style'); 45 jQuery('html').removeClass('no-scroll').removeAttr('style'); 46 jQuery(window).scrollTop(scrollsize); 47 }, 300); 48 } else { 49 // Do things on Nav Open 50 jQuery('body').addClass('off-canvas'); 51 jQuery('.sticky-bar #pe-bar-wrapp').css({'position':'absolute','top':y}); 52 jQuery('.pe-megamenu-sticky').css({'position':'absolute','top':y}); 53 setTimeout(function() { 54 jQuery('html').addClass('no-scroll').css('top',-y); 55 }, 300); 56 } 57 } 58}); 59 60 61// Sticky Bar 62var JMresizeTimer; 63function JMtoolbarResize() { 64 "use strict"; 65 var body = jQuery('body'); 66 var allpage = jQuery('#pe-allpage'); 67 var comment = jQuery('ul.comment-list li'); 68 var offset_scrolled; 69 70 if(body.hasClass('sticky-bar')) { 71 var bar = allpage.find('#pe-bar-wrapp'); 72 if (bar.length > 0) { 73 var offset = bar.outerHeight(); 74 allpage.css('padding-top', (offset) + 'px'); 75 offset_scrolled = offset -20; 76 comment.css('padding-top', (offset_scrolled) + 'px'); 77 comment.css('margin-top', -(offset_scrolled) + 'px'); 78 } 79 } 80}; 81 82jQuery(window).load(function(){ 83 "use strict"; 84 JMtoolbarResize(); 85 86 jQuery(window).resize(function() { 87 clearTimeout(JMresizeTimer); 88 JMresizeTimer = setTimeout(JMtoolbarResize, 30); 89 }); 90 91 jQuery(window).scroll(function() { 92 var JMresizeTimer; 93 var topbar = jQuery('#pe-bar-wrapp'); 94 if (topbar.length > 0) { 95 var scroll = jQuery(window).scrollTop(); 96 if (scroll >= 20) { 97 topbar.addClass("scrolled"); 98 } else { 99 topbar.removeClass("scrolled"); 100 } 101 } 102 }); 103}); 104 105//search hide 106jQuery(document).ready(function(){ 107 "use strict"; 108 var djMenu = jQuery('#pe-mainmenu'); 109 if (djMenu.length > 0) { 110 111 var searchModule = djMenu.find('.search-ms'); 112 var searchModuleInput = djMenu.find('input[type="text"]'); 113 var searchModuleButton = searchModule.find('input[type="submit"]'); 114 115 if (searchModule.length > 0 && searchModuleButton.length > 0 ) { 116 117 searchModuleButton.mouseover(function (event) { 118 searchModuleInput.addClass('show'); 119 searchModuleInput.focus(); 120 }); 121 122 searchModuleInput.focusout(function() { 123 searchModuleInput.removeClass('show'); 124 }); 125 126 } 127 } 128}); 129 130//font sizer 131"use strict"; 132var documenttextsizer = { 133 134 prevcontrol : '', //remember last control clicked on/ selected 135 existingclasses : '', 136 137setpageclass : function(control, newclass) { 138 if (this.prevcontrol != '') 139 this.css(this.prevcontrol, 'selectedtoggler', 'remove') 140 //de-select previous control, by removing 'selectedtoggler' from it 141 document.documentElement.className = this.existingclasses + ' ' + newclass//apply new class to document 142 this.css(control, 'selectedtoggler', 'add')//select current control 143 this.setCookie('pagesetting', newclass, 5)//remember new class added to document for 5 days 144 this.prevcontrol = control 145 }, 146 147 css : function(el, targetclass, action) { 148 var needle = new RegExp("(^|\\s+)" + targetclass + "($|\\s+)", "ig") 149 if (action == "check") 150 return needle.test(el.className) 151 else if (action == "remove") 152 el.className = el.className.replace(needle, "") 153 else if (action == "add") 154 el.className += " " + targetclass 155 }, 156 157 getCookie : function(Name) { 158 var re = new RegExp(Name + "=[^;]+", "i"); 159 //construct RE to search for target name/value pair 160 if (document.cookie.match(re))//if cookie found 161 return document.cookie.match(re)[0].split("=")[1] 162 //return its value 163 return null 164 }, 165 166 setCookie : function(name, value, days) { 167 if ( typeof days != "undefined") {//if set persistent cookie 168 var expireDate = new Date() 169 var expstring = expireDate.setDate(expireDate.getDate() + days) 170 document.cookie = name + "=" + value + "; path=/; expires=" + expireDate.toGMTString() 171 } else//else if this is a session only cookie 172 document.cookie = name + "=" + value 173 }, 174 175 setup : function(targetclass) { 176 this.existingclasses = document.documentElement.className//store existing CSS classes on HTML element, if any 177 var persistedsetting = this.getCookie('pagesetting') 178 var alllinks = document.getElementsByTagName("a") 179 for (var i = 0; i < alllinks.length; i++) { 180 if (this.css(alllinks[i], targetclass, "check")) { 181 if (alllinks[i].getAttribute("rel") == persistedsetting)//if this control's rel attribute matches persisted doc CSS class name 182 this.setpageclass(alllinks[i], alllinks[i].getAttribute("rel")) 183 //apply persisted class to document 184 alllinks[i].onclick = function() { 185 documenttextsizer.setpageclass(this, this.getAttribute("rel")) 186 return false 187 } 188 } 189 } 190 } 191}
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.