From f3169d7ecc54462e7536bef380eba1f26fe837df Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 19 May 2008 17:13:22 +0100 Subject: [PATCH] add vertical resize grip --- feedlist.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ tt-rss.css | 15 +++++++++++++++ tt-rss.js | 17 +++++++++++++---- tt-rss.php | 1 + 4 files changed, 77 insertions(+), 4 deletions(-) diff --git a/feedlist.js b/feedlist.js index ac2985a2..e4ea70cc 100644 --- a/feedlist.js +++ b/feedlist.js @@ -328,6 +328,9 @@ function feedlist_init() { hideOrShowFeeds(document, getInitParam("hide_read_feeds") == 1); document.onkeydown = hotkey_handler; + document.onmousemove = mouse_move_handler; + document.onmousedown = mouse_down_handler; + document.onmouseup = mouse_up_handler; setTimeout("timeout()", 0); /* debug("about to remove splash, OMG!"); @@ -460,4 +463,49 @@ function init_collapsable_feedlist(theme) { } +var mouse_is_down = false; +var mouse_y = 0; +function mouse_move_handler(e) { + try { + var client_y; + + if (window.event) { + client_y = window.event.clientY; + } else if (e) { + + } + + if (mouse_is_down) { + if (mouse_y == 0) mouse_y = client_y; + + debug("moved delta: " + (mouse_y - client_y)); + + resize_headlines(0, mouse_y - client_y); + return false; + } + + } catch (e) { + exception_error("mouse_move_handler", e); + } +} + +function mouse_down_handler(e) { + try { + + mouse_is_down = true; + + } catch (e) { + exception_error("mouse_move_handler", e); + } +} + +function mouse_up_handler(e) { + try { + + mouse_is_down = false; + + } catch (e) { + exception_error("mouse_move_handler", e); + } +} diff --git a/tt-rss.css b/tt-rss.css index 32517c51..fa255a42 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1490,6 +1490,21 @@ div.headlines_cdm { /* height: expression((parseInt(document.documentElement.clientHeight)-40-305-50)+'px'); */ } +#resize-grabber { + position : absolute; + border-width : 1px; + border-style : dotted; + border-color : #88b0f0; + background-color : white; + width : 10px; + height : 10px; + z-index : 20; + right : 10px; + top : 20px; + display : none; + cursor : move; +} + #footer, #prefFooter { position : absolute; bottom : 0px; diff --git a/tt-rss.js b/tt-rss.js index 482ddabf..68a4da79 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -16,6 +16,7 @@ var sanity_check_done = false; var _hfd_scrolltop = 0; var hotkey_prefix = false; var init_params = new Object(); +var ver_reflow_delta = 0; function tagsAreDisplayed() { return display_tags; @@ -356,12 +357,15 @@ function init() { } } -function resize_headlines() { +function resize_headlines(delta_x, delta_y) { + + ver_reflow_delta = delta_y; var h_frame = document.getElementById("headlines-frame"); var c_frame = document.getElementById("content-frame"); var f_frame = document.getElementById("footer"); var feeds_frame = document.getElementById("feeds-holder"); + var resize_grab = document.getElementById("resize-grabber"); if (!c_frame || !h_frame) return; @@ -379,9 +383,14 @@ function resize_headlines() { debug("resize_headlines: VER-mode"); if (!is_msie()) { - h_frame.style.height = 30 + "%"; - c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; + h_frame.style.height = (300 - ver_reflow_delta) + "px"; + + c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 1) + "px"; h_frame.style.height = h_frame.offsetHeight + "px"; + + resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 5) + "px"; + resize_grab.style.display = "block"; + } else { h_frame.style.height = document.documentElement.clientHeight * 0.3 + "px"; c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; @@ -395,7 +404,7 @@ function resize_headlines() { c_frame.style.height = c_bottom - (h_frame.offsetTop + h_frame.offsetHeight + 1) + "px"; h_frame.style.height = h_frame.offsetHeight + "px"; - + } } diff --git a/tt-rss.php b/tt-rss.php index 1de9ce87..fc6aee56 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -239,6 +239,7 @@ window.onload = init;
 
+
-- 2.39.5