summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 8378e2e57..6cc279534 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -363,5 +363,36 @@ function rcube_get_object_pos(obj)
return {x:iX, y:iY};
}
+
+
+// cookie functions by GoogieSpell
+function setCookie(name, value, expires, path, domain, secure)
+ {
+ var curCookie = name + "=" + escape(value) +
+ (expires ? "; expires=" + expires.toGMTString() : "") +
+ (path ? "; path=" + path : "") +
+ (domain ? "; domain=" + domain : "") +
+ (secure ? "; secure" : "");
+ document.cookie = curCookie;
+ }
+
+function getCookie(name)
+ {
+ var dc = document.cookie;
+ var prefix = name + "=";
+ var begin = dc.indexOf("; " + prefix);
+ if (begin == -1)
+ {
+ begin = dc.indexOf(prefix);
+ if (begin != 0) return null;
+ }
+ else
+ begin += 2;
+ var end = document.cookie.indexOf(";", begin);
+ if (end == -1)
+ end = dc.length;
+ return unescape(dc.substring(begin + prefix.length, end));
+ }
+
var bw = new roundcube_browser(); \ No newline at end of file