summaryrefslogtreecommitdiff
path: root/misc/jquery.cookie.js
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-01 12:16:48 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-01 12:16:48 +0000
commit907faab2bbf0e4b701c7a2d73f653f513ff911cd (patch)
tree0a0c7a92bf86af949bdb27b5c0ca41df3ed861b1 /misc/jquery.cookie.js
parent199dc7cc9d18378d4a3ca19551984381b6094744 (diff)
downloadbrdo-907faab2bbf0e4b701c7a2d73f653f513ff911cd.tar.gz
brdo-907faab2bbf0e4b701c7a2d73f653f513ff911cd.tar.bz2
- Patch #507072 by DamZ: added jQuery cookie library.
Diffstat (limited to 'misc/jquery.cookie.js')
-rw-r--r--misc/jquery.cookie.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/jquery.cookie.js b/misc/jquery.cookie.js
new file mode 100644
index 000000000..401f356dc
--- /dev/null
+++ b/misc/jquery.cookie.js
@@ -0,0 +1,12 @@
+// $Id$
+
+/**
+ * Cookie plugin 1.0
+ *
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};