summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-06 05:14:17 +0100
committerAndrew Dolgov <[email protected]>2005-09-06 05:14:17 +0100
commitac43eba1ab9a352de1b06161f9d23f77d445dce8 (patch)
treee7bd2bd547ca99355594fc02cf3032f2d9a5b691 /functions.js
parent5f89f7803b18d2c66a076bf7c3b9a7221dc3278f (diff)
inputify buttons, store view modes in session cookies, disable headline toolbar initially
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/functions.js b/functions.js
index 90245a192..d1f445ec2 100644
--- a/functions.js
+++ b/functions.js
@@ -196,4 +196,51 @@ function getFeedIds() {
return rows;
}
+function setCookie(name, value, expires, path, domain, secure) {
+ document.cookie= name + "=" + escape(value) +
+ ((expires) ? "; expires=" + expires.toGMTString() : "") +
+ ((path) ? "; path=" + path : "") +
+ ((domain) ? "; domain=" + domain : "") +
+ ((secure) ? "; secure" : "");
+}
+
+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));
+}
+
+function disableContainerChildren(id, disable) {
+ var container = document.getElementById(id);
+
+ for (var i = 0; i < container.childNodes.length; i++) {
+ var child = container.childNodes[i];
+
+ child.disabled = disable;
+
+ if (disable) {
+ if (child.className && child.className.match("button")) {
+ child.className = "disabledButton";
+ }
+ } else {
+ if (child.className && child.className.match("disabledButton")) {
+ child.className = "button";
+ }
+ }
+ }
+
+}