]> git.wh0rd.org Git - tt-rss.git/commitdiff
add vertical resize grip
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 19 May 2008 16:13:22 +0000 (17:13 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 19 May 2008 16:13:22 +0000 (17:13 +0100)
feedlist.js
tt-rss.css
tt-rss.js
tt-rss.php

index ac2985a2fed036772d55be901fcc043cce6db8df..e4ea70cc5b049f181b482c23588b4e5029e49696 100644 (file)
@@ -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);
+       }
+}
index 32517c511c29841d74542ff377f001e2b6a9ccb8..fa255a4268abfa1286be0a502c44acb4e0502a2e 100644 (file)
@@ -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;
index 482ddabf8cc6184ab4263a85ec4e67c2bb513df2..68a4da7950d4d871340f1aa369bede6fa233e779 100644 (file)
--- 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";
-       
+
                }
 
        }
index 1de9ce87a40f9b3e18778fb87cdc8febc962e849..fc6aee56c521d4b6084ba5dea545bb1b963511d1 100644 (file)
@@ -239,6 +239,7 @@ window.onload = init;
        <div id="headlines-frame" class="headlines_normal">
                <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>
        <div id="content-frame"><div class="whiteBox">&nbsp;</div></div>
+       <div id="resize-grabber" title="<?php echo __('Drag me to resize panels') ?>"> </div>
 <?php } else { ?>
        <div id="headlines-frame" class="headlines_cdm">
                <div class="whiteBox"><?php echo __('No feed selected.') ?></div></div>