1//jQuery Cookie Plugin v1.3 2//https://github.com/carhartl/jquery-cookie 3(function ($, document, undefined) { 4 var pluses = /\+/g; 5 function raw(s) { 6 return s; 7 } 8 function decoded(s) { 9 return decodeURIComponent(s.replace(pluses, ' ')); 10 } 11 var config = $.cookie = function (key, value, options) { 12 // write 13 if (value !== undefined) { 14 options = $.extend({}, config.defaults, options); 15 if (value === null) { 16 options.expires = -1; 17 } 18 if (typeof options.expires === 'number') { 19 var days = options.expires, t = options.expires = new Date(); 20 t.setDate(t.getDate() + days); 21 } 22 value = config.json ? JSON.stringify(value) : String(value); 23 return (document.cookie = [ 24 encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), 25 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 26 options.path ? '; path=' + options.path : '', 27 options.domain ? '; domain=' + options.domain : '', 28 options.secure ? '; secure' : '' 29 ].join('')); 30 } 31 // read 32 var decode = config.raw ? raw : decoded; 33 var cookies = document.cookie.split('; '); 34 for (var i = 0, l = cookies.length; i < l; i++) { 35 var parts = cookies[i].split('='); 36 if (decode(parts.shift()) === key) { 37 var cookie = decode(parts.join('=')); 38 return config.json ? JSON.parse(cookie) : cookie; 39 } 40 } 41 return null; 42 }; 43 config.defaults = {}; 44 $.removeCookie = function (key, options) { 45 if ($.cookie(key) !== null) { 46 $.cookie(key, null, options); 47 return true; 48 } 49 return false; 50 }; 51})(jQuery, document);
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.