lemonldap-ng/lemonldap-ng-portal/site/htdocs/static/bwr/jquery.cookie/jquery.cookie.min.js
2020-10-10 10:03:55 +02:00

8 lines
1.3 KiB
JavaScript

/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(v){var i=/\+/g;function x(e){return l.raw?e:encodeURIComponent(e)}function k(e,o){var n=l.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(i," ")),l.json?JSON.parse(e):e}catch(e){}}(e);return v.isFunction(o)?o(n):n}var l=v.cookie=function(e,o,n){var i,r,t;if(void 0!==o&&!v.isFunction(o))return"number"==typeof(n=v.extend({},l.defaults,n)).expires&&(i=n.expires,(r=n.expires=new Date).setTime(+r+864e5*i)),document.cookie=[x(e),"=",(t=o,x(l.json?JSON.stringify(t):String(t))),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("");for(var c,u=e?void 0:{},a=document.cookie?document.cookie.split("; "):[],d=0,p=a.length;d<p;d++){var s=a[d].split("="),f=(c=s.shift(),l.raw?c:decodeURIComponent(c)),m=s.join("=");if(e&&e===f){u=k(m,o);break}e||void 0===(m=k(m))||(u[f]=m)}return u};l.defaults={},v.removeCookie=function(e,o){return void 0!==v.cookie(e)&&(v.cookie(e,"",v.extend({},o,{expires:-1})),!v.cookie(e))}});