1/*jshint eqnull:true */ 2/*! 3* jQuery Cookie Plugin v1.2 4* https://github.com/carhartl/jquery-cookie 5* 6* Copyright 2011, Klaus Hartl 7* Dual licensed under the MIT or GPL Version 2 licenses. 8* http://www.opensource.org/licenses/mit-license.php 9* http://www.opensource.org/licenses/GPL-2.0 10*/ 11(function ($, document, undefined) 12{ 13 14 var pluses = /\+/g; 15 16 function raw(s) 17 { 18 return s; 19 } 20 21 function decoded(s) 22 { 23 return decodeURIComponent(s.replace(pluses, ' ')); 24 } 25 26 var config = $.cookie = function (key, value, options) 27 { 28 29 // write 30 if (value !== undefined) 31 { 32 options = $.extend({}, config.defaults, options); 33 34 if (value === null) 35 { 36 options.expires = -1; 37 } 38 39 if (typeof options.expires === 'number') 40 { 41 var days = options.expires, t = options.expires = new Date(); 42 t.setDate(t.getDate() + days); 43 } 44 45 value = config.json ? JSON.stringify(value) : String(value); 46 47 return (document.cookie = [ 48 encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), 49 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 50 options.path ? '; path=' + options.path : '', 51 options.domain ? '; domain=' + options.domain : '', 52 options.secure ? '; secure' : '' 53 ].join('')); 54 } 55 56 // read 57 var decode = config.raw ? raw : decoded; 58 var cookies = document.cookie.split('; '); 59 for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) 60 { 61 if (decode(parts.shift()) === key) 62 { 63 var cookie = decode(parts.join('=')); 64 return config.json ? JSON.parse(cookie) : cookie; 65 } 66 } 67 68 return null; 69 }; 70 71 config.defaults = {}; 72 73 $.removeCookie = function (key, options) 74 { 75 if ($.cookie(key, options) !== null) 76 { 77 $.cookie(key, null, options); 78 return true; 79 } 80 return false; 81 }; 82 83})(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.