From 54b8564d9879d2ca7bf1d1fe6c0c0622e43a1e96 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 7 Nov 2012 12:40:52 +0400 Subject: [PATCH] various digest style updates and fixes --- digest.css | 33 +++++++++++++--------------- digest.php | 3 --- js/digest.js | 62 +++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 69 insertions(+), 29 deletions(-) diff --git a/digest.css b/digest.css index f7f031e66..997959ff8 100644 --- a/digest.css +++ b/digest.css @@ -1,9 +1,9 @@ body#ttrssDigest { - background : #fafafa; color : black; font-family : sans-serif; font-size : 12px; margin : 0px; + background : url("images/tile.png"); } a { @@ -62,7 +62,7 @@ a:hover { #content { position : absolute; left : 0px; - top : 30px; + top : 0px; right : 0px; bottom : 0px; -webkit-transition: left 0.2s linear, right 0.2s linear; @@ -78,9 +78,6 @@ a:hover { bottom : 0px; top : 30px; background : white; - border-width : 0px 0px 0px 2px; - border-color : #e0e0e0; - border-style : solid; z-index : -1; opacity : 0; -webkit-transition: opacity 0.2s linear; @@ -155,9 +152,10 @@ a:hover { bottom : 0px; font-size : 14px; overflow : auto; - border-width : 0px 4px 0px 0px; - border-color : #e0e0e0; + border-width : 0px 3px 0px 0px; + border-color : #88b0f0; border-style : solid; + background : #eee; } #feeds ul#feeds-content img { @@ -170,41 +168,39 @@ a:hover { #feeds ul#feeds-content div.unread-ctr { color : #d0d0d0; padding-left : 10px; - display : inline; + float : right; } #feeds ul#feeds-content li { padding : 10px; clear : both; cursor : pointer; - border-width : 1px 0px 1px 0px; - border-color : transparent; - border-style : solid; - color : gray; + color : #303030; white-space : nowrap; } #feeds ul#feeds-content li.selected { background : white; - border-color : #e0e0e0; - border-style : solid; } #feeds ul#feeds-content { list-style-type : none; font-weight : bold; - margin : 10px 10px 10px 10px; + margin : 0px; padding : 0px; } #headlines { font-size : 14px; position : absolute; - left : 302px; - top : 0px; + left : 303px; + top : 30px; bottom : 0px; right : 0px; overflow : auto; + border-width : 0px 3px 0px 0px; + border-style : solid; + border-color : #88b0f0; } #headlines h1 a { @@ -237,10 +233,10 @@ a:hover { padding : 10px; color : gray; clear : left; - background : #eeeeee; border-width : 0px 0px 1px 0px; border-style : solid; border-color : #e0e0e0; + background : #eee; } #headlines ul#headlines-content a.title { @@ -299,6 +295,7 @@ a:hover { #headlines ul#headlines-content div.info { font-size : 11px; + margin-top : 5px; } #headlines ul#headlines-content div.info a { diff --git a/digest.php b/digest.php index 4ec7042cf..d8c224582 100644 --- a/digest.php +++ b/digest.php @@ -79,9 +79,6 @@ - - Tiny Tiny RSS -
 
diff --git a/js/digest.js b/js/digest.js index 1a16ad80a..73af66c08 100644 --- a/js/digest.js +++ b/js/digest.js @@ -261,18 +261,17 @@ function view(article_id) { else publ_part = ""; - var tmp = "
" + - "" + __("Original article") + "" + - "
" + - __("Close this panel") + "
" + - "
" + + var tmp = "
" + "
" + mark_part + publ_part + "
" + - "

" + article.title + "

" + + "

" + "" + + article.title + "" + "

" + "
" + tags_part + + "
" + + __("close") + "
" + "
" + article.content + "
"; @@ -415,8 +414,12 @@ function add_feed_entry(feed) { icon_part = ""; + var title = (feed.title.length > 30) ? + feed.title.substring(0, 30) + "…" : + feed.title; + var tmp_html = "
  • " + - icon_part + feed.title + + icon_part + title + "
    " + "" + feed.unread + "" + "
    " + "
  • "; @@ -470,7 +473,7 @@ function add_headline_entry(article, feed, no_effects) { "
    " + "
    " + article.excerpt + "
    " + - "
    "; + "
    "; /* tmp_html += "" + feed.title + " " + " @ "; */ @@ -653,6 +656,8 @@ function init_second_stage() { parse_feeds(transport); Element.hide("overlay"); + document.onkeydown = hotkey_handler; + window.setTimeout('viewfeed(-4)', 100); _update_timeout = window.setTimeout('update()', 5*1000); } }); @@ -839,3 +844,44 @@ function toggle_select_article(elem) { exception_error("toggle_select_article", e); } } + +function hotkey_handler(e) { + try { + + if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return; + + var keycode = false; + var shift_key = false; + + var cmdline = $('cmdline'); + + try { + shift_key = e.shiftKey; + } catch (e) { + + } + + if (window.event) { + keycode = window.event.keyCode; + } else if (e) { + keycode = e.which; + } + + var keychar = String.fromCharCode(keycode); + + if (keycode == 16) return; // ignore lone shift + if (keycode == 17) return; // ignore lone ctrl + + switch (keycode) { + case 27: // esc + close_article(); + break; + default: + console.log("KP: CODE=" + keycode + " CHAR=" + keychar); + } + + + } catch (e) { + exception_error("hotkey_handler", e); + } +}