summaryrefslogtreecommitdiff
path: root/static/js/src/vendor/jquery.cookie.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2012-07-18 00:02:21 -0400
committerJules Laplace <jules@okfoc.us>2012-07-18 00:02:21 -0400
commitc4338d2ae878a167c409e91dea6d1783fc7e30ba (patch)
tree1e54fac722ac3153f9180a5a8332f2b19e11c00c /static/js/src/vendor/jquery.cookie.js
parentd891a7ae1b205716c086363fba17a3249a665deb (diff)
put away back
Diffstat (limited to 'static/js/src/vendor/jquery.cookie.js')
-rw-r--r--static/js/src/vendor/jquery.cookie.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/static/js/src/vendor/jquery.cookie.js b/static/js/src/vendor/jquery.cookie.js
new file mode 100644
index 0000000..ca215e5
--- /dev/null
+++ b/static/js/src/vendor/jquery.cookie.js
@@ -0,0 +1,6 @@
+// http://plugins.jquery.com/files/jquery.cookie.js.txt
+jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
+var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
+expires='; expires='+date.toUTCString();}
+var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
+return cookieValue;}}; \ No newline at end of file