1// This is required to fix an issue in earlier versions of Windows Phone 8 2// http://timkadlec.com/2013/01/windows-phone-8-and-device-width/ 3if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 4 var msViewportStyle = document.createElement('style') 5 msViewportStyle.appendChild( 6 document.createTextNode( 7 '@-ms-viewport{width:auto!important}' 8 ) 9 ) 10 document.querySelector('head').appendChild(msViewportStyle) 11}; 12 13var itemTimer; 14 15 16/*----------- GET PROPER VIEWPORT -----------*/ 17 18// Only need to include if you haven't already elsewhere 19// Getting .width() with window isn't going to account for the scrollbar 20// So we get the innerWidth or clientWidth depending on which size is smaller 21var getViewportW = function () { 22 var win = typeof window != 'undefined' && window, 23 doc = typeof document != 'undefined' && document, 24 docElem = doc && doc.documentElement; 25 26 var a = docElem['clientWidth'], b = win['innerWidth']; 27 return a < b ? b : a; 28}; 29 30 31/*----------- DEBOUNCER -----------*/ 32 33// Code from Underscore.js 34 35var debounce = function(func, wait, immediate) { 36 var timeout; 37 console.log("debounce"); 38 return function() { 39 var context = this, args = arguments; 40 var later = function() { 41 timeout = null; 42 if (!immediate) func.apply(context, args); 43 }; 44 var callNow = immediate && !timeout; 45 clearTimeout(timeout); 46 timeout = setTimeout(later, wait); 47 if (callNow) func.apply(context, args); 48 }; 49}; 50 51 52jQuery(function ($) { 53 54 $(".playVideo").colorbox({iframe:true, innerWidth:640, innerHeight:390}); 55 56 $(document).click(function (event) { 57 $( ".siteSearch.active:visible" ).toggleClass( "active", 0); 58 }); 59 60 $(".siteSearch").click(function(event){ 61 event.stopPropagation(); 62 }); 63 64 $( ".searchCall" ).click(function(e) { 65 e.stopPropagation(); 66 $( ".siteSearch" ).toggleClass( "active", 0); 67 $( ".searchCall" ).toggleClass( "active", 0); 68 }); 69 70 71 /*----------- NAVIGATION FUNCTIONALITY -----------*/ 72 //var $mainNav = $(".siteHeader").find(".nav .mainMenu").clone(); 73 //$(".menuWrap .nav .js-clickMenu").append($mainNav); 74 75 76 // equalize heights of children within columnRow class 77 $(".columnRow").each(function () { 78 $(this).find(".accountBlocks").matchHeights(); 79 }); 80 81 var width = $(window).width(); 82 if ((width > 767)) { 83 $(".siteBody").each(function () { 84 $(this).find(".corlnav, .interior").matchHeights(); 85 }); 86 } 87 88 89 var adjustHeights = function(){ 90 var windolWidth = getViewportW(); 91 console.log("adjusting"); 92 93 $('.latestNews, .featuring').css("min-height", 0); 94 $(".boxesWrpr").each(function () { 95 $(this).find(".latestNews, .featuring").matchHeights(); 96 }); 97 98 $('.ftrBox').css("min-height", 0); 99 if ( windolWidth >= 768 ){ 100 $(".footer").each(function () { 101 $(this).find(".ftrBox").matchHeights(); 102 }); 103 } 104 105 $('.locator, .socialBox, .madeInUSA').css("min-height", 0); 106 $(".boxesWrpr").each(function () { 107 $(this).find(".locator, .socialBox, .madeInUSA").matchHeights(); 108 }); 109 110 if ( windolWidth >= 768 ) { 111 var latestNews = document.getElementsByClassName("latestNews")[0]; 112 var financing = document.getElementsByClassName("financing")[0]; 113 var videosHome = document.getElementsByClassName("videosHome")[0]; 114 //if (financing) financing.style.height = (latestNews.offsetHeight / 2) - 20 + "px"; 115 if (financing) financing.style.height = (latestNews.offsetHeight / 2) - 4 + "px"; 116 //if (videosHome) videosHome.style.height = (latestNews.offsetHeight / 2) - 20 + "px"; 117 if (videosHome) videosHome.style.height = (latestNews.offsetHeight / 2) - 4 + "px"; 118 } 119 120 } 121 122 adjustHeights(); 123 var debounceHeights = debounce(adjustHeights, 200); 124 125 // equalize heights of selected elements 126 $(window).load(function() { 127 adjustHeights(); 128 $(window).resize(debounceHeights); 129 }); 130 131 132 133 $(".truncate").truncate({ 134 max_length: 400, 135 more: "read more", 136 less: "read less" 137 }); 138 139 // dialog windows 140 $(".uiModal").dialog({ 141 autoOpen: false, 142 width: "720px", 143 bgiframe: true, 144 modal: true, 145 resizable: false, 146 live: false, 147 buttons: { 148 Close: function () { 149 $(this).dialog("close"); 150 } 151 } 152 });
153 154 $(".uiDialog").dialog({ 155 autoOpen: false, 156 width: "720px", 157 bgiframe: true, 158 modal: false, 159 resizable: false, 160 buttons: { 161 Close: function () { 162 $(this).dialog("close"); 163 } 164 } 165 }); 166 167 // END dialog windows 168 169 // carousels 170 /* This was moved to /cms/includes/js/modules/carouselScrollable.js 171 $('div.carousel div.scrollable').each(function () { 172 //var size = parseFloat($(this).parent().attr('class').split(' ').slice(-1).join().substring(11)); 173 var size = parseFloat($(this).attr('class').match(/\d\b/g)); 174 175 var $carousel = $(this).scrollable({ 176 size: size, 177 items: ".items", 178 clickable: false 179 }); 180 181 var $items = $(this).children(':first').children().matchHeights(); 182 if ($items.length > size) { $(this).parent().find(".nextPage").removeClass('disabled'); }; 183 184 var itemHeight = $items.outerHeight(); 185 $(this).css({ 'height': itemHeight }).nextAll().each(function () { 186 $(this).css({ 'top': (itemHeight - $(this).height()) / 2 }); 187 }); 188 }); 189 */ 190 // END carousels 191 192 $(".tabModule").tabs(); 193 $(".mod_landing_gal li").matchHeights(); 194 195 //EP - Fix for Webkit issue with AjaxControlToolkit 196 if (typeof Sys != 'undefined') { Sys.Browser.WebKit = {}; if (navigator.userAgent.indexOf('WebKit/') > -1) { Sys.Browser.agent = Sys.Browser.WebKit; Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]); Sys.Browser.name = 'WebKit'; } } 197 198 //}); 199 200 201 202});
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.