1$(function() { 2 3 // Browser checking 4 $.reject({ 5 reject: { 6 //msie8: true; 7 }, 8 closeCookie: false 9 }); 10 11 // Searchbox 12 var $site_search__component = $('#site-search--component'); 13 var $site_search__toggle = $site_search__component.find('.site-search--toggle'); 14 $site_search__toggle.on('click', function () { 15 $site_search__component.toggleClass('site-search--component--visible'); 16 if ($site_search__component.hasClass('site-search--component--visible')) { 17 $('#site-search--searchbox-input').focus(); 18 } 19 }); 20 21 // Searchbox autocomplete 22 var $site_search__searchbox__input = $('#site-search--searchbox-input'); 23 $site_search__searchbox__input.autocomplete({ 24 item_url: '{Url}', 25 item_param: '{Parameter}', 26 search_url: '', 27 results_class: 'site-search--results', 28 results_item_class: 'site-search--results-item' 29 }); 30 31 32 // Initialize Slideshows and AddThis 33 Ease.initializePlugins(); 34 35 // Initialize Offcanvas menu 36 Offcanvas.initialize(); 37 38 // Initiliaze Dotdotdot's 39 $('.dotdotdot').dotdotdot({ 40 watch: 'window' 41 }); 42 setTimeout(function () { 43 $('.dotdotdot').trigger('destroy').dotdotdot({ 44 watch: 'window' 45 }); 46 }, 3000); 47 48 // Alertbox close buttons 49 $('alertbox > .close').on('click', function (e) { 50 e.preventDefault(); 51 var $this = $(this); 52 var target = $this.attr('data-target'); 53 $(this).closest(target ? target : 'grid').slideUp(function () { 54 $(this).remove(); 55 }); 56 }); 57 58 59 // Convert all # anchor tags to smooth scrolling 60 $('a[href*="#"]:not([href="#"])').click(function() { 61 if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { 62 var target = $(this.hash); 63 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 64 if (target.length) { 65 $('html, body').animate({ 66 scrollTop: target.offset().top 67 }, 1000); 68 return false; 69 } 70 } 71 }); 72 73 // Fullscreenator 74 $(window).on('resize load', function () { 75 $('.fullscreenator').css({ 76 width: $(window).width(), 77 height: Ease.isLoggedIn ? $(window).height() - 48 : $(window).height() 78 }); 79 }); 80 81 // Remove loader 82 $(window).on('load', function () { 83 $('#loader_spinner').fadeOut(300, function () { 84 $('#loader_holder').fadeOut(300); 85 }); 86 }); 87 88 $('.adgroup--lysing iframe').on('load', function() { 89 try { 90 $(this).contents().find("head").append($('<style type="text/css">canvas { width: 100% !important; height: 100% !important; }</style>')); 91 } catch (ex) { 92 } 93 }); 94 95 // Iframe lazyloader 96 $('iframe[data-src]').each(function() { 97 var $this = $(this); 98 $this.attr('src', $this.attr('data-src')).removeAttr('data-src'); 99 }); 100 101 // Bind searchbox reset 102 $('.searchreset').click(function () { 103 $('.searchbox').focus(); 104 }); 105 106 107 // HTML entity translation functions used in dictionaries 108 Tools.get_html_translation_table = function (table, quote_style) { 109 var entities = {}; 110 var hash_map = {}; 111 var decimal; 112 var constMappingTable = {}; 113 var constMappingQuoteStyle = {}; 114 var useTable = {}; 115 var useQuoteStyle = {}; 116 // Translate arguments 117 constMappingTable[0] = 'HTML_SPECIALCHARS'; 118 constMappingTable[1] = 'HTML_ENTITIES'; 119 constMappingQuoteStyle[0] = 'ENT_NOQUOTES'; 120 constMappingQuoteStyle[2] = 'ENT_COMPAT'; 121 constMappingQuoteStyle[3] = 'ENT_QUOTES'; 122 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS'; 123 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT'; 124 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') { 125 throw new Error("Table: " + useTable + ' not supported'); 126 // return false; 127 } 128 entities['38'] = '&'; 129 if (useTable === 'HTML_ENTITIES') { 130 entities['160'] = ' '; 131 entities['161'] = '¡'; 132 entities['162'] = '¢'; 133 entities['163'] = '£'; 134 entities['164'] = '¤'; 135 entities['165'] = '¥'; 136 entities['166'] = '¦'; 137 entities['167'] = '§'; 138 entities['168'] = '¨'; 139 entities['169'] = '©'; 140 entities['170'] = 'ª'; 141 entities['171'] = '«'; 142 entities['172'] = '¬'; 143 entities['173'] = '­'; 144 entities['174'] = '®'; 145 entities['175'] = '¯'; 146 entities['176'] = '°'; 147 entities['177'] = '±'; 148 entities['178'] = '²'; 149 entities['179'] = '³'; 150 entities['180'] = '´'; 151 entities['181'] = 'µ'; 152 entities['182'] = '¶'; 153 entities['183'] = '·'; 154 entities['184'] = '¸'; 155 entities['185'] = '¹'; 156 entities['186'] = 'º'; 157 entities['187'] = '»'; 158 entities['188'] = '¼'; 159 entities['189'] = '½'; 160 entities['190'] = '¾'; 161 entities['191'] = '¿'; 162 entities['192'] = 'À'; 163 entities['193'] = 'Á'; 164 entities['194'] = 'Â'; 165 entities['195'] = 'Ã'; 166 entities['196'] = 'Ä'; 167 entities['197'] = 'Å'; 168 entities['198'] = 'Æ'; 169 entities['199'] = 'Ç'; 170 entities['200'] = 'È'; 171 entities['201'] = 'É'; 172 entities['202'] = 'Ê'; 173 entities['203'] = 'Ë'; 174 entities['204'] = 'Ì'; 175 entities['205'] = 'Í'; 176 entities['206'] = 'Î'; 177 entities['207'] = 'Ï'; 178 entities['208'] = 'Ð'; 179 entities['209'] = 'Ñ'; 180 entities['210'] = 'Ò'; 181 entities['211'] = 'Ó'; 182 entities['212'] = 'Ô'; 183 entities['213'] = 'Õ'; 184 entities['214'] = 'Ö'; 185 entities['215'] = '×'; 186 entities['216'] = 'Ø'; 187 entities['217'] = 'Ù'; 188 entities['218'] = 'Ú'; 189 entities['219'] = 'Û'; 190 entities['220'] = 'Ü'; 191 entities['221'] = 'Ý'; 192 entities['222'] = 'Þ'; 193 entities['223'] = 'ß'; 194 entities['224'] = 'à';
195 entities['225'] = 'á'; 196 entities['226'] = 'â'; 197 entities['227'] = 'ã'; 198 entities['228'] = 'ä'; 199 entities['229'] = 'å'; 200 entities['230'] = 'æ'; 201 entities['231'] = 'ç'; 202 entities['232'] = 'è'; 203 entities['233'] = 'é'; 204 entities['234'] = 'ê'; 205 entities['235'] = 'ë'; 206 entities['236'] = 'ì'; 207 entities['237'] = 'í'; 208 entities['238'] = 'î'; 209 entities['239'] = 'ï'; 210 entities['240'] = 'ð'; 211 entities['241'] = 'ñ'; 212 entities['242'] = 'ò'; 213 entities['243'] = 'ó'; 214 entities['244'] = 'ô'; 215 entities['245'] = 'õ'; 216 entities['246'] = 'ö'; 217 entities['247'] = '÷'; 218 entities['248'] = 'ø'; 219 entities['249'] = 'ù'; 220 entities['250'] = 'ú'; 221 entities['251'] = 'û'; 222 entities['252'] = 'ü'; 223 entities['253'] = 'ý'; 224 entities['254'] = 'þ'; 225 entities['255'] = 'ÿ'; 226 } 227 if (useQuoteStyle !== 'ENT_NOQUOTES') { 228 entities['34'] = '"'; 229 } 230 if (useQuoteStyle === 'ENT_QUOTES') { 231 entities['39'] = '''; 232 } 233 entities['60'] = '<'; 234 entities['62'] = '>'; 235 // ascii decimals to real symbols 236 for (decimal in entities) { 237 if (entities.hasOwnProperty(decimal)) { 238 hash_map[String.fromCharCode(decimal)] = entities[decimal]; 239 } 240 } 241 return hash_map; 242 }; 243 244 Tools.htmlentities = function (string, quote_style, charset, double_encode) { 245 var hash_map = Tools.get_html_translation_table('HTML_ENTITIES', quote_style); 246 var symbol = ''; 247 string = string === null ? '' : string + ''; 248 if (!hash_map) { 249 return false; 250 } 251 if (quote_style && quote_style === 'ENT_QUOTES') { 252 hash_map["'"] = '''; 253 } 254 double_encode = double_encode === null || !!double_encode; 255 var regex = new RegExp("&(?:#\\d+|#x[\\da-f]+|[a-zA-Z][\\da-z]*);|[" + 256 Object.keys(hash_map) 257 .join("") 258 // replace regexp special chars 259 .replace(/([()[\]{}\-.*+?^$|\/\\])/g, "\\$1") + "]", 260 "g"); 261 return string.replace(regex, function(ent) { 262 if (ent.length > 1) { 263 return double_encode ? hash_map["&"] + ent.substr(1) : ent; 264 } 265 return hash_map[ent]; 266 }); 267 }; 268 269 // Bookclub payment option input section show/hide 270 /*$("input[name='PaymentType']").change(function() { 271 if ($('#radioAutomaticPayment').is(':checked') === true) { 272 $('#user-profile-bookclub--payment-option-gs').slideDown(); 273 } 274 else { 275 $('#user-profile-bookclub--payment-option-gs').slideUp(); 276 } 277 });*/ 278 279 // Products show and hide 'order by' 280 $('#products-order-by--header').on('click', function () { 281 $('#products-order-by--orders').slideToggle(150); 282 $('.products-order-by--icon--right').toggleClass('products-order-by--icon--down'); 283 }); 284 285}); 286 287 288/** 289 * Initialize a newsgroup lazy loader (for use with multiple newsgroup componenets) 290 * @param limit 291 */ 292var lazyLoader2_scrollBusy = false; 293var lazyLoader2 = function (limit) { 294 limit = (typeof limit !== 'undefined' && limit) ? limit : Tools.getQueryVariable('_Limit'); 295 var $newsgroup_show_more = $('#newsgroup_show_more'); 296 $newsgroup_show_more.on('click', function () { 297 var $newsgroup_show_more = $('#newsgroup_show_more'); 298 $newsgroup_show_more.addClass('busy'); 299 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 300 var $ease_newsgroup = $('.newsgroup--self').last(); 301 $ease_newsgroup.attr('data-ease-buttonselector', '#newsgroup_show_more'); 302 var language = $ease_newsgroup.attr('data-ease-language'); 303 var excludenewsarticleid = $ease_newsgroup.attr('data-ease-excludenewsarticleid'); 304 var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 305 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 306 var template = $ease_newsgroup.attr('data-ease-template'); 307 var search = $ease_newsgroup.attr('data-ease-search'); 308 var $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 309 var items = $ease_newsarticles.length; 310 $.get('/page_default.php', { 311 Offset: offset, 312 Limit: items, 313 Interval: interval, 314 NewsgroupIds: newsgroupIds, 315 Search: search, 316 p: 'newsgroup_lazy', 317 t: template, 318 Language: language,
319 ExcludeNewsarticleId: excludenewsarticleid, 320 Append: true 321 }, function (html) { 322 var $html = $(html).find('.lazyRoot'); 323 //$html = $html.length === 0 ? $(html) : $html; 324 var $ease_newsgroup = $('.newsgroup--self'); 325 var previousCount = $ease_newsgroup.find('.lazyRoot').length; 326 $ease_newsgroup.find('.lazyRoot').last().after($html); 327 Ease.overlay && Ease.overlay.initialize($ease_newsgroup); 328 Ease.initializePlugins(); 329 $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 330 $ease_newsgroup.attr('data-ease-limit', $ease_newsarticles.length); 331 history.replaceState(null, '', '?' + Tools.getQuery('_Limit') + '&_Limit=' + $ease_newsarticles.length); 332 $newsgroup_show_more.removeClass('busy'); 333 Revealator.refresh(); 334 var currentCount = $ease_newsgroup.find('.lazyRoot').length; 335 if ((previousCount + interval) > currentCount) { 336 $('#newsgroup_show_more').hide(); 337 lazyLoader2_scrollBusy = true; 338 } else { 339 lazyLoader2_scrollBusy = false; 340 } 341 }); 342 }); 343 344 345 // Auto activate lazyLoader2 on scroll to bottom 346 $(window).on('scroll resize load ready', function () { 347 if (!lazyLoader2_scrollBusy) { 348 lazyLoader2_scrollBusy = true; 349 setTimeout(function () { 350 var $newsgroup_show_more = $('#newsgroup_show_more'); 351 if ($(window).scrollTop() + $(window).height() > $(document).height() - 400) { 352 $newsgroup_show_more.click(); 353 } else { 354 lazyLoader2_scrollBusy = false; 355 } 356 }, 100); 357 } 358 }); 359 360 window.onpopstate = function() { 361 var $newsgroup_show_more = $('#newsgroup_show_more'); 362 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 363 var $ease_newsgroup = $('#ease_newsgroup_' + newsgroupIds); 364 var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 365 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 366 $ease_newsgroup.attr('data-ease-limit', Tools.getQueryVariable('_Limit') ? Tools.getQueryVariable('_Limit') : interval); 367 Ease.newsgroups && Ease.newsgroups.onchange(); 368 }; 369 370 var $ease_newsarticles = $('.newsgroup--component').find('.lazyRoot').not('.add'); 371 if ($ease_newsarticles.length < limit) { 372 $newsgroup_show_more.hide(); 373 } 374};
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.