1/*! 2 * jQuery Cookiebar Plugin 3 * https://github.com/carlwoodhouse/jquery.cookieBar 4 * 5 * Copyright 2012-17, Carl Woodhouse. the cookie function is inspired by https://github.com/carhartl/jquery-cookie 6 * Disclaimer: if you still get fined for not complying with the eu cookielaw, it's not our fault. 7 * Licence: MIT 8 */ 9 10(function ($) { 11 $.cookie = function (key, value, options) { 12 if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) { 13 options = $.extend({}, options); 14 15 if (value === null || value === undefined) { 16 options.expires = -1; 17 } 18 19 if (typeof options.expires === 'number') { 20 var days = options.expires, t = options.expires = new Date(); 21 t.setDate(t.getDate() + days); 22 } 23 24 value = String(value); 25 26 return (document.cookie = [ 27 encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value), 28 options.expires ? '; expires=' + options.expires.toUTCString() : '', // max-age is not supported by IE 29 options.path ? '; path=' + options.path : '', 30 options.domain ? '; domain=' + options.domain : '', 31 options.secure ? '; secure' : '' 32 ].join('')); 33 } 34 options = value || {}; 35 var decode = options.raw ? function (s) { return s; } : decodeURIComponent; 36 37 var pairs = document.cookie.split('; '); 38 for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) { 39 // IE 40 if (decode(pair[0]) === key) return decode(pair[1] || ''); 41 } 42 return null; 43 }; 44 45 $.fn.cookieBar = function (options) { 46 var settings = $.extend({ 47 'closeButton': 'none', 48 'hideOnClose': true, 49 'secure': false, 50 'path': '/', 51 'domain': '', 52 'name': 'cookiebar', 53 'expiresDays': 365 54 }, options); 55 56 return this.each(function () { 57 var cookiebar = $(this); 58 59 // just in case they didnt hide it by default. 60 cookiebar.hide(); 61 62 // if close button not defined. define it! 63 if (settings.closeButton == 'none') { 64 cookiebar.append('<a class="cookiebar-close">Continue</a>'); 65 $.extend(settings, { 'closeButton': '.cookiebar-close' }); 66 } 67 68 if ($.cookie(settings.name) != 'hide') { 69 cookiebar.show(); 70 } 71 72 cookiebar.find(settings.closeButton).click(function () { 73 if (settings.hideOnClose) { 74 cookiebar.hide(); 75 } 76 $.cookie(settings.name, 'hide', { path: settings.path, secure: settings.secure, domain: settings.domain, expires: settings.expiresDays }); 77 cookiebar.trigger('cookieBar-close'); 78 return false; 79 }); 80 }); 81 }; 82 83 // self injection init 84 $.cookieBar = function (options) { 85 $('body').prepend('<div class="ui-widget"><div style="display: none;" class="cookie-message ui-widget-header blue"><p>By using this website you allow us to place cookies on your computer. They are harmless and never personally identify you.</p></div></div>'); 86 $('.cookie-message').cookieBar(options); 87 }; 88})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.