From e8a429e3f80ea764d603b9f505e938e174fd0e64 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 23 Jan 2009 15:20:36 +0100 Subject: [PATCH] properly select next unread feed in feedlist when catching up --- functions.js | 74 ++++++++++++++++++++++++++++++++++++++++++---------- tt-rss.css | 35 +++++++++++++++++++++++++ tt-rss.php | 8 ++++++ viewfeed.js | 2 +- 4 files changed, 104 insertions(+), 15 deletions(-) diff --git a/functions.js b/functions.js index cb38ff37d..ebf9232e5 100644 --- a/functions.js +++ b/functions.js @@ -16,7 +16,43 @@ function is_opera() { return window.opera; } +function exception_error_ext(location, e, ext_info) { + var msg = format_exception_error(location, e); + var ebc = document.getElementById("xebContent"); + + disableHotkeys(); + + if (ebc) { + + Element.show("dialog_overlay"); + Element.show("extendedErrorBox"); + + if (ext_info) { + if (ext_info.responseText) { + ext_info = ext_info.responseText; + } + } + + ebc.innerHTML = + "
Error message:
" + + "
" + msg + "
" + + "
Additional information:
" + + ""; + + } else { + alert(msg); + } +} + function exception_error(location, e, silent) { + var msg = format_exception_error(location, e); + + if (!silent) { + alert(msg); + } +} + +function format_exception_error(location, e) { var msg; if (e.fileName) { @@ -34,11 +70,10 @@ function exception_error(location, e, silent) { debug("EXCEPTION: " + msg + ""); - if (!silent) { - alert(msg); - } + return msg; } + function disableHotkeys() { hotkeys_enabled = false; } @@ -1243,22 +1278,33 @@ function leading_zero(p) { return s; } -function closeInfoBox(cleanup) { - - Element.hide("dialog_overlay"); +function closeErrorBox() { - var box = document.getElementById('infoBox'); - var shadow = document.getElementById('infoBoxShadow'); + if (Element.visible("extendedErrorBox")) { + Element.hide("dialog_overlay"); + + Element.hide("extendedErrorBox"); - if (shadow) { - shadow.style.display = "none"; - } else if (box) { - box.style.display = "none"; + enableHotkeys(); } - if (cleanup) box.innerHTML = " "; + return false; +} + +function closeInfoBox(cleanup) { - enableHotkeys(); + if (Element.visible("infoBoxShadow")) { + Element.hide("dialog_overlay"); + + var shadow = document.getElementById('infoBoxShadow'); + var box = document.getElementById('infoBoxShadow'); + + Element.hide(shadow); + + if (cleanup) box.innerHTML = " "; + + enableHotkeys(); + } return false; } diff --git a/tt-rss.css b/tt-rss.css index 26c2729c6..96502b560 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -2083,3 +2083,38 @@ ul#headlineActionsBody li.insensitive:hover { cursor : normal; color : gray; } + +div#extendedErrorBox { + left : 25%; + top : 70px; + width : 50%; + z-index : 999; + position : absolute; + min-width : 600px; + background-color : #ffcccc; + border : 1px solid #ff0000; + font-size : 12px; +} + +div#extendedErrorBox div#xebTitle { + background-color : #ff0000; + color : white; + padding : 4px 2px 4px 10px; + color : white; + font-weight : bold; + font-size : 12px; +} + +div#extendedErrorBox div#xebContent { + font-size : 12px; + padding : 10px; +} + +div#extendedErrorBox textarea { + width : 100%; + height : 200px; +} + +div#extendedErrorBox input { + margin-bottom : 10px; +} diff --git a/tt-rss.php b/tt-rss.php index f56c14310..8f1dadd9e 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -51,6 +51,14 @@ + +