1var CB5; 2if (typeof CB5 == 'undefined') CB5 = {}; 3 4(function() { 5 6 //default texts for old sites 7 $(function () { 8 if (!CB5.config.texts) CB5.config.texts = { 9 pwdtext: 'A password is required to view this page!', 10 password: 'Password', 11 cancel: 'Cancel' 12 }; 13 14 try { 15 //init localStorage 16 if (typeof(sessionStorage) != 'undefined') 17 CB5.session = sessionStorage; 18 else 19 CB5.session = {}; 20 21 if (CB5.session.password) 22 CB5.submittedPassword = CB5.session.password; 23 } catch (e) { 24 CB5.session = {}; 25 } 26 }); 27 28 //fix old links 29 $(function () { 30 if (!('structureMap' in CB5.config)) return; 31 $('a').each(function () { 32 var me = $(this); 33 var id = me.attr('data-linkref'); 34 if (!id) return; 35 if (!(id in CB5.config.structureMap)) return; 36 var url = CB5.config.structureMap[id]+'.html'; 37 if (url == me.attr('href')) return; 38 me.attr('href', url); 39 }); 40 }); 41 42 //form check ping, multipart for file upload 43 function initForm () { 44 45 var frm = $('#cb-form'); 46 if (!frm.length) 47 frm = $('form.cb-form'); 48 if (!frm.length) return; 49 50 frm.each(function() { 51 var frm = $(this); 52 if (frm.data('cb-frm-inited')) return; 53 frm.data('cb-frm-inited', true); 54 55 //cuid is the real userID in dynamic pages 56 var uid = CB5.config.cuid ? CB5.config.cuid : CB5.config.uid; 57 CB5.getJson(frm[0].action + '?u='+uid+'&cb_ping_js='+$.now(), function(ret) { 58 frm.append($('<input>').attr({type:'hidden', name:'__cb-token__', value:ret.token})); 59 frm.append($('<input>').attr({type:'hidden', name:'__uid__', value:uid})); 60 frm.append($('<input>').attr({type:'hidden', name:'__pid__', value:CB5.config.pid})); 61 frm.append($('<input>').attr({type:'hidden', name:'__attempts__', value:ret.attempts})); 62 }); 63 _initForm(frm); 64 }); 65 } 66 67 function _initForm(frm) 68 { 69 //debug('each'); 70 if (frm.find('input[type=file]').length) 71 frm.attr('enctype', 'multipart/form-data'); 72 73 //validation 74 frm.submit(function() { 75 var err = false; 76 function mark(el) { 77 el.addClass('cb-formerror'); 78 el.focus(resetErr); 79 el.change(resetErr); 80 err = true; 81 } 82 //validate email 83 frm.find('input[type=email]').each(function () { 84 var el = $(this); 85 if (CB5.emailReg.test(el.val())) return; 86 mark(el); 87 }); 88 //validate number 89 frm.find('input[type=number]').each(function () { 90 var el = $(this); 91 if (/^[\d,\.]+$/.test(el.val())) return; 92 mark(el); 93 }); 94 //validate notempty 95 frm.find('input[type=text][required],textarea[required]').each(function () { 96 var el = $(this); 97 if (el.val() != '') return; 98 mark(el); 99 }); 100 101 frm.find('input[type=radio]').each(function() { 102 var el = $(this); 103 if (frm.find('input[type=radio][name="'+el.attr('name')+'"]:checked').length > 0) return; 104 mark(el); 105 }); 106 107 frm.find('input[type=checkbox][required]').each(function() { 108 var el = $(this); 109 if (el.is(':checked')) return; 110 mark(el); 111 }); 112 113 if(frm.find('input[type=hidden][name=__poll__]').length > 0) { 114 var attempts = parseInt(frm.find('input[type=hidden][name=__attempts__]').eq(0).val()); 115 var maxAttemtps = parseInt(frm.find('input[type=hidden][name=__poll__]').eq(0).val()); 116 if( attempts >= maxAttemtps) { 117 err = true; 118 alert("You have already submitted this form for the maximum number of times. No more"); 119 } 120 } 121 122 return !err; 123 }); 124 function resetErr() { 125 $(this).removeClass('cb-formerror'); 126 $('.cb-form input[type=radio][name="'+$(this).attr('name')+'"]').removeClass('cb-formerror'); 127 } 128 } 129 130 $(initForm); 131 132 //download links 133 function doLinks() { 134 var key = 'files/secure-downloads/'; 135 $('a[href]').each(function () { 136 var href = $(this).attr('href'); 137 if ((href.indexOf('files/downloads/') == 0 || href.indexOf(key) == 0) && $(this).attr('target') == '_self') { 138 if(href.indexOf('files/downloads/') == 0) 139 $(this).attr('download', href.substr(16)); 140 else 141 $(this).attr('download', href.substr(key.length)); 142 } 143 144 }) 145 } 146 147 //firefox proof javascript action links 148 function doLinksFF() { 149 var key = 'javascript:setPageState'; 150 $('a[href]').each(function() { 151 var href = $(this).attr('href'); 152 if(href.indexOf(key) == 0) { 153 $(this).attr('href', 'javascript:void(0)').attr('onClick', decodeURI(href.substr("javascript:".length))); 154 } 155 }); 156 } 157 158 CB5.fonts = {}; 159 CB5.cbFonts = {}; 160 var getRealPath = CB5.getRealPath; 161 162 CB5.addFont = function(name, skipExt, isCb) { 163 if (!name || name == '"' || name.toLowerCase() == 'arial') return 164 if (isCb) CB5.cbFonts[name] = true; 165 name += ((skipExt || isCb || name.slice(0,6)==='cbusr-') ? '' : '::latin,latin-ext'); 166 CB5.fonts[name] = true; 167 }; 168 169 CB5.submittedPassword = false;
170 171 var elements = []; 172 var render = CB5.render; 173 CB5.addElement = function (params) { 174 elements.push(params); 175 }; 176 177 CB5.ipadFix = function () { 178 //ugly fix for dissapearing menu on iPad - force re-render 179 if (CB5.isIOS) { 180 $('#page .cbel').css({opacity:.9999}); 181 setTimeout(function () { 182 $('#page .cbel').css({opacity:''}); 183 }, 1); 184 } 185 }; 186 187 if (typeof Object.defineProperty != 'function') return; 188 if (typeof Element == 'undefined') return; 189 190 if (!document.createElement('span').dataset) { 191 Object.defineProperty(Element.prototype, 'dataset', { 192 get:function() { 193 if (this.__dataset) return this.__dataset; 194 var set = this.__dataset = {}; 195 for (var attr in this.attributes ) { 196 if (this.attributes.hasOwnProperty(attr) && this.attributes[attr].name && /^data-[a-z_\-\d]*$/i.test(this.attributes[attr].name) ) { 197 var name = this.attributes[attr].name.substr(5); 198 name = name.replace(/\-[a-z]/g, function(a, b, c) { return a.substr(1).toUpperCase();}); 199 set[name] = this.attributes[attr].value; 200 } 201 } 202 return set; 203 } 204 }); 205 } 206 207 208 function mkDiv() { return $('<div/>'); } 209 function mkLoading() { return $('<img src="'+getRealPath('shared://loading.gif')+'"/>'); } 210 function mkImage(src) { var img = new Image; img.src=src; return $(img); } 211 function mkA(label) { return $('<a href="javascript:void(0)"></a>').text(label);} 212 213 function gradient(el, c1, c2) { 214 el.css({backgroundImage:'-webkit-gradient(linear, left top, left bottom, from('+c1+'), to('+c2+'))'});//chrome 10+ 215 el.css({backgroundImage:'-webkit-linear-gradient(top, '+c1+', '+c2+')'});//android 216 el.css({backgroundImage:'-moz-linear-gradient(top, '+c1+', '+c2+')'}); 217 } 218 219 //----------------------------------------------------- 220 // JSONP 221 //----------------------------------------------------- 222 function getJson(path, callback) { 223 $.ajax(getRealPath(path), { 224 jsonp: 'cbjp', 225 crossDomain: true, 226 dataType: 'jsonp', 227 success: callback 228 }); 229 } 230 CB5.getJson = getJson; 231 232 233 function loadMulti(data, callback, prefix, dest) { 234 var cnt = data.length; 235 for (var i=0; i<data.length; i++) { 236 (function (i) { 237 var img = new Image; 238 data[i][dest] = img; 239 img.onload = function() { 240 cnt--; if (cnt == 0) callback(); 241 }; 242 img.src = getRealPath(prefix + encodeURIComponent(data[i].relSrc || data[i].src)); 243 })(i); 244 } 245 } 246 CB5.loadMulti = loadMulti; 247 248 CB5.borderBox = function(css) { 249 $.extend(css, {WebkitBoxSizing: 'border-box', boxSizing: 'border-box', MozBoxSizing: 'border-box'}); 250 return css; 251 }; 252 253 var bannerDone = false; 254 function doBanner() { 255 if (bannerDone) return; 256 bannerDone = true; 257 258 var bnr = $('.cbel.cb-banner'); 259 var url = CB5.config.rootUrl + 'action/banner/?uid='+CB5.config.uid; 260 if(top.location.protocol == 'https:') return; 261 if (bnr.length) url += '&nb=1'; 262 CB5.getJson(url, function (data) { 263 if (data.bannerLink) 264 bnr.wrap('<a href="'+data.bannerLink+'"/>'); 265 if (data.banner) { 266 $('#topBanner').slideDown('fast'); 267 /*we have user banner(s), switch off skyscraper banner*/ 268 //if (!bnr.length) self.bannerURL = data.banner; 269 CB5.loadScript('shared/topbanner/topbanner5.js'); 270 } 271 }); 272 } 273 274 var fontsLoadedCallbacks = []; 275 CB5.fontsLoaded = function (callback) { 276 fontsLoadedCallbacks.push(callback); 277 }; 278 279 function loadFonts() { 280 281 if (!self.WebFont) return; //only newly published pages use WebFont loading 282 var cnt = 0; 283 284 //console.log(CB5.fonts); 285 286 for(var name in CB5.fonts) { 287 if (!CB5.fonts.hasOwnProperty(name)) continue; 288 cnt ++; 289 var conf = { 290 fontinactive: done, 291 fontactive: done 292 }; 293 if (name.slice(0, 6) === 'cbusr-') 294 conf.custom = { 295 families: [name], 296 urls: [CB5.fontURL + CB5.config.uid + '/' + name.replace(/ /g, '_')+'.css'] 297 }; 298 else if (CB5.cbFonts[name]) { 299 conf.custom = { 300 families: [name], 301 urls: [CB5.fontURL + name.replace(/ /g, '_')+'.css'] 302 }; 303 } else { 304 let bunny_font_url = "https://fonts.bunny.net/css?family=" + encodeURIComponent($.trim(name.toLowerCase().replace(/ /g, "-"))); 305 306 conf.custom = { 307 families: [name], 308 urls: [bunny_font_url] 309 }; 310 //conf.google = {families: [name]}; 311 } 312 313 //console.log("loading conf", conf); 314 315 WebFont.load(conf); 316 } 317 if (cnt == 0) done(); 318 function done(font, style) { 319 setTimeout(done2, 20); 320 //debug('font loaded '+font); 321 } 322 function done2(font, style) { 323 cnt --; 324 if (cnt > 0) return; 325 //debug('all fonts loaded'); 326 327 //notify fonts loaded 328 for (var i=0; i<fontsLoadedCallbacks.length; i++) 329 fontsLoadedCallbacks[i](); 330 331 //adjust word-spacing on each line until it fits in the box 332 $('.cb-text2>span').each(function () { 333 var line = $(this); 334 if (line.hasClass('justify')) return; 335 var sp = 0; 336 while (true) { 337 var sum = 0; 338 sp ++; 339 if (sp > 5) return; 340 line.children().each(function () { 341 sum += $(this).width(); 342 }); 343 if (line.width() < sum) { 344 line.css('wordSpacing', -sp); 345 //debug('adjust: ' + (line.width() - sum) + ' >> ' + sp); 346 } 347 else return; 348 } 349 }); 350 //auto-adjust for justify 351 $('.cb-text2>span.justify').each(function () { 352 var line = $(this); 353 var sp = 0; 354 while (true) { 355 sp ++; 356 if (sp > 5) return; 357 if (line[0].scrollHeight - 5 >
357 line.height()) 358 line.css('wordSpacing', -sp); 359 else return; 360 } 361 }); 362 } 363 } 364 365 //hide navigation before rendering page 366 $(function (){ 367 $('.cb-navigation').hide(); 368 }); 369 370 CB5.renderPage = function () { 371 if (CB5.encrypted) 372 doPasswordPage(); 373 374 doBanner(); 375 loadFonts(); 376 doLinks(); 377 doLinksFF(); 378 379 /*//fix empty encrypted nav - copy content from the nav in template 380 var navContent = null; 381 $('.cb-navigation2').each(function () { 382 if ($(this).html().indexOf('<!--#include') == 0) 383 $(this).html(navContent); 384 else 385 navContent = $(this).html(); 386 });*/ 387 388 $('#site-loading').remove(); 389 $('.cb-navigation').show(); 390 391 if (!GA.userID && CB.siteSettings.analyticsID) GA.setUser(CB.siteSettings.analyticsID); 392 //alert(_gaq); 393 394 //fix empty li 395 $('.cb-text2 li').each(function () { 396 var first = $(this).find('span:eq(0)'); 397 if (first.text() == '') { 398 $(this).css('margin-top', first.height()); 399 first.remove(); 400 } 401 if (/^[\n\r]*$/.test($(this).text())) $(this).css('list-style-type', 'none'); 402 }); 403 404 //delete empty links 405 $('.cb-text2 a').each(function () { 406 if ($(this).text() == '') $(this).remove(); 407 }); 408 409 410 //justified text trick 411 $('.cb-text .justify').append($('<div>').css({display:'inline-block',width:'100%'})); 412 $('.cb-text2').each(function(){ 413 $(this).find('.justify:last div').remove(); 414 }); 415 416 for (var i=0; i<elements.length; i++) { 417 //prevent duplicate render 418 var id = elements[i][1]; 419 if (render.uniq[id]) continue; 420 render.uniq[id] = true; 421 //debug('render ' + elements[i][0]); 422 try { 423 render[elements[i][0]].apply(null, elements[i].slice(1)); 424 } catch (e) { 425 debug('error rendering element: '+elements[i][0]); 426 debug(e.message, e.stack); 427 } 428 } 429 430 $('[data-extra]').each(function () { 431 var data = JSON.parse($(this).attr('data-extra')); 432 //(id, skin, colorList, basepath) { 433 render[data.elementType](this.id, data); 434 }); 435 436 437 updatePageHeight(); 438 439 $('.cbel').each(function() { 440 $(this).load(function(){ 441 //debug('loaded ' + $(this).attr('id') + ' w=' + $(this).height()); 442 updatePageHeight(); 443 }); 444 }); 445 446 //Transitions 447 (function () { 448 $('.cbel[data-transition^=none]').removeAttr('data-transition'); 449 var names = []; 450 if ($('.cb-text[data-transition]').length) names.push('TransitionsText.c.js'); 451 if ($('.cb-image[data-transition]').length) names.push('TransitionsImage.c.js'); 452 if ($('.cbel[data-transition]').not('.cb-image,.cb-text').length) 453 names.push('TransitionsOther.js'); 454 if (names.length) { 455 $('.cbel[data-transition]').css({visibility:'hidden'}); 456 var cnt = 2; 457 function check () { 458 cnt--; 459 if (cnt > 0) return; 460 //we can start the transitions now 461 $('.cbel[data-transition]').each(function () { 462 var $el = $(this), plugin; 463 if ($el.is('.cb-image')) plugin = CB5.plugin.TransitionsImage; 464 else if ($el.is('.cb-text')) plugin = CB5.plugin.TransitionsText; 465 else plugin = CB5.plugin.TransitionsOther; 466 plugin.runWhen($el); 467 }); 468 } 469 $(window).load(check); 470 CB5.loadScript(names.map(function (name) { 471 return getRealPath('shared://plugin/'+name); 472 }), check); 473 } 474 })(); 475 476 477 //Image Frames 478 (function() { 479 var list = $('.cb-image[data-frame]'); 480 if(!list.length) return; 481 $(function() { 482 CB5.loadScript(getRealPath('shared://plugin/ImageFrame.js'), function() { 483 list.each(function(e) { 484 var frameData = $.parseJSON(($(list[e]).attr('data-frame'))); 485 var frame = {type: frameData.type}; 486 frameData.type == 'BitmapFrame' ? frame.skin = frameData.skin : frame.colors = frameData.colors; 487 frame.sizes = {}; 488 if(frameData.type == 'BitmapFrame' || frameData.type == 'RectFrame' || frameData.type == 'Polaroid') 489 frame.sizes[frameData.data[0][0]] = frameData.data[1]; 490 else 491 frameData.data.forEach(function(v){ 492 frame.sizes[v[0][0]] = v[1]; 493 }); 494 if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 495 list[e].onload = function() { 496 CB5.plugin.ImageFrame.render($(this).attr('id'), frame, frameData.matrix
496); 497 }; 498 } 499 else 500 CB5.plugin.ImageFrame.render($(list[e]).attr('id'), frame, frameData.matrix); 501 }); 502 }); 503 }); 504 })(); 505 506 (function () { 507 $('.cb-image[data-reflection]').each(function () { 508 var $el = $(this); 509 CB5.ImageEffects.render($el, $el.matrix(), 510 $el.attr('data-filter'), $el.attr('data-reflection')); 511 }); 512 })(); 513 514 (function() { 515 $('.cb-image[data-tint]').each(function() { 516 var $el = $(this); 517 CB5.ImageEffects.addTint($el, $el.matrix(), CB5.Color.toRgba($el.attr('data-tint'))); 518 }) 519 })(); 520 521 //noise fills 522 $('[data-noise-fill]').each(function () { 523 var fill = JSON.parse($(this).attr('data-noise-fill')); 524 $(this).css({background:'url('+CB5.util.noiseFill(fill.color, fill.color2, fill.intensity, fill.opacity)+')'}); 525 }); 526 527 GA.trackPage(false); 528 }; 529 530 var transform = CB5.transform = function(o, value) { 531 o.WebkitTransform = o.MozTransform = o.msTransform = o.OTransform = o.transform=value; 532 return o; 533 }; 534 535 536 537 function debug(msg) { 538 if (self.console && console.debug) console.debug(msg); 539 } 540 541 CB5.updatePageHeight = updatePageHeight; 542 function updatePageHeight() 543 { 544 //compute page height 545 var tplHeight = CB5.config.tplHeight; 546 var pHeight = 0; 547 if (CB5.config.pageHeight) 548 pHeight = Number(CB5.config.pageHeight); 549 else { 550 $('.cbel').each(function() { 551 if($(this).attr('data-behaviour')) return; 552 pHeight = Math.max(elBottom(this), pHeight); 553 }); 554 555 pHeight += Number(CB5.config.tplMarginBottom); 556 pHeight = Math.max(pHeight, Number(tplHeight)); 557 } 558 559 $('#page').height(pHeight); 560 $('body,html').css('height','auto'); 561 $('.cbel.cb-behaviour').removeClass('cb-behaviour'); 562 563 //apply behaviour 564 $('[data-behaviour]').each(function() { 565 var el = $(this); 566 // data-behaviour="type:ini" 567 if (!el.get(0).dataset) return; 568 var a = el.get(0).dataset.behaviour.split(':'); 569 //if (a[0] == '') 570 if (a[0] == 'vertical-stretch') { 571 var w = el.width(); 572 if (!w) return; 573 var h = pHeight - tplHeight + Number(a[1]); 574 if (el[0].tagName != 'IMG') 575 el.height(h); 576 else { 577 var ds = el[0].dataset; 578 if (ds.matrix && ds.origsize) { 579 var ma = ds.matrix.split(','); 580 var mo = ds.origsize.split(','); 581 ma[4] = ma[5] = 0; 582 ma[3] = h/mo[1]; 583 el.css(CB5.vendorCss({}, 'transform', 'matrix('+ma+')')); 584 } 585 } 586 } 587 else if (a[0] == 'stick-to-bottom') 588 //el.main.y = Number(el.getData('behaviourIni')) + height - template.tplHeight; 589 el.css('top', Math.round(Number(a[1]) + Number(pHeight) - Number(tplHeight))); 590 }); 591 } 592 593 function elBottom(elem) { 594 if (!elem || (elem.dataset && elem.dataset.behaviour) || $(elem).is('.cb-backgroundBar')) return 0; 595 var doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement; 596 var clientTop = docElem.clientTop || body.clientTop || 0; 597 var y = elem.getBoundingClientRect().bottom + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop; 598 return y; 599 } 600 601 602 603 function convertColors(colorList) { 604 var colors = colorList.split(','); 605 colors.reverse(); 606 for (var i=0; i<colors.length; i++) 607 colors[i] = Color.toRgba(('00000000'+colors[i]).substr(-8)); 608 return colors; 609 } 610 611 function canvas2Graphics(canvas) 612 { 613 if (!canvas.getContext) return null; 614 var ctx = canvas.getContext('2d'); 615 var g = { 616 ctx: ctx, 617 clear: function() { 618 ctx.clearRect(0, 0, canvas.width, canvas.height); 619 }, 620 moveTo: function (x, y) { 621 ctx.moveTo(x, y); 622 }, 623 lineTo: function(x, y) { 624 ctx.lineTo(x, y); 625 }, 626 curveTo: function(cx, cy, x, y) { 627 ctx.quadraticCurveTo(cx, cy, x, y); 628 } 629 }; 630 return g; 631 } 632 633 634 635 //------------------------------------------------------------------------------------- 636 // PASSWORD PAGES 637 //------------------------------------------------------------------------------------- 638 function doPasswordPage() { 639 if (CB5.encrypted) { 640 641 if (CB5.session.password) { 642 var dec = Aes.Ctr.decrypt(CB5.encrypted, CB5.session.password, 128); 643 if (dec.indexOf('cb-encrypt') === 0) { 644 $('#page').html($('#page').html() + dec.substr(10)); 645 CB5.encrypted = false;
646 CB5.renderPage(); 647 initForm(); 648 return; 649 } 650 } 651 652 var div = mkDiv().css({margin:'200px auto', background:'white', 653 borderRadius:5, padding: 30, width: 400, textAlign:'center', 654 fontFamily: 'Arial, sans-serif', 655 boxShadow:'5px 5px 5px rgba(0,0,0,.3)' 656 }); 657 var frame = mkDiv().css({display:'inline-block', textAlign:'left'}); 658 div.append(frame); 659 var inp, btn, btn2; 660 frame.append( 661 mkDiv().css({fontWeight:'bold', marginBottom:20}).text(CB5.config.texts.pwdtext), 662 mkDiv().text(CB5.config.texts.password+':'), 663 inp = $('<input type="password">').css({width:200}), 664 btn = $('<input type="button" value="OK">'), 665 btn2 = $('<input type="button">').val(CB5.config.texts.cancel) 666 ); 667 668 $('body').append(mkDiv().css({position:'absolute',top:0,width:'100%',zIndex:2000}).append(div)); 669 inp.focus(); 670 inp.focus(function() { 671 inp.removeClass('error'); 672 }); 673 function click() { 674 var dec = Aes.Ctr.decrypt(CB5.encrypted, inp.val(), 128); 675 if (dec.indexOf('cb-encrypt') === 0) { 676 div.parent().remove(); 677 elements = [];//no duplicate rendering 678 $('#page').html($('#page').html() + dec.substr(10)); 679 CB5.encrypted = false; 680 CB5.renderPage(); 681 CB5.submittedPassword = inp.val(); 682 initForm(); 683 CB5.session.password = inp.val(); 684 return; 685 } 686 inp.addClass('error'); 687 };
688 btn.click(click); 689 btn2.click(function() { 690 div.parent().remove(); 691 }); 692 inp.keyup(function (e) { 693 if (e.keyCode == 13) click(); 694 }); 695 } 696 } 697 698 CB5.replaceTexts = function (strings) { 699 for (var name in strings) { 700 var vName = '{$' + name + '}'; 701 702 function recTextNodes(node) { 703 if (node.nodeType == 3) { 704 if (!node.nodeValue) return; 705 node.nodeValue = node.nodeValue.replace(vName, strings[name]); 706 return; 707 } 708 for (var i = 0, len = node.childNodes.length; i < len; ++i) { 709 recTextNodes(node.childNodes[i]); 710 } 711 } 712 $('.cbel').each(function () { 713 recTextNodes(this); 714 }); 715 } 716 $('.h5-text.delayed').removeClass('delayed'); 717 }; 718 719 $(function () { 720 $('body').prepend($('.cbel.cb-backgroundBar')); 721 }); 722 723 724 $(function () { 725 var $code = $('.cb-externalCode'); 726 if (!$code.length) return; 727 var tid, iid; 728 $code.on('mousedown', function () { 729 clearTimeout(tid); 730 clearInterval(iid); 731 iid = setInterval(updatePageHeight, 20); 732 tid = setTimeout(function () { 733 clearTimeout(iid); 734 }, 1000); 735 }); 736 for (var i=0; i<7; i++) 737 setTimeout(updatePageHeight, 300*i); 738 }); 739 740})(); 741 742$(function () { 743 var found = true; 744 $('a[href]').each(function () { 745 if (!found && /javascript:secureDownload/.test($(this).attr('href'))) 746 found = true; 747 }); 748 if (!found) return; 749 var s = document.createElement('script'); 750 s.defer = true; 751 s.src = 'shared/html5/md5.js'; 752 document.head.appendChild(s); 753}); 754 755if ('undefined' === typeof(CB)) $(CB5.renderPage); 756 757$(function () { 758 $('[data-fixed=1]').each(function () { 759 var o = $(this).offset(); 760 $(this).css({left: o.left, top: o.top, position: 'fixed', zIndex: 1001}); 761 }); 762});
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.