mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-16 09:55:05 +00:00
e56303798c
Initial SickGear for Python 3.
11 lines
1.8 KiB
JavaScript
11 lines
1.8 KiB
JavaScript
/*
|
|
JavaScript Cookie v2.1.3
|
|
https://github.com/js-cookie/js-cookie
|
|
|
|
Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
|
Released under the MIT license
|
|
*/
|
|
(function(m){var h=!1;"function"===typeof define&&define.amd&&(define(m),h=!0);"object"===typeof exports&&(module.exports=m(),h=!0);if(!h){var e=window.Cookies,a=window.Cookies=m();a.noConflict=function(){window.Cookies=e;return a}}})(function(){function m(){for(var e=0,a={};e<arguments.length;e++){var b=arguments[e],c;for(c in b)a[c]=b[c]}return a}function h(e){function a(b,c,d){var f;if("undefined"!==typeof document){if(1<arguments.length){d=m({path:"/"},a.defaults,d);if("number"===typeof d.expires){var k=
|
|
new Date;k.setMilliseconds(k.getMilliseconds()+864E5*d.expires);d.expires=k}d.expires=d.expires?d.expires.toUTCString():"";try{f=JSON.stringify(c),/^[\{\[]/.test(f)&&(c=f)}catch(p){}c=e.write?e.write(c,b):encodeURIComponent(String(c)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);b=encodeURIComponent(String(b));b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);b=b.replace(/[\(\)]/g,escape);f="";for(var l in d)d[l]&&(f+="; "+l,!0!==d[l]&&(f+="="+d[l]));
|
|
return document.cookie=b+"="+c+f}b||(f={});l=document.cookie?document.cookie.split("; "):[];for(var h=/(%[0-9A-Z]{2})+/g,n=0;n<l.length;n++){var q=l[n].split("="),g=q.slice(1).join("=");'"'===g.charAt(0)&&(g=g.slice(1,-1));try{k=q[0].replace(h,decodeURIComponent);g=e.read?e.read(g,k):e(g,k)||g.replace(h,decodeURIComponent);if(this.json)try{g=JSON.parse(g)}catch(p){}if(b===k){f=g;break}b||(f[k]=g)}catch(p){}}return f}}a.set=a;a.get=function(b){return a.call(a,b)};a.getJSON=function(){return a.apply({json:!0},
|
|
[].slice.call(arguments))};a.defaults={};a.remove=function(b,c){a(b,"",m(c,{expires:-1}))};a.withConverter=h;return a}return h(function(){})});
|