1(function(TermsBanner, $, undefined) { 2 3 var dismissedCookieKey = 'terms-banner-dismissed'; 4 5 function TermsBannerClass($banner) { 6 var that = this; 7 this.$banner = $banner; 8 9 var $closeButton = $banner.find('[data-action="dismiss"]'); 10 var $termsLink = $banner.find('[data-action="show-terms"]'); 11 if($closeButton.length === 0 || $termsLink.length === 0) { 12 throw new Error('Invalid banner HTML'); 13 } 14 15 var isBannerDismissed = Cookies.get(dismissedCookieKey); 16 if(isBannerDismissed) { 17 $banner.remove(); 18 return; 19 } else { 20 $banner.show(); 21 } 22 23 $closeButton.on('click', function(e) { 24 e.preventDefault(); 25 26 that.dismiss(); 27 }); 28 29 $termsLink.on('click', function(e) { 30 e.preventDefault(); 31 32 var termsType = Common.isSahas() ? 'sahas' : 'reporting'; 33 var url = baseurl + '/showterms.do'; 34 $.get(url, { termsType: termsType }) 35 .then(function(text) { 36 var $modal = $('#terms-modal'); 37 38 $modal.modal(); 39 showTermsWindow($modal, text, { 40 type: 'display' 41 }) 42 .then(function() { 43 that.dismiss(); 44 }); 45 46 $("html, body").animate({ 47 scrollTop: $modal.offset().top 48 }, 1000); 49 }); 50 }); 51 }; 52 53 TermsBannerClass.prototype.dismiss = function() { 54 Cookies.set(dismissedCookieKey, true); 55 this.$banner.remove(); 56 }; 57 58 TermsBanner.TermsBanner = TermsBannerClass; 59 60}(window.TermsBanner = window.TermsBanner || {}, jQuery));
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.