1/** 2 * jQuery Cookie plugin 3 * 4 * Copyright (c) 2010 Klaus Hartl (stilbuero.de) 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 */ 9jQuery.cookie = function (key, value, options) { 10 11 // key and at least value given, set cookie... 12 if (arguments.length > 1 && String(value) !== "[object Object]") { 13 options = jQuery.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), '=', 28 options.raw ? value : encodeURIComponent(value), 29 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 30 options.path ? '; path=' + options.path : '', 31 options.domain ? '; domain=' + options.domain : '', 32 options.secure ? '; secure' : '' 33 ].join('')); 34 } 35 36 // key and possibly options given, get cookie... 37 options = value || {}; 38 var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; 39 return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; 40};
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.