summaryrefslogtreecommitdiff
path: root/lib/jquery.cookie.js
diff options
context:
space:
mode:
authorShad Laws <shad@shadlaws.com>2013-08-28 11:11:09 -0700
committerShad Laws <shad@shadlaws.com>2013-08-28 11:11:09 -0700
commit59d8b8c80d91e2c671c2e0e87194184b083954c6 (patch)
tree0555e524710df00f8be0cafe3c2d00f4acc18014 /lib/jquery.cookie.js
parentb71800a2dbcefa9c0caac28901b83f8bc2d0b6c7 (diff)
parent1ab7381f49cf656d97e2a81f757d9e3c25e36739 (diff)
Merge pull request #461 from shadlaws/fixes_20130828
Fixes 20130828
Diffstat (limited to 'lib/jquery.cookie.js')
-rw-r--r--lib/jquery.cookie.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/jquery.cookie.js b/lib/jquery.cookie.js
index 86f91c79..13f49f7c 100644
--- a/lib/jquery.cookie.js
+++ b/lib/jquery.cookie.js
@@ -5,6 +5,6 @@
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
-(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d){function m(a){return a}function n(a){return decodeURIComponent(a.replace(j," "))}function k(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e.json?JSON.parse(a):a}catch(c){}}var j=/\+/g,e=d.cookie=function(a,c,b){if(void 0!==c){b=d.extend({},e.defaults,b);if("number"===typeof b.expires){var g=b.expires,f=b.expires=new Date;f.setDate(f.getDate()+g)}c=e.json?
-JSON.stringify(c):String(c);return document.cookie=[e.raw?a:encodeURIComponent(a),"=",e.raw?c:encodeURIComponent(c),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join("")}c=e.raw?m:n;b=document.cookie.split("; ");for(var g=a?void 0:{},f=0,j=b.length;f<j;f++){var h=b[f].split("="),l=c(h.shift()),h=c(h.join("="));if(a&&a===l){g=k(h);break}a||(g[l]=k(h))}return g};e.defaults={};d.removeCookie=function(a,c){return void 0!==
-d.cookie(a)?(d.cookie(a,"",d.extend({},c,{expires:-1})),!0):!1}});
+(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d){function k(a){return e.raw?a:decodeURIComponent(a.replace(n," "))}function l(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));a=k(a);try{return e.json?JSON.parse(a):a}catch(c){}}var n=/\+/g,e=d.cookie=function(a,c,b){if(void 0!==c){b=d.extend({},e.defaults,b);if("number"===typeof b.expires){var f=b.expires,h=b.expires=new Date;h.setDate(h.getDate()+f)}c=e.json?JSON.stringify(c):
+String(c);return document.cookie=[e.raw?a:encodeURIComponent(a),"=",e.raw?c:encodeURIComponent(c),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join("")}c=document.cookie.split("; ");b=a?void 0:{};f=0;for(h=c.length;f<h;f++){var g=c[f].split("="),m=k(g.shift()),g=g.join("=");if(a&&a===m){b=l(g);break}a||(b[m]=l(g))}return b};e.defaults={};d.removeCookie=function(a,c){return void 0!==d.cookie(a)?(d.cookie(a,"",
+d.extend({},c,{expires:-1})),!0):!1}});