1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 04:15:55 +00:00

inputify buttons, store view modes in session cookies, disable headline toolbar initially

This commit is contained in:
Andrew Dolgov
2005-09-06 05:14:17 +01:00
parent 5f89f7803b
commit ac43eba1ab
5 changed files with 130 additions and 47 deletions

View File

@@ -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";
}
}
}
}