From 24c1e1c1444a963fae480615d4e44ed5cd2af588 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Feb 2008 17:00:02 +0100 Subject: [PATCH] initial hidden feedlist work (refs #194) --- feedlist.js | 31 +++++++++++++++++++++++++------ functions.php | 4 ++++ tt-rss.js | 15 +++++++++++++++ tt-rss.php | 3 +++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/feedlist.js b/feedlist.js index 878a538c1..e1a1e7c56 100644 --- a/feedlist.js +++ b/feedlist.js @@ -40,6 +40,11 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) { cache_invalidate("F:" + feed); } + if (getInitParam("theme") == "" && getInitParam("hide_feedlist")) { + Element.hide("feeds-holder"); + + } + var force_nocache = false; var page_offset = 0; @@ -338,9 +343,11 @@ function feedlist_init() { if (getInitParam("theme") == "") { setTimeout("hide_footer()", 5000); - } -// init_hidden_feedlist(); + if (getInitParam("hide_feedlist")) { + init_hidden_feedlist(); + } + } } catch (e) { exception_error("feedlist/init", e); @@ -378,14 +385,26 @@ function hide_footer() { function init_hidden_feedlist() { try { + debug("init_hidden_feedlist"); + var fl = document.getElementById("feeds-holder"); var fh = document.getElementById("headlines-frame"); - var fh = document.getElementById("headlines-frame"); - - new Effect.Fade(fl); + var fc = document.getElementById("content-frame"); + var ft = document.getElementById("toolbar"); + var ff = document.getElementById("footer"); + var fbtn = document.getElementById("toggle_feeds_btn"); + if (fbtn) Element.show(fbtn); + + fl.style.top = fh.offsetTop + "px"; + fl.style.backgroundColor = "white"; //FIXME + + Element.hide(fl); - + fh.style.left = "0px"; + ft.style.left = "0px"; + if (fc) fc.style.left = "0px"; + if (ff) ff.style.left = "0px"; } catch (e) { exception_error("init_hidden_feedlist", e); diff --git a/functions.php b/functions.php index 25ecec1c2..d4f853a54 100644 --- a/functions.php +++ b/functions.php @@ -2925,6 +2925,10 @@ print ""; + if (defined('_HIDDEN_FL_TEST')) { + print ""; + } + print ""; } diff --git a/tt-rss.js b/tt-rss.js index d501890fe..2bdca6919 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -739,4 +739,19 @@ function clearFeedArticles(feed_id) { return false; } +function toggle_feedlist() { + try { + debug("toggle_feedlist"); + var fl = document.getElementById("feeds-holder"); + + if (!Element.visible(fl)) { + Element.show(fl); + fl.style.zIndex = 30; + } else { + Element.hide(fl); + } + } catch (e) { + exception_error(e, "toggle_feedlist"); + } +} diff --git a/tt-rss.php b/tt-rss.php index c3c8957e1..0cb86c365 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -158,6 +158,9 @@ window.onload = init;
+ " id="toggle_feeds_btn" + onclick="toggle_feedlist()" style="display : none"> +