1/* cached */ 2/* 3ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 4â ease/js/ease.tools.js â 5ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 6*/ 7var Tools = { 8 language: undefined, 9 translations: {} 10}; 11 12$(function () { 13 14 Tools.copyToClipboard = function (str) { 15 var el = document.createElement('textarea'); // Create a <textarea> element 16 el.value = str; // Set its value to the string that you want copied 17 el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof 18 el.style.position = 'absolute'; 19 el.style.left = '-9999px'; // Move outside the screen to make it invisible 20 document.body.appendChild(el); // Append the <textarea> element to the HTML document 21 var selected = 22 document.getSelection().rangeCount > 0 // Check if there is any content selected previously 23 ? document.getSelection().getRangeAt(0) // Store selection if found 24 : false; // Mark as false to know no selection existed before 25 el.select(); // Select the <textarea> content 26 document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events) 27 document.body.removeChild(el); // Remove the <textarea> element 28 if (selected) { // If a selection existed before copying 29 document.getSelection().removeAllRanges(); // Unselect everything on the HTML document 30 document.getSelection().addRange(selected); // Restore the original selection 31 } 32 }; 33 34 Tools.getCookie = function (_cookie_name) { 35 var cookie_value = document.cookie; 36 var cookie_start = cookie_value.indexOf(' ' + _cookie_name + '='); 37 if (cookie_start === -1) { 38 cookie_start = cookie_value.indexOf(_cookie_name + "="); 39 } 40 if (cookie_start === -1) { 41 cookie_value = null; 42 } else { 43 cookie_start = cookie_value.indexOf('=', cookie_start) + 1; 44 var cookie_end = cookie_value.indexOf(';', cookie_start); 45 if (cookie_end === -1) { 46 cookie_end = cookie_value.length; 47 } 48 cookie_value = decodeURIComponent(cookie_value.substring(cookie_start,cookie_end)); 49 } 50 return cookie_value; 51 }; 52 53 54 Tools.getCurrentFile = function() { 55 var url = document.location.href; 56 url = url.substring(0, (url.indexOf('#') === -1) ? url.length : url.indexOf('#')); 57 url = url.substring(0, (url.indexOf('?') === -1) ? url.length : url.indexOf('?')); 58 url = url.substring(url.lastIndexOf('/') + 1, url.length); 59 return url; 60 }; 61 62 Tools.getHash = function(unset, string) { 63 var i, unsetArray = []; 64 if (unset !== undefined && unset !== '') { 65 unsetArray = unset.split(','); 66 for (i = 0; i < unsetArray.length; i++) { 67 unsetArray[i] = $.trim(unsetArray[i]); 68 } 69 } 70 var newQuery = ''; 71 var hash = !string ? document.location.hash.split('#')[1] : string.replace('#', ''); 72 if (hash !== undefined && hash !== null) { 73 var variablesArray = hash.split('&'); 74 for (i = 0; i < variablesArray.length; i++) { 75 var variableKeyValue = variablesArray[i].split('='); 76 var isFound = false; 77 for (var x = 0; x < unsetArray.length; x++) { 78 if (variableKeyValue[0] === unsetArray[x]) { 79 isFound = true; 80 } 81 } 82 if (!isFound) { 83 newQuery += variableKeyValue[0] + '=' + variableKeyValue[1] + '&'; 84 } 85 } 86 newQuery = newQuery.substring(0, newQuery.length - 1); 87 } 88 return newQuery; 89 }; 90 91 Tools.getHashArray = function(unset, string) { 92 var i, unsetArray = []; 93 if (unset !== undefined && unset !== '') { 94 unsetArray = unset.split(','); 95 for (i = 0; i < unsetArray.length; i++) { 96 unsetArray[i] = $.trim(unsetArray[i]); 97 } 98 } 99 var newQueryArray = []; 100 var hash = !string ? document.location.hash.split('#')[1] : string.replace('#', ''); 101 if (hash !== undefined && hash !== null) { 102 var variablesArray = hash.split('&'); 103 for (i = 0; i < variablesArray.length; i++) { 104 var variableKeyValue = variablesArray[i].split('='); 105 var isFound = false; 106 for (var x = 0; x < unsetArray.length; x++) { 107 if (variableKeyValue[0] === unsetArray[x]) { 108 isFound = true; 109 } 110 } 111 if (!isFound) { 112 newQueryArray[variableKeyValue[0]] = variableKeyValue[1]; 113 } 114 } 115 } 116 return newQueryArray; 117 }; 118 119 Tools.getHashCombined = function(mergeString, sourceString) { 120 sourceString = !sourceString ? Tools.getHash() : sourceString; 121 var mergeStringHashArray = Tools.getHashArray('', mergeString); 122 var unsetString = ''; 123 for (var key in mergeStringHashArray) { 124 unsetString += (key + ','); 125 } 126 unsetString = unsetString.length > 0 ? unsetString.substring(0, unsetString.length - 1) : ''; 127 sourceString = Tools.getHash(unsetString, sourceString); 128 return sourceString + (sourceString.length > 0 ? '&' : '') + Tools.getHash('', mergeString); 129 }; 130 131 Tools.getHashVariable = function(variable, string) { 132 var key; 133 var value; 134 var hash = !string ? document.location.hash.split('#')[1] : string.replace('#', ''); 135 if (hash !== undefined && hash !== null) { 136 var variablesArray = hash.split('&'); 137 for (var i = 0; i < variablesArray.length; i++) { 138 if (variablesArray[i].indexOf('=') > -1) { 139 key = variablesArray[i].substring(0, variablesArray[i].indexOf('=')); 140 value = variablesArray[i].substring(variablesArray[i].indexOf('=') + 1); 141 } else { 142 key = variablesArray[i]; 143 value = ''; 144 } 145 if (key === variable) { 146 return value; 147 } 148 } 149 } else { 150 return undefined; 151 } 152 }; 153 154 Tools.getQuery = function(unset) { 155 var i, unsetArray = [];
156 if (unset !== undefined && unset !== '') { 157 unsetArray = unset.split(','); 158 for (i = 0; i < unsetArray.length; i++) { 159 unsetArray[i] = $.trim(unsetArray[i]); 160 } 161 } 162 var newQuery = ''; 163 if (window.location.search !== '') { 164 var query = window.location.search.substring(1); 165 var variablesArray = query.split('&'); 166 for (i = 0; i < variablesArray.length; i++) { 167 if (variablesArray[i].trim() != '') { 168 var variableKeyValue = variablesArray[i].split('='); 169 var isFound = false; 170 for (var x = 0; x < unsetArray.length; x++) { 171 if (variableKeyValue[0] === unsetArray[x]) { 172 isFound = true; 173 } 174 } 175 if (!isFound) { 176 newQuery += variableKeyValue[0] + '=' + variableKeyValue[1] + '&'; 177 } 178 } 179 } 180 newQuery = newQuery.substring(0, newQuery.length - 1); 181 } 182 return newQuery; 183 }; 184 185 Tools.getQueryVariable = function(variable) { 186 var key; 187 var value; 188 var query = window.location.search.substring(1); 189 var variablesArray = query.split('&'); 190 for (var i = 0; i < variablesArray.length; i++) { 191 if (variablesArray[i].indexOf('=') > -1) { 192 key = variablesArray[i].substring(0, variablesArray[i].indexOf('=')); 193 value = variablesArray[i].substring(variablesArray[i].indexOf('=') + 1); 194 } else { 195 key = variablesArray[i]; 196 value = ''; 197 } 198 if (key.toLowerCase() === variable.toLowerCase()) { 199 return decodeURIComponent(value); 200 } 201 } 202 if (variable.substring(0, 1) !== '_') { 203 return Tools.getQueryVariable('_' + variable); 204 } 205 return undefined; 206 }; 207 208 Tools.trim = function (str, charlist) { 209 var whitespace = [' ','\n','\r','\t','\f','\x0b','\xa0','\u2000','\u2001','\u2002','\u2003','\u2004','\u2005','\u2006','\u2007','\u2008','\u2009','\u200a','\u200b','\u2028','\u2029','\u3000'].join(''); 210 var l, i; 211 str += ''; 212 if (charlist) { 213 whitespace = (charlist + '').replace(/([\[\]().?\/*{}+$^:])/g, '$1') 214 } 215 l = str.length; 216 for (i = 0; i < l; i++) { 217 if (whitespace.indexOf(str.charAt(i)) === -1) { 218 str = str.substring(i); 219 break 220 } 221 } 222 l = str.length; 223 for (i = l - 1; i >= 0; i--) { 224 if (whitespace.indexOf(str.charAt(i)) === -1) { 225 str = str.substring(0, i + 1); 226 break 227 } 228 } 229 return whitespace.indexOf(str.charAt(0)) === -1 ? str : '' 230 }; 231 232 Tools.getSegments = function () { 233 return Tools.trim(window.location.pathname, '/').split('/'); 234 }; 235 236 Tools.getSegment = function (segment_index) { 237 return Tools.getSegments()[segment_index]; 238 }; 239 240 Tools.numberFormat = function(number, decimals, dec_point, thousands_sep) { 241 number = (number + '').replace(/[^0-9+\-Ee.]/g, ''); 242 var n = !isFinite(+number) ? 0 : +number, 243 prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), 244 sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, 245 dec = (typeof dec_point === 'undefined') ? '.' : dec_point, 246 s, 247 toFixedFix = function (n, prec) { 248 var k = Math.pow(10, prec); 249 return '' + Math.round(n * k) / k; 250 }; 251 // Fix for IE parseFloat(0.55).toFixed(0) = 0; 252 s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); 253 if (s[0].length > 3) { 254 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); 255 } 256 if ((s[1] || '').length < prec) { 257 s[1] = s[1] || ''; 258 s[1] += new Array(prec - s[1].length + 1).join('0'); 259 } 260 return s.join(dec); 261 }; 262
263 Tools.setCookie = function (_cookie_name, _value, _expire_days) { 264 var expire_date = new Date(); 265 expire_date.setDate(expire_date.getDate() + _expire_days); 266 var cookie_value = encodeURIComponent(_value) + ((_expire_days==null) ? '' : '; expires=' + expire_date.toUTCString()); 267 document.cookie = _cookie_name + "=" + cookie_value; 268 }; 269 270 271 Tools.stripHtml = function(string) { 272 return string.replace(/ /ig, ' ').replace(/<br>/ig, '\n').replace(/(<([^>]+)>)/ig, ''); 273 }; 274 275 Tools.stripTags = function(input, allowed) { 276 if (typeof(input) === 'string') { 277 allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>) 278 var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, 279 commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi; 280 return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { 281 return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; 282 }); 283 } 284 return undefined; 285 }; 286 287 Tools.translate = function (param1, param2, param3, param4) { 288 if (Tools.language === undefined ) { 289 return 'Tools.language undefined*'; 290 } 291 var text; 292 293 // Use only one parameter and use replace 294 if (param1 !== undefined 295 && Tools.translations !== undefined 296 && Tools.translations[Tools.language] !== undefined 297 && Tools.translations[Tools.language][param1] !== undefined 298 && (typeof param2 === 'object' || param2 === undefined) 299 ) { 300 text = Tools.translations[Tools.language][param1]; 301 if (typeof param2 === 'object') { 302 $.each(param2, function (key, value) { 303 text = text.replace(key, value); 304 }); 305 } 306 return text; 307 308 // Use two paramters and use replace 309 } else if (param1 !== undefined 310 && param2 !== undefined 311 && Tools.translations !== undefined 312 && Tools.translations[Tools.language] !== undefined 313 && Tools.translations[Tools.language][param1] !== undefined 314 && Tools.translations[Tools.language][param1][param2] !== undefined 315 && (typeof param3 === 'object' || param3 === undefined) 316 ) { 317 text = Tools.translations[Tools.language][param1][param2]; 318 if (typeof param3 === 'object') { 319 $.each(param3, function (key, value) { 320 text = text.replace(key, value); 321 }); 322 } 323 return text; 324 325 // Use three paramters and use replace 326 } else if (param1 !== undefined 327 && param2 !== undefined 328 && param3 !== undefined 329 && Tools.translations !== undefined 330 && Tools.translations[Tools.language] !== undefined 331 && Tools.translations[Tools.language][param1] !== undefined 332 && Tools.translations[Tools.language][param1][param2] !== undefined 333 && Tools.translations[Tools.language][param1][param2][param3] !== undefined 334 && (typeof param4 === 'object' || param4 === undefined) 335 ) { 336 text = Tools.translations[Tools.language][param1][param2][param3]; 337 if (typeof param4 === 'object') { 338 $.each(param4, function (key, value) { 339 text = text.replace(key, value); 340 }); 341 } 342 return text; 343 344 // Translation not found 345 } else { 346 if (Tools.translations === undefined) { 347 return 'Language undefined*'; 348 } else if (param1 === undefined) { 349 return 'param1 undefined*'; 350 } else { 351 return param1 + (param2 !== undefined && typeof param2 !== 'object' ? ' :: ' + param2 : '') + (param3 !== undefined && typeof param3 !== 'object' ? ' :: ' + param3 : '') + '*'; 352 } 353 } 354 }; 355}); 356 357function __(param1, param2, param3, param4) { 358 return Tools.translate(param1, param2, param3, param4); 359} 360 361 362 363/* 364ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 365â ease/languages/site.js â 366ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 367*/ 368Tools.translations = $.extend(true, {}, Tools.translations, { 369 'en': { 370 'error': 'Error', 371 'lightbox': { 372 'image': 'Image', 373 'of': 'of' 374 } 375 }, 376 'da': { 377 'error': 'Fejl', 378 'lightbox': { 379 'image': 'Billede', 380 'of': 'af' 381 } 382 }, 383 'fo': { 384 'error': 'Feilur', 385 'lightbox': { 386 'image': 'Mynd', 387 'of': 'av' 388 } 389 }, 390 'de': { 391 'error': 'Fehler', 392 'lightbox': { 393 'image': 'Bild', 394 'of': 'von' 395 } 396 } 397}); 398 399 400 401/* 402ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 403â ease/js/ease.main.js â 404ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 405*/ 406/** 407 * Copyright 2013 QODIO 408 * Any unauthorized use of this code is prohibited and will be prosecuted 409 */ 410$(function () { 411 $(document).ajaxError(function (event, jqxhr, settings, exception) { 412 console.log('ajaxError: ', exception.message, settings.url); 413 }); 414 415 $(document).on('drop dragover', function (e) { 416 e.preventDefault(); 417 }); 418 419 $(document).keyup(function (e) { 420 if (e.keyCode === 27) { 421 Modal.close(); 422 } 423 }); 424}); 425 426/** 427 * @constructor 428 */ 429var Ease = { 430 isLoggedIn: undefined, 431 language: undefined, 432 templatefolder: undefined, 433 richtextImageClassList: [ 434 {title: 'No class', value: ''}, 435 {title: 'Full width', value: 'richtext--image-wrapper--full-width'}, 436 {title: 'Left (50% wide)', value: 'richtext--image-wrapper--left-50'}, 437 {title: 'Left (25% wide)', value: 'richtext--image-wrapper--left-25'}, 438 {title: 'Left (20% wide)', value: 'richtext--image-wrapper--left-20'}, 439 {title: 'Left (16% wide)', value: 'richtext--image-wrapper--left-16'}, 440 {title: 'Left (12% wide)', value: 'richtext--image-wrapper--left-12'}, 441 {title: 'Center (50% wide)', value: 'richtext--image-wrapper--center-50'}, 442 {title: 'Center (25% wide)', value: 'richtext--image-wrapper--center-25'}, 443 {title: 'Center (20% wide)', value: 'richtext--image-wrapper--center-20'}, 444 {title: 'Center (16% wide)', value: 'richtext--image-wrapper--center-16'}, 445 {title: 'Center (12% wide)', value: 'richtext--image-wrapper--center-12'}, 446 {title: 'Right (50% wide)', value: 'richtext--image-wrapper--right-50'}, 447 {title: 'Right (25% wide)', value: 'richtext--image-wrapper--right-25'}, 448 {title: 'Right (20% wide)', value: 'richtext--image-wrapper--right-20'},
449 {title: 'Right (16% wide)', value: 'richtext--image-wrapper--right-16'}, 450 {title: 'Right (12% wide)', value: 'richtext--image-wrapper--right-12'} 451 ], 452 initialize: function () { 453 if (Ease.isLoggedIn) { 454 Ease.overlay.initialize(); 455 } 456 $('#ease_login').on('click', function () { 457 Ease.administrators.login.show(); 458 }); 459 $(window).on('keydown', function (_e) { 460 var keyCode = _e.keyCode || _e.which; 461 if (_e.altKey && keyCode === 76) { 462 Ease.administrators.login.show(); 463 } 464 }); 465 $('#ease_headerButton_logout').on('click', function () { 466 Ease.administrators.login.logout(); 467 }); 468 }, 469 initializePlugins: function() { 470 // lazyload iframes 471 $('iframe[data-src]').each(function() { 472 var $this = $(this); 473 $this.attr('src', $this.attr('data-src')).removeAttr('data-src'); 474 }); 475 476 // refresh LazyLoadator 477 LazyLoadator.refresh(); 478 479 // initialize Addthis 480 if (typeof addthis !== 'undefined') { 481 if (typeof addthis === 'object' && typeof addthis.layers.refresh !== 'undefined') { 482 addthis.layers.refresh(); 483 } else { 484 setTimeout(function () { 485 if (typeof addthis === 'object' && typeof addthis.layers.refresh !== 'undefined') { 486 addthis.layers.refresh(); 487 } 488 }, 1000) 489 } 490 } 491 492 // initialize Owl-carousels 493 $('.owl-carousel').each(function () { 494 var $this = $(this); 495 var options = {}; 496 $.each($this.data(), function (_key, _value) { 497 if (_key.substring(0, 3) === 'owl' && _key.substring(3, 4) !== '.') { 498 if (typeof _value === 'string' && (_value.trim().substring(0, 1) === '{' || _value.trim().substring(0, 1) === '[')) { 499 _value = JSON.parse(_value); 500 } 501 options[_key.substring(3, 4).toLowerCase() + _key.substring(4)] = _value; 502 } 503 }); 504 if (!$this.hasClass('owl-loaded')) { 505 $this.owlCarousel(options); 506 } 507 }); 508 509 510 // initialize Slick-Slideshows 511 $('.slick-slideshow').each(function () { 512 var $this = $(this); 513 var options = { 514 useTransform: true 515 }; 516 $.each($this.data(), function (_key, _value) { 517 if (_key.substring(0, 5) === 'slick') { 518 options[_key.substring(5, 6).toLowerCase() + _key.substring(6)] = _value; 519 } 520 }); 521 if (!$this.hasClass('slick-initialized')) { 522 $this.slick(options); 523 } 524 525 526 if (typeof Ease.overlay !== 'undefined') { 527 $this.on('init', function (event, slick) { 528 if (typeof slick.$slides !== 'undefined' && slick.$slides) { 529 Ease.overlay.deinitialize(slick.$slides); 530 Ease.overlay.initialize(slick.$slides.filter('.slick-active')); 531 } 532 }); 533 $this.on('beforeChange', function (event, slick) { 534 if (typeof Ease.overlay !== 'undefined') { 535 Ease.overlay.deinitialize(slick.$slides); 536 } 537 }); 538 $this.on('afterChange', function (event, slick) { 539 if (typeof Ease.overlay !== 'undefined') { 540 Ease.overlay.initialize(slick.$slides.filter('.slick-active')); 541 } 542 }); 543 var $slides = $this.find('.slick-slide'); 544 Ease.overlay.deinitialize($slides); 545 Ease.overlay.initialize($slides.filter('.slick-active')); 546 } 547 548 }); 549 550 }, 551 /** 552 * Initialize a lazy loader 553 * @param page Default value: 'newsgroup' 554 * @param buttonSelector Default value: '#newsgroup_show_more' 555 */ 556 lazyLoader: function (page, buttonSelector) { 557 page = typeof page !== 'undefined' ? page : 'newsgroup_lazy'; 558 buttonSelector = typeof buttonSelector !== 'undefined' ? buttonSelector : '#newsgroup_show_more'; 559 $(buttonSelector).on('click', function () { 560 var $newsgroup_show_more = $(buttonSelector); 561 $newsgroup_show_more.addClass('busy'); 562 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 563 var $ease_newsgroup = $('#ease_newsgroup_' + newsgroupIds); 564 $ease_newsgroup.attr('data-ease-buttonselector', buttonSelector); 565 var $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 566 var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 567 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 568 var template = $ease_newsgroup.attr('data-ease-template'); 569 var items = $ease_newsarticles.length; 570 $.get('/page_default.php', { 571 p: page, 572 t: template, 573 NewsgroupIds: newsgroupIds, 574 Offset: offset, 575 Limit: items, 576 Interval: interval, 577 Append: true 578 }, function (html) { 579 var $html = $(html).find('.lazyRoot'); 580 $html = $html.length === 0 ? $(html) : $html; 581 var $ease_newsgroup = $('#ease_newsgroup_' + newsgroupIds); 582 var buttonSelector = $ease_newsgroup.attr('data-ease-buttonselector'); 583 var previousCount = $ease_newsgroup.find('.lazyRoot').length; 584 $ease_newsgroup.find('.lazyRoot').last().after($html); 585 Ease.overlay && Ease.overlay.initialize($ease_newsgroup); 586 Ease.initializePlugins(); 587 $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 588 $ease_newsgroup.attr('data-ease-limit', $ease_newsarticles.length); 589 history.replaceState(null, '', '?' + Tools.getQuery('_Limit') + '&_Limit=' + $ease_newsarticles.length); 590 $newsgroup_show_more.removeClass('busy'); 591 Revealator.refresh(); 592 var currentCount = $ease_newsgroup.find('.lazyRoot').length; 593 if ((previousCount + interval) > currentCount) {
594 $(buttonSelector).slideUp(); 595 } 596 }); 597 }); 598 599 window.onpopstate = function() { 600 var $newsgroup_show_more = $(buttonSelector); 601 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 602 var $ease_newsgroup = $('#ease_newsgroup_' + newsgroupIds); 603 //var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 604 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 605 $ease_newsgroup.attr('data-ease-limit', Tools.getQueryVariable('_Limit') ? Tools.getQueryVariable('_Limit') : interval); 606 Ease.newsgroups && Ease.newsgroups.onchange(); 607 }; 608 } 609}; 610 611 612 613/* 614ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 615â ease/js/ease.modal.js â 616ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 617*/ 618/** 619 * Modal (ease) v1.0.6 - copyright 2013 QODIO 620 * All rights reserved 621 * No use of this code is allowed 622 * Any unauthorized use of this code is prohibited and will be prosecuted 623 */ 624 625var Modal; 626$(function () { 627 $('a').each(function () { 628 if (!$(this).attr('tabindex')) { 629 $(this).attr('tabindex', '-1'); 630 } 631 }); 632 633 Modal = { 634 container: null, 635 dimmerStack: [], 636 stack: [], 637 /** 638 * options { 639 * * url (default null) 640 * * top (default 40) 641 * * width (default null) 642 * * height (default null) 643 * * send (default {}) 644 * * method (default 'get') 645 * * dimmerClass (default 'easeModal_dimmer') 646 * * modalClass (default 'easeModal') 647 * * modalId (default '') 648 * * data (default []) 649 * * zIndex (default Modal.stack + 1) 650 * * closeWhenClickOutside (default true) 651 * * callbackOnLoad (default function (modal) {}) 652 * * callbackOnComplete (default function (modal) {}) 653 * } 654 */ 655 open: function(options) { 656 options = options || {}; 657 options.zIndex = options.zIndex || (Modal.stack.length+1); 658 options.url = options.url || null; 659 options.top = options.top || (40 + ((options.zIndex - 1) * 20)); 660 options.width = options.width || null; 661 options.height = options.height || null; 662 options.send = options.send || {}; 663 options.method = options.method || 'get'; 664 options.dimmerClass = options.dimmerClass || 'easeModal_dimmer'; 665 options.modalClass = options.modalClass || 'easeModal'; 666 options.modalId = options.modalId || ''; 667 options.data = options.data || []; 668 options.closeWhenClickOutside = options.closeWhenClickOutside || true; 669 options.callbackOnLoad = options.callbackOnLoad || function (modal) {}; 670 options.callbackOnComplete = options.callbackOnComplete || function (modal) {}; 671 672 if (Modal.container == null) { 673 $('html').addClass('noscroll'); 674 $(document.body).addClass('noscroll'); 675 Modal.container = document.createElement('div'); 676 Modal.container.id = 'easeModal_container'; 677 $(document.body).prepend(Modal.container); 678 } 679 680 var dimmer = document.createElement('div'); 681 $(dimmer).addClass(options.dimmerClass); 682 $(dimmer).hide(); 683 $(dimmer).css({ 684 zIndex: 1000 + options.zIndex 685 }); 686 Modal.dimmerStack.push(dimmer); 687 $(Modal.container).append(dimmer); 688 $(dimmer).fadeIn(250); 689 690 options.send.zIndex = options.zIndex; 691 if (options.method === 'get') { 692 $.get(options.url, options.send, function (html) { 693 openDone(html, options); 694 }); 695 } else if (options.method === 'post') { 696 $.post(options.url, options.send, function (html) { 697 openDone(html, options); 698 }); 699 } 700 function openDone(html, options) { 701 var modal = document.createElement('div'); 702 $(modal).addClass(options.modalClass); 703 $(modal).attr('id', options.modalId); 704 $.each(options.data, function (key, value) { 705 $(modal).attr('data-ease-' + key, value); 706 }); 707 if (options.top != null) { 708 $(modal).css('top', options.top + 'px'); 709 } 710 $(modal).width(options.width); 711 $(modal).height(options.height); 712 $(modal).hide(); 713 $(modal).html(html); 714 $(modal).find('.easeModal_close').on('click', function () { 715 Modal.close(); 716 }); 717 Modal.stack.push(modal); 718 $('input, button, select, textarea').each(function () { 719 if (!$(this).attr('tabindex')) { 720 $(this).attr('tabindex', '-1'); 721 } 722 }); 723 $(dimmer).append(modal); 724 options.callbackOnLoad(modal); 725 726 $(modal).fadeIn(250, function () { 727 options.callbackOnComplete(this); 728 }); 729 } 730 }, 731 /** 732 * options { 733 * * zIndex (default Modal.stack + 1) 734 * * callbackOnComplete (default function () {}) 735 * } 736 */ 737 close: function(options) { 738 options = options || {}; 739 options.zIndex = options.zIndex || Modal.stack.length; 740 options.callbackOnComplete = options.callbackOnComplete || function () {}; 741 742 $(Modal.stack[options.zIndex-1]).fadeOut(250, function () { 743 $(Modal.stack[options.zIndex-1]).find('.easeModal_textarea').each(function () { 744 if ($(this).tinymce() != undefined) { 745 $(this).tinymce().remove(); 746 } 747 }); 748 $(Modal.stack[options.zIndex-1]).remove(); 749 Modal.stack.splice(options.zIndex-1, 1); 750 $(Modal.dimmerStack[options.zIndex-1]).fadeOut(250, function () { 751 $(Modal.dimmerStack[options.zIndex-1]).remove(); 752 Modal.dimmerStack.splice(options.zIndex-1, 1); 753 if (Modal.stack.length === 0) { 754 $(Modal.container).remove(); 755 $('html').removeClass('noscroll'); 756 $(document.body).removeClass('noscroll'); 757 Modal.container = null; 758 $('input, button, select, textarea').each(function () { 759 if ($(this).attr('tabindex') && $(this).attr('tabindex') === '-1') { 760 $(this).removeAttr('tabindex'); 761 } 762 }); 763 } 764 options.callbackOnComplete(); 765 if (typeof Overlay !== "undefined" && Overlay.repositionAll != undefined) { 766 Overlay.repositionAll(); 767 } 768 }); 769 }); 770 } 771 } 772}); 773 774 775/* 776ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 777â ease/js/ease.offcanvas.js â 778ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 779*/ 780// Offcanvas menu 781var Offcanvas = { 782 timeout: 0, 783 visible: false, 784 show: function () { 785 Offcanvas.visible = true; 786 var $body = $('body'); 787 $body.removeClass('offcanvas-hidden').addClass('offcanvas-entering'); 788 clearTimeout(Offcanvas.timeout); 789 Offcanvas.timeout = setTimeout(function () { 790 $body.removeClass('offcanvas-entering').addClass('offcanvas-visible'); 791 $('#offcanvas--pane').get(0).scrollTop = 0; 792 }, 400); 793 }, 794 hide: function () { 795 Offcanvas.visible = false; 796 var $body = $('body'); 797 $body.removeClass('offcanvas-visible').addClass('offcanvas-leaving'); 798 clearTimeout(Offcanvas.timeout); 799 Offcanvas.timeout = setTimeout(function () { 800 $body.removeClass('offcanvas-leaving').addClass('offcanvas-hidden'); 801 }, 400); 802 }, 803 toggle: function () { 804 if (!Offcanvas.visible) { 805 Offcanvas.show(); 806 } else { 807 Offcanvas.hide(); 808 } 809 }, 810 initialize: function () { 811 var $body = $('body'); 812 $body.addClass('offcanvas-hidden'); 813 var $offcanvas__pane = $('#offcanvas--pane'); 814 var $offcanvas__menu = $('.offcanvas--menu'); 815 var $offcanvas__menuitems = $('.offcanvas--menuitem'); 816 var $offcanvas__dimmer = $('#offcanvas--dimmer'); 817 $('.offcanvas--toggle').on('click', function (e) { 818 e.stopPropagation(); 819 Offcanvas.toggle(); 820 }); 821 $offcanvas__menuitems.on('click', function (e) { 822 e.stopPropagation(); 823 }); 824 $offcanvas__menu.on('click', function (e) { 825 e.stopPropagation(); 826 Offcanvas.hide(); 827 }); 828 $offcanvas__pane.on('click', function (e) { 829 e.stopPropagation(); 830 Offcanvas.hide(); 831 }); 832 $offcanvas__dimmer.on('click', function (e) { 833 e.stopPropagation(); 834 Offcanvas.hide(); 835 }); 836 837 /* 838 var $body = $('body'); 839 $body.swipe({ 840 fingers: 'all', 841 swipeRight: function () { 842 Offcanvas.show(); 843 }, 844 swipeLeft: function () { 845 Offcanvas.hide(); 846 }, 847 allowPageScroll: 'auto', 848 maxTimeThreshold: 1000, 849 threshold: 100 850 }); 851 */ 852 853 } 854}; 855 856 857 858/* 859âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 860â ease/modules/calendars/ease.calendars.site.js â 861âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 862*/ 863/** 864 * Copyright 2013 QODIO 865 * Any unauthorized use of this code is prohibited and will be prosecuted 866 */ 867 868/** 869 * Calendars (site) 870 */ 871if (Ease.calendars === undefined) { 872 Ease.calendars = {} 873} 874 875Ease.calendars.path = '/ease/modules/calendars/'; 876 877Ease.calendars.onchange = function(options) { 878 var $ease_calendars = $('[id^=ease_calendar_]').not('[id^=ease_calendars_calendaritem_]'); 879 $ease_calendars.each(function () { 880 var $ease_calendar = $(this); 881 var template = $ease_calendar.attr('data-ease-template'); 882 var padding = $ease_calendar.attr('data-ease-padding'); 883 var ignorepadding = $ease_calendar.attr('data-ease-ignorepadding'); 884 var buttonposition = $ease_calendar.attr('data-ease-buttonposition'); 885 var inner = $ease_calendar.attr('data-ease-inner'); 886 // custom parameters 887 var calendarid = $ease_calendar.attr('data-ease-calendarid'); 888 var excludecalendaritemid = $ease_calendar.attr('data-ease-excludecalendaritemid'); 889 var limit = $ease_calendar.attr('data-ease-limit'); 890 var offset = $ease_calendar.attr('data-ease-offset'); 891 var disableGroupEdit = $ease_calendar.attr('data-ease-disablegroupedit'); 892 var disableItemEdit = $ease_calendar.attr('data-ease-disableitemedit'); 893 $.get(Ease.calendars.path + 'ease_calendars_element.php', { 894 Template: template, 895 Padding: padding, 896 IgnorePadding: ignorepadding, 897 ButtonPosition: buttonposition, 898 Inner: inner, 899 // custom parameters 900 CalendarId: calendarid, 901 ExcludeCalendarItemId: excludecalendaritemid, 902 Limit: limit, 903 Offset: offset, 904 DisableGroupEdit: disableGroupEdit, 905 DisableItemEdit: disableItemEdit 906 }, function (html) { 907 var $new_element = $(html); 908 $ease_calendar.replaceWith($new_element); 909 Ease.overlay && Ease.overlay.initialize($new_element); 910 Ease.initializePlugins(); 911 }); 912 }); 913}; 914 915/** 916 * Initialize a calendar lazy loader
917 * @param limit 918 * @param buttonSelector Default value: '#calendar_show_more' 919 */ 920Ease.calendars.lazyLoader = function (limit, buttonSelector) { 921 limit = (typeof limit !== 'undefined' && limit) ? limit : Tools.getQueryVariable('_Limit'); 922 buttonSelector = typeof buttonSelector !== 'undefined' ? buttonSelector : '#calendar_show_more'; 923 $(buttonSelector).on('click', function () { 924 var $calendar_show_more = $(buttonSelector); 925 $calendar_show_more.addClass('busy'); 926 var calendarId = $calendar_show_more.attr('data-ease-calendarid'); 927 var $ease_calendar = $('#ease_calendar_' + calendarId); 928 $ease_calendar.attr('data-ease-buttonselector', buttonSelector); 929 var $ease_calendaritems = $ease_calendar.find('.ease_calendar').not('.add'); 930 var offset = parseInt($ease_calendar.attr('data-ease-offset'), 10); 931 var interval = parseInt($ease_calendar.attr('data-ease-interval'), 10); 932 var template = $ease_calendar.attr('data-ease-template'); 933 var items = $ease_calendaritems.length; 934 $.get('/page_default.php', { 935 p: 'calendar_lazy', 936 t: template, 937 CalendarId: calendarId, 938 Offset: offset, 939 Limit: items, 940 Interval: interval, 941 Append: true 942 }, function (html) { 943 var $html = $(html).find('.lazyRoot'); 944 $html = $html.length === 0 ? $(html) : $html; 945 var $ease_calendar = $('#ease_calendar_' + calendarId); 946 var buttonSelector = $ease_calendar.attr('data-ease-buttonselector'); 947 var previousCount = $ease_calendar.find('.ease_calendar').length; 948 $ease_calendar.find('.lazyRoot').last().after($html); 949 Ease.overlay && Ease.overlay.initialize($ease_calendar); 950 Ease.initializePlugins(); 951 $ease_calendaritems = $ease_calendar.find('.ease_calendar').not('.add'); 952 $ease_calendar.attr('data-ease-limit', $ease_calendaritems.length); 953 history.replaceState(null, '', '?' + Tools.getQuery('_Limit') + '&_Limit=' + $ease_calendaritems.length); 954 $calendar_show_more.removeClass('busy'); 955 Revealator.refresh(); 956 var currentCount = $ease_calendar.find('.ease_calendar').length; 957 if ((previousCount + interval) > currentCount) { 958 $(buttonSelector).slideUp(); 959 } 960 }); 961 }); 962 963 window.onpopstate = function() { 964 var $calendar_show_more = $(buttonSelector); 965 var calendarId = $calendar_show_more.attr('data-ease-calendarid'); 966 var $ease_calendar = $('#ease_calendar_' + calendarId); 967 var offset = parseInt($ease_calendar.attr('data-ease-offset'), 10); 968 var interval = parseInt($ease_calendar.attr('data-ease-interval'), 10); 969 $ease_calendar.attr('data-ease-limit', Tools.getQueryVariable('_Limit') ? Tools.getQueryVariable('_Limit') : interval); 970 Ease.calendars && Ease.calendars.onchange(); 971 }; 972 973 var $calendar_show_more = $(buttonSelector); 974 var calendarId = $calendar_show_more.attr('data-ease-calendarid'); 975 var $ease_calendaritems = $('#ease_calendar_' + calendarId).find('.ease_calendar').not('.add'); 976 if ($ease_calendaritems.length < limit) { 977 $calendar_show_more.hide(); 978 } 979 980}; 981 982 983 984/* 985âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 986â ease/modules/schedules/ease.schedules.site.js â 987âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 988*/ 989/** 990 * Copyright 2013 QODIO 991 * Any unauthorized use of this code is prohibited and will be prosecuted 992 */ 993 994// When updating schedule or schedule item, only that specific content element will be reloaded on the page, 995// which differs from other modules, as they reload the entire content (every element) area of the page. 996 997/** 998 * Schedules (site) 999 */ 1000if (Ease.schedules === undefined) { 1001 Ease.schedules = { 1002 contentitems: {} 1003 } 1004} 1005 1006Ease.schedules.path = '/ease/modules/schedules/'; 1007
1008Ease.schedules.contentitems.onchange = function (options) { 1009 var $ease_contentitem = $('#ease_contentitem_' + options.ContentitemId); 1010 options.Offset = options.Offset !== undefined ? options.Offset : parseInt($ease_contentitem.attr('data-ease-offset')); 1011 options.Padding = options.Padding !== undefined ? options.Padding : parseInt($ease_contentitem.attr('data-ease-padding')); 1012 options.IgnorePadding = options.IgnorePadding !== undefined ? options.IgnorePadding : $ease_contentitem.attr('data-ease-ignorepadding'); 1013 options.Actions = options.Actions !== undefined ? options.Actions : $ease_contentitem.attr('data-ease-actions'); 1014 $.get(Ease.schedules.path + 'ease_schedules_contentitems_element.php', { 1015 ContentitemId: options.ContentitemId, 1016 Offset: options.Offset, 1017 Padding: options.Padding, 1018 IgnorePadding: options.IgnorePadding, 1019 Actions: options.Actions 1020 }, function (html) { 1021 $ease_contentitem.replaceWith(html); 1022 $ease_contentitem = $('#ease_contentitem_' + options.ContentitemId); 1023 if (Ease.isLoggedIn) { 1024 Ease.overlay.initialize($ease_contentitem[0]); 1025 } 1026 Ease.initializePlugins(); 1027 }); 1028}; 1029 1030Ease.schedules.contentitems.previousWeek = function (ContentitemId) { 1031 var $contentitem = $('#ease_contentitem_' + ContentitemId); 1032 var iOffset = parseInt($contentitem.attr('data-ease-offset')); 1033 Ease.schedules.contentitems.onchange({ ContentitemId: ContentitemId, Offset: iOffset -1 }); 1034}; 1035 1036Ease.schedules.contentitems.nextWeek = function (ContentitemId) { 1037 var $contentitem = $('#ease_contentitem_' + ContentitemId); 1038 var iOffset = parseInt($contentitem.attr('data-ease-offset')); 1039 Ease.schedules.contentitems.onchange({ ContentitemId: ContentitemId, Offset: iOffset +1 }); 1040}; 1041 1042 1043/* 1044âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1045â ease/modules/administrators/ease.administrators.site.js â 1046âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1047*/ 1048/** 1049 * Copyright 2013 QODIO 1050 * Any unauthorized use of this code is prohibited and will be prosecuted 1051 */ 1052 1053 1054if (Ease.administrators === undefined) { 1055 Ease.administrators = {} 1056} 1057 1058Ease.administrators.path = '/ease/modules/administrators/'; 1059 1060/** 1061 * Administrators login 1062 * @type {{show: Function, submit: Function, logout: Function}} 1063 */ 1064Ease.administrators.login = { 1065 show: function () { 1066 Modal.open({ 1067 url: Ease.administrators.path + 'ease_administrators_login.php', 1068 width: 450, 1069 modalId: 'ease_login', 1070 callbackOnLoad: function () { 1071 $('#easeModal_formLogin').find('#easeModal_checkboxRememberMe').checkator(); 1072 }, 1073 callbackOnComplete: function () { 1074 $('#easeModal_textboxUsername').focus(); 1075 $('#easeModal_buttonLogin').on('click', function (e) { 1076 e.preventDefault(); 1077 if (!$(this).hasClass('disabled') && !$(this).hasClass('busy')) { 1078 Ease.administrators.login.submit(); 1079 } 1080 }); 1081 } 1082 }); 1083 }, 1084 submit: function () { 1085 var $easeModal_formLogin = $('#easeModal_formLogin'); 1086 $easeModal_formLogin.find('#easeModal_error').slideUp(); 1087 $easeModal_formLogin.find('#easeModal_buttonLogin').addClass('busy'); 1088 $.post(Ease.administrators.path + 'ease_administrators_login_do.php', $easeModal_formLogin.serialize(),function (result) { 1089 if (result.status === 'success') { 1090 //document.cookie = document.cookie + '' 1091 document.cookie = 'EaseAdministratorLoggedIn=1;path=/'; 1092 Modal.close({ 1093 callbackOnComplete: function () { 1094 window.location.reload(); 1095 } 1096 }); 1097 } else { 1098 var $easeModal_formLogin = $('#easeModal_formLogin'); 1099 $easeModal_formLogin.find('#easeModal_error').html(result.message).slideDown(); 1100 $easeModal_formLogin.find('#easeModal_buttonLogin').removeClass('busy'); 1101 switch (result.status) { 1102 case 'missing username': 1103 $easeModal_formLogin.find('#easeModal_textboxUsername').select(); 1104 break; 1105 case 'missing password': 1106 $easeModal_formLogin.find('#easeModal_textboxPassword').select(); 1107 break; 1108 default: 1109 $easeModal_formLogin.find('#easeModal_textboxUsername').select(); 1110 break; 1111 } 1112 } 1113 }, 'json').fail(function () { 1114 var $easeModal_formLogin = $('#easeModal_formLogin'); 1115 $easeModal_formLogin.find('#easeModal_error').html('Error').slideDown(); 1116 $easeModal_formLogin.find('#easeModal_buttonLogin').removeClass('busy'); 1117 }); 1118 }, 1119 logout: function () { 1120 document.cookie = 'EaseAdministratorLoggedIn=0;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 1121 setTimeout(function () { 1122 window.location = Ease.administrators.path + 'ease_administrators_logout_do.php?_l=' + Ease.siteLanguage + '&ReturnUrl=' + Ease.base64Url; 1123 }, 500); 1124 } 1125}; 1126 1127 1128 1129/* 1130âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1131â ease/modules/newsgroups/ease.newsgroups.site.js â 1132âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1133*/ 1134/** 1135 * Copyright 2013 QODIO 1136 * Any unauthorized use of this code is prohibited and will be prosecuted 1137 */ 1138 1139/** 1140 * Newsgroups (site) 1141 */ 1142if (Ease.newsgroups === undefined) { 1143 Ease.newsgroups = {} 1144} 1145 1146Ease.newsgroups.path = '/ease/modules/newsgroups/'; 1147 1148Ease.newsgroups.onchange = function() { 1149 var $ease_newsgroups = $('[id^=ease_newsgroup_]').not('[id^=ease_newsgroup_newsarticle_]'); 1150 $ease_newsgroups.each(function () { 1151 var $ease_newsgroup = $(this); 1152 var template = $ease_newsgroup.attr('data-ease-template'); 1153 var padding = $ease_newsgroup.attr('data-ease-padding'); 1154 var ignorepadding = $ease_newsgroup.attr('data-ease-ignorepadding'); 1155 var buttonposition = $ease_newsgroup.attr('data-ease-buttonposition'); 1156 var inner = $ease_newsgroup.attr('data-ease-inner'); 1157 // custom parameters 1158 var newsgroupids = $ease_newsgroup.attr('data-ease-newsgroupids'); 1159 var language = $ease_newsgroup.attr('data-ease-language'); 1160 var excludenewsarticleid = $ease_newsgroup.attr('data-ease-excludenewsarticleid'); 1161 var offset = $ease_newsgroup.attr('data-ease-offset'); 1162 var limit = $ease_newsgroup.attr('data-ease-limit'); 1163 var interval = $ease_newsgroup.attr('data-ease-interval'); 1164 var orderby = $ease_newsgroup.attr('data-ease-orderby'); 1165 var props = $ease_newsgroup.attr('data-ease-props'); 1166 var disablegroupedit = $ease_newsgroup.attr('data-ease-disablegroupedit'); 1167 var disableitemedit = $ease_newsgroup.attr('data-ease-disableitemedit'); 1168 $.get(Ease.newsgroups.path + 'ease_newsgroups_element.php', { 1169 Template: template, 1170 Padding: padding, 1171 IgnorePadding: ignorepadding, 1172 ButtonPosition: buttonposition, 1173 Inner: inner, 1174 // custom parameters 1175 NewsgroupIds: newsgroupids, 1176 Language: language,
1177 ExcludeNewsarticleId: excludenewsarticleid, 1178 Offset: offset, 1179 Limit: limit, 1180 Interval: interval, 1181 OrderBy: orderby, 1182 Props: props, 1183 DisableGroupEdit: disablegroupedit, 1184 DisableItemEdit: disableitemedit 1185 }, function (html) { 1186 var $new_element = $(html); 1187 $ease_newsgroup.replaceWith($new_element); 1188 Ease.overlay && Ease.overlay.initialize($new_element); 1189 Ease.initializePlugins(); 1190 }); 1191 }); 1192}; 1193 1194/** 1195 * Initialize a newsgroup lazy loader 1196 * @param limit 1197 * @param buttonSelector Default value: '#newsgroup_show_more' 1198 */ 1199Ease.newsgroups.lazyLoader = function (limit, buttonSelector) { 1200 limit = (typeof limit !== 'undefined' && limit) ? limit : Tools.getQueryVariable('_Limit'); 1201 buttonSelector = typeof buttonSelector !== 'undefined' ? buttonSelector : '#newsgroup_show_more'; 1202 $(buttonSelector).on('click', function () { 1203 var $newsgroup_show_more = $(buttonSelector); 1204 $newsgroup_show_more.addClass('busy'); 1205 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 1206 var $ease_newsgroup = $('.ease_newsgroup_' + newsgroupIds).last(); 1207 $ease_newsgroup.attr('data-ease-buttonselector', buttonSelector); 1208 var language = $ease_newsgroup.attr('data-ease-language'); 1209 var excludenewsarticleid = $ease_newsgroup.attr('data-ease-excludenewsarticleid'); 1210 var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 1211 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 1212 var template = $ease_newsgroup.attr('data-ease-template'); 1213 var search = $ease_newsgroup.attr('data-ease-search'); 1214 var $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 1215 var items = $ease_newsarticles.length; 1216 $.get('/page_default.php', { 1217 p: 'newsgroup_lazy', 1218 t: template, 1219 Search: search, 1220 NewsgroupIds: newsgroupIds, 1221 Language: language, 1222 ExcludeNewsarticleId: excludenewsarticleid, 1223 Offset: offset, 1224 Limit: items, 1225 Interval: interval, 1226 Append: true 1227 }, function (html) { 1228 var $html = $(html).find('.lazyRoot'); 1229 $html = $html.length === 0 ? $(html) : $html; 1230 var $ease_newsgroup = $('.ease_newsgroup_' + newsgroupIds).last(); 1231 var buttonSelector = $ease_newsgroup.attr('data-ease-buttonselector'); 1232 var previousCount = $ease_newsgroup.find('.lazyRoot').length; 1233 $ease_newsgroup.find('.lazyRoot').last().after($html); 1234 Ease.overlay && Ease.overlay.initialize($ease_newsgroup); 1235 Ease.initializePlugins(); 1236 $ease_newsarticles = $ease_newsgroup.find('.lazyRoot').not('.add'); 1237 $ease_newsgroup.attr('data-ease-limit', $ease_newsarticles.length); 1238 history.replaceState(null, null, '?' + Tools.getQuery('_Limit') + '&_Limit=' + $ease_newsarticles.length); 1239 $newsgroup_show_more.removeClass('busy'); 1240 Revealator.refresh(); 1241 var currentCount = $ease_newsgroup.find('.lazyRoot').length; 1242 if ((previousCount + interval) > currentCount) { 1243 $(buttonSelector).slideUp(); 1244 } 1245 }); 1246 }); 1247 1248 window.onpopstate = function() { 1249 var $newsgroup_show_more = $(buttonSelector); 1250 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 1251 var $ease_newsgroup = $('.ease_newsgroup_' + newsgroupIds).last(); 1252 var offset = parseInt($ease_newsgroup.attr('data-ease-offset'), 10); 1253 var interval = parseInt($ease_newsgroup.attr('data-ease-interval'), 10); 1254 $ease_newsgroup.attr('data-ease-limit', Tools.getQueryVariable('_Limit') ? Tools.getQueryVariable('_Limit') : interval); 1255 Ease.newsgroups && Ease.newsgroups.onchange(); 1256 }; 1257 1258 var $newsgroup_show_more = $(buttonSelector); 1259 var newsgroupIds = $newsgroup_show_more.attr('data-ease-newsgroupids'); 1260 var $ease_newsarticles = $('.ease_newsgroup_' + newsgroupIds).last().find('.lazyRoot').not('.add'); 1261 if ($ease_newsarticles.length < limit) { 1262 $newsgroup_show_more.hide(); 1263 } 1264 1265}; 1266 1267 1268 1269/* 1270âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1271â ease/modules/contentgroups/ease.contentgroups.site.js â 1272âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1273*/ 1274/** 1275 * Copyright 2015 QODIO 1276 * Any unauthorized use of this code is prohibited and will be prosecuted 1277 */ 1278 1279/** 1280 * Contentgroups (site) 1281 */ 1282if (Ease.contentgroups === undefined) { 1283 Ease.contentgroups = {} 1284} 1285 1286Ease.contentgroups.path = '/ease/modules/contentgroups/'; 1287 1288Ease.contentgroups.onchange = function() { 1289 var $ease_contentgroups = $('[id^=ease_contentgroup_]').not('[id^=ease_contentgroup_item_]'); 1290 $ease_contentgroups.each(function () { 1291 var $ease_contentgroup = $(this); 1292 var template = $ease_contentgroup.attr('data-ease-template'); 1293 var padding = $ease_contentgroup.attr('data-ease-padding'); 1294 var ignorepadding = $ease_contentgroup.attr('data-ease-ignorepadding'); 1295 var buttonposition = $ease_contentgroup.attr('data-ease-buttonposition'); 1296 var inner = $ease_contentgroup.attr('data-ease-inner'); 1297 // custom parameters 1298 var contentgroupid = $ease_contentgroup.attr('data-ease-contentgroupid'); 1299 $.get(Ease.contentgroups.path + 'ease_contentgroups_element.php', { 1300 Template: template, 1301 Padding: padding, 1302 IgnorePadding: ignorepadding, 1303 ButtonPosition: buttonposition, 1304 Inner: inner, 1305 // custom parameters 1306 ContentgroupId: contentgroupid 1307 }, function (html) { 1308 var $new_element = $(html); 1309 $ease_contentgroup.replaceWith($new_element); 1310 Ease.overlay && Ease.overlay.initialize($new_element); 1311 Ease.initializePlugins(); 1312 }); 1313 }); 1314}; 1315 1316 1317/* 1318âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1319â ease/modules/products/ease.products.site.js â 1320âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1321*/ 1322/** 1323 * Copyright 2015 QODIO 1324 * Any unauthorized use of this code is prohibited and will be prosecuted 1325 */ 1326 1327/** 1328 * Products (site) 1329 */ 1330if (Ease.products === undefined) { 1331 Ease.products = {} 1332} 1333 1334Ease.products.path ='/ease/modules/products/'; 1335 1336Ease.products.onchange = function() { 1337 var $ease_products = $('[id^=ease_products_]').not('[id^=ease_products_product_]').not('[id^=ease_products_filtergroup_]'); 1338 $ease_products.each(function () { 1339 var $ease_product = $(this); 1340 var template = $ease_product.attr('data-ease-template'); 1341 var padding = $ease_product.attr('data-ease-padding'); 1342 var ignorepadding = $ease_product.attr('data-ease-ignorepadding'); 1343 var buttonposition = $ease_product.attr('data-ease-buttonposition'); 1344 var inner = $ease_product.attr('data-ease-inner'); 1345 // custom parameters 1346 var productfilterids = $ease_product.attr('data-ease-productfilterids'); 1347 var membershipids = $ease_product.attr('data-ease-membershipids'); 1348 var requireallproductfilters = $ease_product.attr('data-ease-requireallproductfilters'); 1349 var excludeproductid = $ease_product.attr('data-ease-excludeproductid'); 1350 var search = $ease_product.attr('data-ease-search'); 1351 var offset = $ease_product.attr('data-ease-offset'); 1352 var limit = $ease_product.attr('data-ease-limit'); 1353 var interval = $ease_product.attr('data-ease-interval'); 1354 var orderby = $ease_product.attr('data-ease-orderby'); 1355 $.get(Ease.products.path + 'ease_products_element.php', { 1356 Template: template, 1357 Padding: padding, 1358 IgnorePadding: ignorepadding, 1359 ButtonPosition: buttonposition, 1360 Inner: inner, 1361 // custom parameters 1362 ProductFilterIds: productfilterids, 1363 MembershipIds: membershipids, 1364 RequireAllProductFilters: requireallproductfilters, 1365 ExcludeProductId: excludeproductid, 1366 Search: search, 1367 Offset: offset, 1368 Limit: limit, 1369 Interval: interval, 1370 OrderBy: orderby 1371 }, function (html) { 1372 var $new_element = $(html); 1373 $ease_product.replaceWith($new_element); 1374 Ease.overlay && Ease.overlay.initialize($new_element); 1375 Ease.initializePlugins(); 1376 }); 1377 }); 1378}; 1379 1380/** 1381 * Initialize a products lazy loader
1382 * @param limit 1383 * @param buttonSelector Default value: '#products_show_more' 1384 */ 1385Ease.products.lazyLoader = function (limit, buttonSelector) { 1386 limit = (typeof limit !== 'undefined' && limit) ? limit : Tools.getQueryVariable('_Limit'); 1387 buttonSelector = typeof buttonSelector !== 'undefined' ? buttonSelector : '#products_show_more'; 1388 $(buttonSelector).on('click', function () { 1389 var $products_show_more = $(buttonSelector); 1390 $products_show_more.addClass('busy'); 1391 var productFilterIds = $products_show_more.attr('data-ease-productfilterids'); 1392 var $ease_products = $('.ease_products_' + productFilterIds.replace(/:/g, '\\:').replace(/,/g, '\\,')).last(); 1393 $ease_products.attr('data-ease-buttonselector', buttonSelector); 1394 var $ease_products_items = $ease_products.find('.lazyRoot').not('.add'); 1395 var membershipids = parseInt($ease_products.attr('data-ease-membershipids'), 10); 1396 var requireallproductfilters = parseInt($ease_products.attr('data-ease-requireallproductfilters'), 10); 1397 var excludeproductid = parseInt($ease_products.attr('data-ease-excludeproductid'), 10); 1398 var search = $ease_products.attr('data-ease-search'); 1399 var offset = parseInt($ease_products.attr('data-ease-offset'), 10); 1400 var interval = parseInt($ease_products.attr('data-ease-interval'), 10); 1401 var orderBy = $ease_products.attr('data-ease-orderby'); 1402 var template = $ease_products.attr('data-ease-template'); 1403 var items = $ease_products_items.length; 1404 $.get('/page_default.php', { 1405 p: 'products_lazy', 1406 t: template, 1407 ProductFilterIds: productFilterIds, 1408 MembershipIds: membershipids, 1409 RequireAllProductFilters: requireallproductfilters, 1410 ExcludeProductId: excludeproductid, 1411 Search: search, 1412 Offset: offset, 1413 Limit: items, 1414 Interval: interval, 1415 OrderBy: orderBy, 1416 Append: true 1417 }, function (html) { 1418 var $html = $(html).find('.lazyRoot'); 1419 $html = $html.length === 0 ? $(html) : $html; 1420 var $ease_products = $('.ease_products_' + productFilterIds.replace(/:/g, '\\:').replace(/,/g, '\\,')); 1421 var buttonSelector = $ease_products.attr('data-ease-buttonselector'); 1422 var previousCount = $ease_products.find('.lazyRoot').length; 1423 $ease_products.find('.lazyRoot').last().after($html); 1424 Ease.overlay && Ease.overlay.initialize($ease_products); 1425 Ease.initializePlugins(); 1426 $ease_products_items = $ease_products.find('.lazyRoot').not('.add'); 1427 $ease_products.attr('data-ease-limit', $ease_products_items.length); 1428 history.replaceState(null, '', '?' + Tools.getQuery('_Limit') + '&_Limit=' + $ease_products_items.length); 1429 $products_show_more.removeClass('busy'); 1430 Revealator.refresh(); 1431 var currentCount = $ease_products.find('.lazyRoot').length; 1432 if ((previousCount + interval) > currentCount) { 1433 $(buttonSelector).slideUp(); 1434 } 1435 }); 1436 }); 1437 1438 window.onpopstate = function() { 1439 var $products_show_more = $(buttonSelector); 1440 var productFilterIds = $products_show_more.attr('data-ease-productfilterids'); 1441 var $ease_products = $('.ease_products_' + productFilterIds.replace(/:/g, '\\:').replace(/,/g, '\\,')); 1442 var offset = parseInt($ease_products.attr('data-ease-offset'), 10); 1443 var interval = parseInt($ease_products.attr('data-ease-interval'), 10); 1444 $ease_products.attr('data-ease-limit', Tools.getQueryVariable('_Limit') ? Tools.getQueryVariable('_Limit') : interval); 1445 Ease.products && Ease.products.onchange(); 1446 }; 1447 1448 var $products_show_more = $(buttonSelector); 1449 var productFilterIds = $products_show_more.attr('data-ease-productfilterids'); 1450 var $ease_products_items = $('.ease_products_' + productFilterIds.replace(/:/g, '\\:').replace(/,/g, '\\,')).last().find('.lazyRoot').not('.add'); 1451 console.log('.ease_products_' + productFilterIds.replace(/:/g, '\\:').replace(/,/g, '\\,'), $ease_products_items.length, limit); 1452 if ($ease_products_items.length < limit) { 1453 $products_show_more.hide(); 1454 } 1455 1456}; 1457 1458 1459 1460/* 1461ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1462â Settings â 1463ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1464*/ 1465try { 1466 tinyMCE.baseURL = '/ease/3rdparty/js/TinyMCE'; 1467 tinyMCE.suffix = '.min'; 1468} catch (e) { 1469}
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.