1$(document).ready(function () { 2 //ISI Bar scroll - Start 3 var margin = 0; 4 var lastScrollLeft = 0; 5 scrollBottom(); 6 //Scroll window bottom 7 $(window).scroll(scrollBottom); 8 $(window).resize(scrollBottom); 9 //expand bottom - desktop 10 $(document).on('click', '.important-safety-information a, a.expand#isi , #isi_new a.expand, a.content_isi', function (e) { 11 e.preventDefault(); 12 if (!$(this).hasClass('expanded')) { 13 expandBottomDesktop(); 14 } else { 15 closeBottomDesktop(); 16 } 17 return false; 18 }); 19 20 // to trigger OR expanded ISI content 21 var hashthere = window.location.hash; 22 if (hashthere == '#isi_text') { 23 expandBottomDesktop(); 24 } 25 26 function scrollBottom() { 27 var height = $('#top .content-wrapper:first-child').height(); 28 var offsetTop = $('#bottom').length > 0 ? $('#bottom').offset().top : 0; 29 var currentScroll = $(window).scrollTop(); 30 var documentScrollLeft = $(document).scrollLeft(); 31 var scrollLimit = $(window).height() * 0.8; 32 if (!$('#bottom').hasClass('expanded')) { 33 //vertical scrolling 34 if (height - currentScroll >= scrollLimit) { 35 pinBottomDesktop(height, offsetTop); 36 } else { 37 unpinBottomDesktop(); 38 } 39 $('#top').css('margin-bottom', margin + 'px'); 40 41 //horizontal scrolling 42 if (lastScrollLeft != documentScrollLeft) { 43 if ($('#bottom').hasClass('pinned')) { 44 $('#bottom').css('left', '-' + documentScrollLeft + 'px'); 45 } 46 lastScrollLeft = documentScrollLeft; 47 } 48 } 49 } 50 51 function expandBottomDesktop(changeView) { 52 if (!$('#bottom').hasClass('pinned')) { 53 $('#bottom').css('top', $('#top').height()); 54 $('#bottom').css('position', 'absolute'); 55 } 56 $('#bottom').addClass('expanded'); 57 $('li.important-safety-information a').addClass('expanded'); 58 $('a.expand#isi').addClass('expanded'); 59 $('#isi_new a.expand').addClass('expanded'); 60 $('a.expand#isi').html('<span>Important Safety Information</span> <span class="down-arrow"> </span>'); 61 $('#isi_new a.expand').html('<span>Important Safety Information</span> <span class="down-arrow"> </span>'); 62 $('#top').css('height', 'auto'); 63 $('#top').css('overflow', 'hidden'); 64 $("#bottom").stop().animate({ 65 top: "165px" 66 }, 1000, function () { 67 $('#bottom').css('position', 'absolute'); 68 $('#header').addClass('whitebg'); 69 $('#bottom').attr('style', function (i, style) { 70 return style.replace(/left[^;]+;?/g, ''); 71 }); 72 if ($('#top').height() > $('#bottom').height() - 83) { 73 $('#top').css('height', $('#bottom').height() - 200); 74 $('#top').css('margin-bottom', 0); 75 } else { 76 $('#top').css('height', 'auto'); 77 $('#top').css('margin-bottom', $("#bottom").height() - $('#top').height()); 78 } 79 }); 80 if (!changeView) { 81 $('body,html').animate({ 82 scrollTop: 0 83 }, 1000); 84 } 85 } 86 function closeBottomDesktop() { 87 var documentScrollLeft = $(document).scrollLeft(); 88 89 $('#top').css('height', 'auto'); 90 $('#top').css('overflow', 'auto'); 91 $('#bottom').css('position', 'fixed'); 92 93 var height = (window.innerHeight > 0) ? window.innerHeight : screen.height; 94 var topHeight = $('#top').height() + 20; 95 var height2; 96 97 if (height < (topHeight + height * 0.2)) {
98 height2 = '80%'; 99 } else { 100 height2 = topHeight; 101 } 102 $("#bottom").stop().animate({ 103 top: height2 104 }, 1000); 105 $('#bottom').addClass('pinned'); 106 $('#bottom').css('left', 'auto'); 107 $('#bottom').css('left', '-' + documentScrollLeft + 'px'); 108 109 $('#bottom').removeClass('expanded'); 110 $('a.expand#isi').removeClass('expanded'); 111 $('#isi_new a.expand').removeClass('expanded'); 112 $('li.important-safety-information a').removeClass('expanded'); 113 $('a.expand#isi').html('<span>Important Safety Information</span> <span class="up-arrow"> </span>'); 114 $('#isi_new a.expand').html('<span>Important Safety Information</span> <span class="up-arrow"> </span>'); 115 } 116 117 function pinBottomDesktop(height, offset) { 118 var documentScrollLeft = $(document).scrollLeft(); 119 margin = $('#bottom').height() - (height - offset); 120 $('#bottom').addClass("pinned"); 121 $('#bottom').css('left', '-' + documentScrollLeft + 'px'); 122 var height = (window.innerHeight > 0) ? window.innerHeight : screen.height; 123 console.log("pinBottomDesktop height" + height); 124 if (height <= 150) { 125 $('#bottom').css('top', '40%'); 126 } 127 else if (height <= 180 && height > 150) { 128 $('#bottom').css('top', '43%'); 129 } 130 else if (height <= 210 && height > 180) { 131 $('#bottom').css('top', '47%'); 132 } 133 else if (height <= 240 && height > 210) { 134 $('#bottom').css('top', '50%'); 135 } 136 else if (height <= 270 && height > 240) { 137 $('#bottom').css('top', '53%'); 138 } 139 else if (height <= 300 && height > 270) { 140 $('#bottom').css('top', '55%'); 141 } 142 else if (height <= 330 && height > 300) { 143 $('#bottom').css('top', '58%'); 144 } 145 else if (height <= 350 && height > 330) { 146 $('#bottom').css('top', '61%'); 147 } 148 else if (height <= 400 && height > 350) { 149 $('#bottom').css('top', '64%'); 150 } 151 else if (height <= 440 && height > 400) { 152 $('#bottom').css('top', '66%'); 153 } 154 else if (height <= 480 && height > 440) { 155 $('#bottom').css('top', '68%'); 156 } 157 else if (height <= 520 && height > 480) { 158 $('#bottom').css('top', '70%'); 159 } 160 else if (height <= 560 && height > 520) { 161 $('#bottom').css('top', '72%'); 162 } 163 else if (height <= 600 && height > 560) { 164 $('#bottom').css('top', '74%'); 165 } 166 else if (height <= 640 && height > 600) { 167 $('#bottom').css('top', '76%'); 168 } 169 else if (height <= 680 && height > 640) { 170 $('#bottom').css('top', '77%'); 171 } 172 else if (height <= 720 && height > 680) { 173 $('#bottom').css('top', '78%'); 174 } 175 else if (height <= 760 && height > 720) { 176 $('#bottom').css('top', '80%'); 177 } 178 else { 179 $('#bottom').css('top', '80%'); 180 } 181 $('#bottom').css('position', 'fixed'); 182 } 183 function unpinBottomDesktop() { 184 margin = 0; 185 $('#bottom').css('left', 'auto'); 186 $('#bottom').removeClass("pinned"); 187 $('#bottom').css('top', '0'); 188 $('#bottom').css('top', 'initial'); 189 $('#bottom').css('position', 'relative'); 190 } 191 //ISI Bar scroll - End 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.