vendor: 6,560 bytes, lines 1-117
1//modal 2! function(o) { 3 "object" == typeof module && "object" == typeof module.exports ? o(require("jquery"), window, document) : o(jQuery, window, document) 4}(function(o, t, i, e) { 5 var s = [], 6 l = function() { 7 return s.length ? s[s.length - 1] : null 8 }, 9 n = function() { 10 var o, t = !1; 11 for (o = s.length - 1; o >= 0; o--) s[o].$blocker && (s[o].$blocker.toggleClass("current", !t).toggleClass("behind", t), t = !0) 12 }; 13 o.modal = function(t, i) { 14 var e, n; 15 if (this.$body = o("body"), this.options = o.extend({}, o.modal.defaults, i), this.options.doFade = !isNaN(parseInt(this.options.fadeDuration, 10)), this.$blocker = null, this.options.closeExisting) 16 for (; o.modal.isActive();) o.modal.close(); 17 if (s.push(this), t.is("a")) 18 if (n = t.attr("href"), this.anchor = t, /^#/.test(n)) { 19 if (this.$elm = o(n), 1 !== this.$elm.length) return null; 20 this.$body.append(this.$elm), this.open() 21 } else this.$elm = o("<div>"), this.$body.append(this.$elm), e = function(o, t) { 22 t.elm.remove() 23 }, this.showSpinner(), t.trigger(o.modal.AJAX_SEND), o.get(n).done(function(i) { 24 if (o.modal.isActive()) { 25 t.trigger(o.modal.AJAX_SUCCESS); 26 var s = l(); 27 s.$elm.empty().append(i).on(o.modal.CLOSE, e), s.hideSpinner(), s.open(), t.trigger(o.modal.AJAX_COMPLETE) 28 } 29 }).fail(function() { 30 t.trigger(o.modal.AJAX_FAIL); 31 var i = l(); 32 i.hideSpinner(), s.pop(), t.trigger(o.modal.AJAX_COMPLETE) 33 }); 34 else this.$elm = t, this.anchor = t, this.$body.append(this.$elm), this.open() 35 }, o.modal.prototype = { 36 constructor: o.modal, 37 open: function() { 38 var t = this; 39 this.block(), this.anchor.blur(), this.options.doFade ? setTimeout(function() { 40 t.show() 41 }, this.options.fadeDuration * this.options.fadeDelay) : this.show(), o(i).off("keydown.modal").on("keydown.modal", function(o) { 42 var t = l(); 43 27 === o.which && t.options.escapeClose && t.close() 44 }), this.options.clickClose && this.$blocker.click(function(t) { 45 t.target === this && o.modal.close() 46 }) 47 }, 48 close: function() { 49 s.pop(), this.unblock(), this.hide(), o.modal.isActive() || o(i).off("keydown.modal") 50 }, 51 block: function() { 52 this.$elm.trigger(o.modal.BEFORE_BLOCK, [this._ctx()]), this.$body.css("overflow", "hidden"), this.$blocker = o('<div class="' + this.options.blockerClass + ' blocker current"></div>').appendTo(this.$body), n(), this.options.doFade && this.$blocker.css("opacity", 0).animate({ 53 opacity: 1 54 }, this.options.fadeDuration), this.$elm.trigger(o.modal.BLOCK, [this._ctx()]) 55 }, 56 unblock: function(t) { 57 !t && this.options.doFade ? this.$blocker.fadeOut(this.options.fadeDuration, this.unblock.bind(this, !0)) : (this.$blocker.children().appendTo(this.$body), this.$blocker.remove(), this.$blocker = null, n(), o.modal.isActive() || this.$body.css("overflow", "")) 58 }, 59 show: function() { 60 this.$elm.trigger(o.modal.BEFORE_OPEN, [this._ctx()]), this.options.showClose && (this.closeButton = o('<a href="#close-modal" rel="modal:close" class="close-modal ' + this.options.closeClass + '">' + this.options.closeText + "</a>"), this.$elm.append(this.closeButton)), this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker), this.options.doFade ? this.$elm.css({ 61 opacity: 0, 62 display: "inline-block" 63 }).animate({ 64 opacity: 1 65 }, this.options.fadeDuration) : this.$elm.css("display", "inline-block"), this.$elm.trigger(o.modal.OPEN, [this._ctx()]) 66 }, 67 hide: function() { 68 this.$elm.trigger(o.modal.BEFORE_CLOSE, [this._ctx()]), this.closeButton && this.closeButton.remove(); 69 var t = this; 70 this.options.doFade ? this.$elm.fadeOut(this.options.fadeDuration, function() { 71 t.$elm.trigger(o.modal.AFTER_CLOSE, [t._ctx()]) 72 }) : this.$elm.hide(0, function() { 73 t.$elm.trigger(o.modal.AFTER_CLOSE, [t._ctx()]) 74 }), this.$elm.trigger(o.modal.CLOSE, [this._ctx()]) 75 }, 76 showSpinner: function() { 77 this.options.showSpinner && (this.spinner = this.spinner || o('<div class="' + this.options.modalClass + '-spinner"></div>').append(this.options.spinnerHtml), this.$body.append(this.spinner), this.spinner.show()) 78 }, 79 hideSpinner: function() { 80 this.spinner && this.spinner.remove() 81 }, 82 _ctx: function() { 83 return { 84 elm: this.$elm, 85 $elm: this.$elm, 86 $blocker: this.$blocker, 87 options: this.options 88 } 89 } 90 }, o.modal.close = function(t) { 91 if (o.modal.isActive()) { 92 t && t.preventDefault(); 93 var i = l(); 94 return i.close(), i.$elm 95 } 96 }, o.modal.isActive = function() { 97 return s.length > 0 98 }, o.modal.getCurrent = l, o.modal.defaults = { 99 closeExisting: !0, 100 escapeClose: !0, 101 clickClose: !0, 102 closeText: "Close", 103 closeClass: "", 104 modalClass: "modal", 105 blockerClass: "jquery-modal", 106 spinnerHtml: '<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>', 107 showSpinner: !0, 108 showClose: !0, 109 fadeDuration: null, 110 fadeDelay: 1 111 }, o.modal.BEFORE_BLOCK = "modal:before-block", o.modal.BLOCK = "modal:block", o.modal.BEFORE_OPEN = "modal:before-open", o.modal.OPEN = "modal:open", o.modal.BEFORE_CLOSE = "modal:before-close", o.modal.CLOSE = "modal:close", o.modal.AFTER_CLOSE = "modal:after-close", o.modal.AJAX_SEND = "modal:ajax:send", o.modal.AJAX_SUCCESS = "modal:ajax:success", o.modal.AJAX_FAIL = "modal:ajax:fail", o.modal.AJAX_COMPLETE = "modal:ajax:complete", o.fn.modal = function(t) { 112 return 1 === this.length && new o.modal(this, t), this 113 }, o(i).on("click.modal", 'a[rel~="modal:close"]', o.modal.close), o(i).on("click.modal", 'a[rel~="modal:open"]', function(t) { 114 t.preventDefault(), o(this).modal() 115 }) 116}); 117
118//cookies 119(function($) { 120 121 /* 122 |-------------------------------------------------------------------------- 123 | Cookie Message 124 |-------------------------------------------------------------------------- 125 | 126 | Displays the cookie message on first visit or 30 days after their 127 | last visit. 128 | 129 | @param event - 'reinit' to reopen the cookie message 130 | 131 */ 132 $.fn.ihavecookies = function(options, event) { 133 134 var $element = $(this); 135 136 // Set defaults 137 settings = $.extend({}, options); 138 139 var myCookie = getCookie('cookieControl'); 140 var myCookiePrefs = getCookie('cookieControlPrefs'); 141 if (!myCookie || !myCookiePrefs || event == 'reinit') { 142 // Remove all instances of the cookie message so it's not duplicated 143 $('#gdpr-cookie-message').remove(); 144 145 // Set the 'necessary' cookie type checkbox which can not be unchecked 146 var cookieTypes = ''; 147 var cookieTypes_tabs = ''; 148 149 // Generate list of cookie type checkboxes 150 if(myCookiePrefs==''){ 151 myCookiePrefs = false; 152 } 153 preferences = JSON.parse(myCookiePrefs); 154 $.each(settings.cookieTypes, function(index, field) { 155 if (field.type !== '' && field.value !== '') { 156 if(index==0){ 157 cookieTypes += '<div id="' + field.value + '" class="gdpr-cookie-tab-content first-gdpr-cookie-tab-content">'; 158 cookieTypes += ' <h4>'+field.title+'</h4>'; 159 cookieTypes += ' <p>'+field.description+'</p>'; 160 cookieTypes += '</div>'; 161 cookieTypes_tabs += '<button class="gdpr-cookie-tab-links" id="gdpr-cookie-tab-' + field.value + '" onclick="tabChanges(\'' + field.value + '\')">' + field.type + '</button>'; 162 } 163 else{ 164 cookieTypes += '<div id="' + field.value + '" class="gdpr-cookie-tab-content">'; 165 cookieTypes += ' <h4>'+field.title+'</h4>'; 166 cookieTypes += ' <div class="switch">'; 167 cookieTypes += ' <input type="checkbox" class="switch-input" id="gdpr-cookietype-' + field.value + '" name="gdpr[]" value="' + field.value + '" data-auto="on">'; 168 cookieTypes += ' <label for="gdpr-cookietype-' + field.value + '" title="' + field.description + '" class="switch-label">' + field.type + '</label>'; 169 cookieTypes += ' </div>'; 170 cookieTypes += ' <div style="clear: both;"></div>'; 171 cookieTypes += ' <p>'+field.description+'</p>'; 172 cookieTypes += '</div>'; 173 cookieTypes_tabs += '<button class="gdpr-cookie-tab-links" id="gdpr-cookie-tab-' + field.value + '" onclick="tabChanges(\'' + field.value + '\')">' + field.type + '</button>'; 174 } 175 } 176 }); 177 178 // Display cookie message on page 179 var cookieMessage = '<div id="gdpr-cookie-message">'; 180 cookieMessage += ' <div>'; 181 cookieMessage += settings.message; 182 cookieMessage += ' </div>'; 183 cookieMessage += ' <div>'; 184 cookieMessage += ' <button id="gdpr-cookie-advanced" type="button">' + settings.advancedBtnLabel + '</button>'; 185 cookieMessage += ' <button id="gdpr-cookie-reject" type="button">' + settings.rejectBtnLabel + '</button>'; 186 cookieMessage += ' <button id="gdpr-cookie-accept" type="button">' + settings.acceptBtnLabel + '</button>'; 187 cookieMessage += ' </div>'; 188 cookieMessage += ' <div style="clear: both;"></div>'; 189 cookieMessage += '</div>'; 190 191 var cookieModal = '<div id="gdpr-cookie-types" class="modal">'; 192 cookieModal += ' <div id="gdpr-cookie-types-header"></div>'; 193 cookieModal += ' <div class="gdpr-cookie-tab">'; 194 cookieModal += cookieTypes_tabs; 195 cookieModal += ' </div>'; 196 cookieModal += cookieTypes; 197 cookieModal += ' <div style="clear: both;"></div>'; 198 cookieModal += ' <div id="gdpr-cookie-types-footer">'; 199 cookieModal += ' <div id="gdpr-cookie-types-footer-info">'+settings.modalFooterInfo+'</div>'; 200 cookieModal += ' <p>'+settings.moreInfoTitle+' <a href="'+settings.link+'" title="'+settings.moreInfoLabel+'">'+settings.moreInfoLabel+'</a></p>'; 201 cookieModal += ' <div id="gdpr-cookie-types-footer-buttons">'; 202 cookieModal += ' <button id="gdpr-cookie-accept-modal" type="button">'+settings.modalAcceptBtnLabel+'</button>'; 203 cookieModal += ' <button id="gdpr-cookie-accept-all-modal" type="button">'+settings.modalAcceptAllBtnLabel+'</button>'; 204 cookieModal += ' </div>'; 205 cookieModal += ' </div>'; 206 cookieModal += ' <div style="clear: both;"></div>'; 207 cookieModal += '</div>'; 208 209 setTimeout(function(){ 210 $($element).append(cookieMessage); 211 $("body").append(cookieModal); 212 $('#gdpr-cookie-message').hide().fadeIn('slow', function(){ 213 // If reinit'ing, open the advanced section of message 214 // and re-check all previously selected options. 215 $('input#gdpr-cookietype-necessary').prop('data-auto', 'on'); 216 $('input#gdpr-cookietype-necessary').prop('checked', true); 217 $('input#gdpr-cookietype-necessary').prop('disabled', true); 218 // if (event == 'reinit') {
219 // $('#gdpr-cookie-advanced').trigger('click'); 220 // $.each(preferences, function(index, field) { 221 // $('input#gdpr-cookietype-' + field).prop('checked', true); 222 // }); 223 // } 224 }); 225 226 $("footer").css("padding-bottom", "160px"); 227 }, settings.delay); 228 229 // When accept button is clicked drop cookie 230 $('body').on('click','#gdpr-cookie-accept', function(){ 231 $('input#gdpr-cookietype-necessary').prop('disabled', false); 232 233 $('input[name="gdpr[]"]').attr('data-auto', 'on').prop('checked', true); 234 235 // Set cookie 236 dropCookie(true, settings.expires); 237 238 // If 'data-auto' is set to ON, tick all checkboxes because 239 // the user hasn't clicked the customise cookies button 240 $('input[name="gdpr[]"][data-auto="on"]').prop('checked', true); 241 242 // Save users cookie preferences (in a cookie!) 243 var prefs = []; 244 $.each($('input[name="gdpr[]"]').serializeArray(), function(i, field){ 245 prefs.push(field.value); 246 }); 247 setCookie('cookieControlPrefs', encodeURIComponent(JSON.stringify(prefs)), 365); 248 249 // Run callback function 250 settings.onAccept.call(this); 251 252 $('#gdpr-cookie-types').hide(); 253 $('.jquery-modal').removeClass('blocker'); 254 255 location.reload(); 256 }); 257 258 // Toggle advanced cookie options 259 $('body').on('click', '#gdpr-cookie-advanced', function(){ 260 // Uncheck all checkboxes except for the disabled 'necessary' 261 // one and set 'data-auto' to OFF for all. The user can now 262 // select the cookies they want to accept. 263 $('input[name="gdpr[]"]:not(:disabled)').attr('data-auto', 'off').prop('checked', false); 264 /*$('#gdpr-cookie-types').slideDown('fast', function(){ 265 $('#gdpr-cookie-advanced').prop('disabled', true); 266 });*/ 267 $('input#gdpr-cookietype-necessary').prop('data-auto', 'on'); 268 $('input#gdpr-cookietype-necessary').prop('checked', true); 269 $('input#gdpr-cookietype-necessary').prop('disabled', true); 270 //$('#gdpr-cookie-types').toggle(); 271 $('#gdpr-cookie-types').modal('show'); 272 $('.blocker').addClass('gdpr-cookie-modal'); 273 $('.gdpr-cookie-tab-links:first').trigger('click'); 274 275 //location.reload(); 276 }); 277 278 $('body').on('click','#gdpr-cookie-accept-modal', function(){ 279 $('input#gdpr-cookietype-necessary').prop('disabled', false); 280 281 // Set cookie 282 dropCookie(true, settings.expires); 283 284 // If 'data-auto' is set to ON, tick all checkboxes because 285 // the user hasn't clicked the customise cookies button 286 $('input[name="gdpr[]"][data-auto="on"]').prop('checked', true); 287 288 // Save users cookie preferences (in a cookie!) 289 var prefs = []; 290 $.each($('input[name="gdpr[]"]').serializeArray(), function(i, field){ 291 prefs.push(field.value); 292 }); 293 setCookie('cookieControlPrefs', encodeURIComponent(JSON.stringify(prefs)), 365); 294 295 // Run callback function 296 settings.onAccept.call(this); 297 298 $('#gdpr-cookie-types').hide(); 299 $('.close-modal').trigger('click'); 300 301 location.reload(); 302 }); 303 304 $('body').on('click','#gdpr-cookie-accept-all-modal', function(){ 305 $('input#gdpr-cookietype-necessary').prop('disabled', false); 306 307 $('input[name="gdpr[]"]').attr('data-auto', 'on').prop('checked', true); 308 309 // Set cookie 310 dropCookie(true, settings.expires); 311 312 // If 'data-auto' is set to ON, tick all checkboxes because 313 // the user hasn't clicked the customise cookies button 314 $('input[name="gdpr[]"][data-auto="on"]').prop('checked', true); 315 316 // Save users cookie preferences (in a cookie!) 317 var prefs = []; 318 $.each($('input[name="gdpr[]"]').serializeArray(), function(i, field){ 319 prefs.push(field.value); 320 });
321 setCookie('cookieControlPrefs', encodeURIComponent(JSON.stringify(prefs)), 365); 322 323 // Run callback function 324 settings.onAccept.call(this); 325 326 $('#gdpr-cookie-types').modal('hide'); 327 $('.close-modal').trigger('click'); 328 329 location.reload(); 330 }); 331 332 $('body').on('click','#gdpr-cookie-reject', function(){ 333 $('input[name="gdpr[]"]:not(:disabled)').attr('data-auto', 'off').prop('checked', false); 334 335 $('input#gdpr-cookietype-necessary').prop('data-auto', 'on'); 336 $('input#gdpr-cookietype-necessary').prop('checked', true); 337 $('input#gdpr-cookietype-necessary').prop('disabled', false); 338 339 // Set cookie 340 dropCookie(true, settings.expires); 341 342 // $('input[name="gdpr[]"][data-auto="on"]').prop('checked', true); 343 344 // Save users cookie preferences (in a cookie!) 345 var prefs = []; 346 $.each($('input[name="gdpr[]"]').serializeArray(), function(i, field){ 347 prefs.push(field.value); 348 }); 349 setCookie('cookieControlPrefs', encodeURIComponent(JSON.stringify(prefs)), 365); 350 351 // Run callback function 352 settings.onAccept.call(this); 353 354 location.reload(); 355 }); 356 357 } else { 358 var cookieVal = true; 359 if (myCookie == 'false') { 360 cookieVal = false; 361 } 362 dropCookie(cookieVal, settings.expires); 363 } 364 365 // Uncheck any checkboxes on page load 366 if (settings.uncheckBoxes === true) { 367 $('input[type="checkbox"].ihavecookies').prop('checked', false); 368 } 369 370 }; 371 372 // Method to get cookie value 373 $.fn.ihavecookies.cookie = function() { 374 var preferences = getCookie('cookieControlPrefs'); 375 return JSON.parse(unescape(preferences)); 376 }; 377 378 // Method to check if user cookie preference exists 379 $.fn.ihavecookies.preference = function(cookieTypeValue) { 380 var control = getCookie('cookieControl'); 381 var preferences = getCookie('cookieControlPrefs'); 382 if(preferences==''){ 383 preferences = false; 384 } 385 preferences = JSON.parse(unescape(preferences)); 386 if (control === false) { 387 return false; 388 } 389 if (preferences === false || preferences == null || preferences.indexOf(cookieTypeValue) === -1) { 390 return false; 391 } 392 return true; 393 }; 394 395 /* 396 |-------------------------------------------------------------------------- 397 | Drop Cookie 398 |-------------------------------------------------------------------------- 399 | 400 | Function to drop the cookie with a boolean value of true. 401 | 402 */ 403 dropCookie = function(value, expiryDays) { 404 setCookie('cookieControl', value, expiryDays); 405 $('#gdpr-cookie-message').fadeOut('fast', function() { 406 $(this).remove(); 407 }); 408 }; 409 410 /* 411 |-------------------------------------------------------------------------- 412 | Set Cookie 413 |-------------------------------------------------------------------------- 414 | 415 | Sets cookie with 'name' and value of 'value' for 'expiry_days'. 416 | 417 */ 418 setCookie = function(name, value, expiry_days) { 419 var d = new Date(); 420 d.setTime(d.getTime() + (expiry_days*24*60*60*1000)); 421 var expires = "expires=" + d.toUTCString(); 422 document.cookie = name + "=" + value + ";" + expires + ";path=/"; 423 return getCookie(name); 424 }; 425 426 /* 427 |-------------------------------------------------------------------------- 428 | Get Cookie 429 |-------------------------------------------------------------------------- 430 | 431 | Gets cookie called 'name'. 432 | 433 */ 434 getCookie = function(name) { 435 var cookie_name = name + "="; 436 var decodedCookie = decodeURIComponent(document.cookie); 437 var ca = decodedCookie.split(';'); 438 for (var i = 0; i < ca.length; i++) { 439 var c = ca[i]; 440 while (c.charAt(0) == ' ') { 441 c = c.substring(1); 442 } 443 if (c.indexOf(cookie_name) === 0) { 444 return c.substring(cookie_name.length, c.length); 445 } 446 } 447 return false;
448 }; 449 450}(jQuery)); 451//tabs 452function tabChanges(tabId) { 453 $('.gdpr-cookie-tab-content').hide(); 454 $('#'+tabId+'').show(); 455 456 $('.gdpr-cookie-tab-links').removeClass('active'); 457 $('#gdpr-cookie-tab-'+tabId+'').addClass('active'); 458} 459function delete_cookie( name ) { 460 document.cookie = name + '=; expires='+new Date('Thu, 01 Jan 1970 00:00:01 GMT')+'; path=/; domain='+gdpr_cookies_domain+';'; 461} 462$(document).ready(function() { 463 $('body').ihavecookies(options); 464 465 if ($.fn.ihavecookies.preference('marketing') === true) { 466 //console.log('This should run because marketing is accepted.'); 467 } 468 469 $('#ihavecookiesBtn').on('click', function(){ 470 $('body').ihavecookies(options, 'reinit'); 471 }); 472 473 $('.gdpr-cookies-page-toggle-button').on('click', function(){ 474 $(this).siblings().toggle(); 475 }); 476 477 $('input#policy-level-form-necessary').attr('data-auto', 'on'); 478 $('input#policy-level-form-necessary').attr('checked', true); 479 $('input#policy-level-form-necessary').attr('disabled', true); 480 481 var myCookiePrefs_onload = getCookie('cookieControlPrefs'); 482 if(myCookiePrefs_onload==''){ 483 myCookiePrefs_onload = false; 484 } 485 preferences_onload = JSON.parse(unescape(myCookiePrefs_onload)); 486 487 var performance_selected = 0; 488 $.each(preferences_onload, function(index, field) { 489 $('#policy-level-form input#policy-level-form-' + field).prop('checked', true); 490 $('#policy-level-form input#policy-level-form-' + field).attr('data-auto', 'on'); 491 492 if(field == 'performance'){ 493 performance_selected = 1; 494 } 495 }); 496 if(performance_selected == 0){ 497 delete_cookie('_gid'); 498 delete_cookie('_ga'); 499 delete_cookie('_gat'); 500 delete_cookie('__gads'); 501 delete_cookie(_gat_cookie); 502 } 503 504 $('#policy-level-form .switch label').on('click', function(e){ 505 e.preventDefault(); 506 var input_id = $(this).attr('for'); 507 508 $('#'+input_id).trigger('click'); 509 var input_data_auto = $('#'+input_id).attr('data-auto'); 510 if(input_data_auto == 'off'){ 511 $('#'+input_id).attr('data-auto', 'on'); 512 } 513 else{ 514 $('#'+input_id).attr('data-auto', 'off'); 515 } 516 }); 517 518 $('body').on('click','#policy-level-form-button', function(){ 519 $('input#policy-level-form-necessary').prop('disabled', false); 520 521 // Set cookie 522 dropCookie(true, settings.expires); 523 524 // If 'data-auto' is set to ON, tick all checkboxes because 525 // the user hasn't clicked the customise cookies button 526 $('input[name="policy-level-form[]"][data-auto="on"]').prop('checked', true); 527 528 // Save users cookie preferences (in a cookie!) 529 var prefs = []; 530 $.each($('input[name="policy-level-form[]"]').serializeArray(), function(i, field){ 531 prefs.push(field.value); 532 }); 533 setCookie('cookieControlPrefs', encodeURIComponent(JSON.stringify(prefs)), 365); 534 535 // Run callback function 536 settings.onAccept.call(this); 537 538 location.reload(); 539 }); 540});
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.