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:
47
functions.js
47
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user