1/** 2* IE Check 3* @returns {Number} 4*/ 5function isIE () { 6 var myNav = navigator.userAgent.toLowerCase(); 7 return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; 8} 9 10jQuery(function() { 11 /** 12 * initialize scroll settings 13 * - sticky header 14 * - scroll up btn 15 */ 16 var initTylerScroll = function() { 17 var header = jQuery('header'), 18 scrollTop = jQuery(document).scrollTop(), 19 documentHeight = jQuery(document).height(), 20 windowHeight = jQuery(window).height(), 21 windowWidth = jQuery(window).width(), 22 limit = documentHeight - header.height() < windowHeight 23 ? header.height() 24 : 1; 25 26 // only for "medium" devices 27 if(windowWidth<992) { 28 jQuery('#scroll-up').fadeOut(); 29 header.removeClass('sticky'); 30 jQuery(document.body).removeClass('header-sticky'); 31 return; 32 } 33 34 // show "scroll up" btn 35 if(windowWidth > 1024 && scrollTop >= windowHeight/2) { 36 jQuery('#scroll-up').fadeIn(); 37 } 38 else { 39 jQuery('#scroll-up').fadeOut(); 40 } 41 42 // sticky header 43 if (scrollTop >= limit) { 44 header.addClass('sticky'); 45 jQuery(document.body).addClass('header-sticky'); 46 } else if (scrollTop <= limit) { 47 header.removeClass('sticky'); 48 jQuery(document.body).removeClass('header-sticky'); 49 } 50 } 51 jQuery(window).ready(initTylerScroll); 52 jQuery(window).scroll(initTylerScroll); 53 jQuery(window).resize(initTylerScroll); 54 55 // mobile menu expanded 56 jQuery('#tyler-navigation') 57 .on('show.bs.collapse', function () { 58 jQuery(document.body) 59 .addClass('header-menu-open') 60 .attr('data-scroll', jQuery(document).scrollTop()); 61 window.scrollTo(0,0); 62 jQuery('#backdrop').show(); 63 }) 64 .on('hide.bs.collapse', function() { 65 jQuery(document.body).removeClass('header-menu-open'); 66 window.scrollTo(0, jQuery(document.body).attr('data-scroll')); 67 jQuery('#backdrop').hide(); 68 }); 69 70 71 /** 72 * change element text size to fit it's dimension 73 * @param el 74 * @param rel 75 */ 76 var textFit = function(el, rel) { 77 rel = Math.min(1, rel || 1); 78 el = jQuery(el); 79 80 var elInner = el.find('.text-fit-inner')[0] || 81 el.wrapInner("<span class='text-fit-inner' style='display:block'></span>").find('.text-fit-inner')[0]; 82 elInner = jQuery(elInner); 83 84 var maxW = Math.min(el.innerWidth(), parseInt(el.css('max-width'))), 85 maxH = Math.min(el.innerHeight(), parseInt(el.css('max-height'))); 86 87 if(elInner.outerWidth() > maxW || elInner.outerHeight() > maxH) { 88 rel *= 0.95; 89 elInner.css('font-size', rel+'em'); 90 textFit(el, rel); 91 } 92 } 93 if(!isIE() || isIE()>7) { 94 var initTextFit = function() { 95 jQuery('.text-fit').each(function(i, el) { 96 textFit(el); 97 }); 98 } 99 initTextFit(); 100 jQuery(window).on('resize', initTextFit); 101 } 102 103 104 105 //Add Hover effect to menus 106 if(jQuery(window).width()>=922) { 107 jQuery('header #menu-primary .menu-item-has-children') 108 .hover(function() { 109 var ul = jQuery(this).find('>ul'); 110 ul.stop(true, true).delay(200).fadeIn({ 111 start: function() { 112 if(jQuery(this).parents('ul.sub-menu').length!=0 && ul.offset().left > jQuery(window).width() - ul.width() - 100) { 113 ul.css({ 114 'left':'auto', 115 'right':'100%' 116 }); 117 } 118 } 119 }); 120 121 122 }, function() { 123 jQuery(this).find('>ul').stop(true, true).delay(200).fadeOut(); 124 }); 125 } 126 127 /* add element to expand menu children in mobile */ 128 if(jQuery('.navbar-toggle').is(':visible')){ 129 jQuery('header #menu-primary .menu-item-has-children').append('<span class="expand-children visible-sm visible-xs">+</span>'); 130 } 131 132 /* expand menu children in mobile */ 133 jQuery('header #menu-primary .menu-item-has-children .expand-children').click(function(event) { 134 if(jQuery(this).html() == '+'){ 135 jQuery(this).html('-'); 136 } else{ 137 jQuery(this).html('+'); 138 } 139 jQuery(this).parent().toggleClass('expand'); 140 }); 141 142 // Fix Mobile menu when click on register button 143 jQuery('.menu-item.register').click(function(event){ 144 jQuery('#tyler-navigation').addClass('collapse').css('height', '0px'); 145 jQuery('#backdrop').hide(); 146 }); 147 148 jQuery('#tyler-navigation #menu-primary li a').click(function(event){ 149 jQuery('#backdrop').hide(); 150 }); 151 152 // expand footer menu on click 153 jQuery('footer .col h4') 154 .click(function(event) { 155 event.preventDefault(); 156 jQuery(this).parents('.col').toggleClass('expand'); 157 }); 158 159 // init scrollbars 160 jQuery('.scrollable').jScrollPane(); 161 162 /** 163 * placeholder fix 164 * @see https://gist.github.com/hagenburger/379601 165 */ 166 jQuery('[placeholder]').focus(function() { 167 var input = jQuery(this); 168 if (input.val() == input.attr('placeholder')) { 169 input.val(''); 170 input.removeClass('placeholder'); 171 } 172 }).blur(function() { 173 var input = jQuery(this); 174 if (input.val() == '' || input.val() == input.attr('placeholder')) { 175 input.addClass('placeholder'); 176 input.val(input.attr('placeholder')); 177 } 178 }).blur().parents('form').submit(function() { 179 jQuery(this).find('[placeholder]').each(function() { 180 var input = jQuery(this); 181 if (input.val() == input.attr('placeholder')) { 182 input.val(''); 183 } 184 }) 185 }); 186 187 // scroll button up 188 jQuery('#scroll-up').click(function(){ 189 window.scrollTo(0, 0); 190 return false;
191 }); 192 193});
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.