summaryrefslogtreecommitdiff
path: root/feedlist.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-13 09:53:56 +0100
committerAndrew Dolgov <[email protected]>2005-12-13 09:53:56 +0100
commitfe14aeb84c58141ca1fb4acde3fd6082c95a80c9 (patch)
treee649004052573c7ea46400e58e5d37d27496231e /feedlist.js
parent28bcadff2b748ac06d05be1a59af4e320d924bf6 (diff)
collapsable categories
Diffstat (limited to 'feedlist.js')
-rw-r--r--feedlist.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/feedlist.js b/feedlist.js
index a974afdb2..ead7948a1 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -1,3 +1,23 @@
+var xmlhttp = false;
+
+/*@cc_on @*/
+/*@if (@_jscript_version >= 5)
+// JScript gives us Conditional compilation, we can cope with old IE versions.
+// and security blocked creation of the objects.
+try {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+} catch (e) {
+ try {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (E) {
+ xmlhttp = false;
+ }
+}
+@end @*/
+
+if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
+ xmlhttp = new XMLHttpRequest();
+}
function viewfeed(feed, skip, subop, doc) {
try {
@@ -136,6 +156,35 @@ function localHotkeyHandler(keycode) {
}
+function toggleCollapseCat(cat) {
+ try {
+ if (!xmlhttp_ready(xmlhttp)) {
+ printLockingError();
+ return;
+ }
+
+ var cat_elem = document.getElementById("FCAT-" + cat);
+ var cat_list = cat_elem.nextSibling;
+ var caption = cat_elem.lastChild;
+
+ if (cat_list.className.match("invisible")) {
+ cat_list.className = "";
+ caption.innerHTML = caption.innerHTML.replace("...", "");
+ } else {
+ cat_list.className = "invisible";
+ caption.innerHTML = caption.innerHTML + "...";
+ }
+
+ xmlhttp_rpc.open("GET", "backend.php?op=feeds&subop=collapse&cid=" +
+ param_escape(cat), true);
+ xmlhttp_rpc.onreadystatechange=rpc_pnotify_callback;
+ xmlhttp_rpc.send(null);
+
+ } catch (e) {
+ exception_error(e);
+ }
+}
+
function init() {
hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1);
document.onkeydown = hotkey_handler;