From a95e14fb4c0f73291cd15cad20becb262378a9d7 Mon Sep 17 00:00:00 2001 From: Matt Haley Date: Thu, 13 Jun 2013 22:39:26 -0700 Subject: Load selected feed after a short timeout Avoid firing multiple server requests if the user is navigating up/down the tree list with the keyboard. Instead, wait till the user has stopped navigating for at least 250ms. --- js/tt-rss.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index ee3156c28..cc04a454a 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -272,13 +272,13 @@ function init() { var rv = dijit.byId("feedTree").getNextFeed( getActiveFeedId(), activeFeedIsCat()); - if (rv) viewfeed(rv[0], '', rv[1]); + if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true); }; hotkey_actions["prev_feed"] = function() { var rv = dijit.byId("feedTree").getPreviousFeed( getActiveFeedId(), activeFeedIsCat()); - if (rv) viewfeed(rv[0], '', rv[1]); + if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true); }; hotkey_actions["next_article"] = function() { moveToPost('next'); -- cgit v1.2.3-54-g00ecf From 3faad714e280988ade597a83e8f16e74eedfb995 Mon Sep 17 00:00:00 2001 From: Jeffrey Tolar Date: Fri, 21 Jun 2013 01:31:21 -0500 Subject: Add missing hotkey handler --- js/tt-rss.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index cc04a454a..a1d7d6411 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -339,6 +339,9 @@ function init() { hotkey_actions["dismiss_selected"] = function() { dismissSelectedArticles(); }; + hotkey_actions["dismiss_read"] = function() { + dismissReadArticles(); + }; hotkey_actions["open_in_new_window"] = function() { if (getActiveArticleId()) { openArticleInNewWindow(getActiveArticleId()); -- cgit v1.2.3-54-g00ecf From d999bc3eb2e0000aad7f92f73ed26938c7a83519 Mon Sep 17 00:00:00 2001 From: Andrew Herron Date: Tue, 2 Jul 2013 22:29:19 +1000 Subject: prevent accidental ctrl_key global --- js/tt-rss.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index a1d7d6411..c14c65f27 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -847,6 +847,7 @@ function hotkey_handler(e) { var keycode = false; var shift_key = false; + var ctrl_key = false; var cmdline = $('cmdline'); -- cgit v1.2.3-54-g00ecf From c65bd1027ab46848493973da0515640a93815d27 Mon Sep 17 00:00:00 2001 From: Andrew Herron Date: Tue, 2 Jul 2013 22:36:29 +1000 Subject: Added alt and meta key handling to hotkeys --- js/tt-rss.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index c14c65f27..46e282351 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -848,11 +848,15 @@ function hotkey_handler(e) { var keycode = false; var shift_key = false; var ctrl_key = false; + var alt_key = false; + var meta_key = false; var cmdline = $('cmdline'); shift_key = e.shiftKey; ctrl_key = e.ctrlKey; + alt_key = e.altKey; + meta_key = e.metaKey; if (window.event) { keycode = window.event.keyCode; @@ -894,6 +898,8 @@ function hotkey_handler(e) { // ensure ^*char notation if (shift_key) hotkey = "*" + hotkey; if (ctrl_key) hotkey = "^" + hotkey; + if (alt_key) hotkey = "+" + hotkey; + if (meta_key) hotkey = "%" + hotkey; hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey; hotkey_prefix = false; -- cgit v1.2.3-54-g00ecf From 1966e05457ebb537f2bfd11d779cada2489bcf35 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Jul 2013 14:20:42 +0400 Subject: workaround for resetting panel size cookies (closes #756) --- js/tt-rss.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 46e282351..04aec0cca 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -573,13 +573,17 @@ function init_second_stage() { var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize', function (args) { - setCookie("ttrss_fh_width", args.w, getInitParam("cookie_lifetime")); + if (args && args.w >= 0) { + setCookie("ttrss_fh_width", args.w, getInitParam("cookie_lifetime")); + } }); var tmph = dojo.connect(dijit.byId('content-insert'), 'resize', function (args) { - setCookie("ttrss_ci_width", args.w, getInitParam("cookie_lifetime")); - setCookie("ttrss_ci_height", args.h, getInitParam("cookie_lifetime")); + if (args && args.w >= 0 && args.h >= 0) { + setCookie("ttrss_ci_width", args.w, getInitParam("cookie_lifetime")); + setCookie("ttrss_ci_height", args.h, getInitParam("cookie_lifetime")); + } }); }); -- cgit v1.2.3-54-g00ecf From d7e4897b8ee6506ececf0a3bd4aa7c44c4dc4c6a Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Fri, 20 Sep 2013 00:04:33 -0400 Subject: Firefox accessibility.typeaheadfind is triggered for multikey shortcuts. For multikey shortcuts Firefox accessibility.typeaheadfind is triggered. Returning false will cause the default event from occuring and prevent the event from bubbling up. --- js/tt-rss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 04aec0cca..b5bbd9f57 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -892,7 +892,7 @@ function hotkey_handler(e) { cmdline.innerHTML = keychar; Element.show(cmdline); - return true; + return false; } Element.hide(cmdline); -- cgit v1.2.3-54-g00ecf From 37283773440651376caf89a487b21872585ab846 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 27 Sep 2013 15:14:20 +0400 Subject: Revert "Firefox accessibility.typeaheadfind is triggered for multikey shortcuts." breaks copy/paste in chrome This reverts commit d7e4897b8ee6506ececf0a3bd4aa7c44c4dc4c6a. --- js/tt-rss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index b5bbd9f57..04aec0cca 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -892,7 +892,7 @@ function hotkey_handler(e) { cmdline.innerHTML = keychar; Element.show(cmdline); - return false; + return true; } Element.hide(cmdline); -- cgit v1.2.3-54-g00ecf From d44f3da4be8fc11543765b9dcc2743083bfd8be0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 27 Jan 2014 19:03:35 +0400 Subject: default theme updates --- classes/feeds.php | 2 +- css/cdm.css | 14 +++-- css/tt-rss.css | 138 +++++++++++++++++++++++++++++--------------- images/treeExpandImages.png | Bin 0 -> 288 bytes js/tt-rss.js | 12 +--- 5 files changed, 105 insertions(+), 61 deletions(-) create mode 100644 images/treeExpandImages.png (limited to 'js/tt-rss.js') diff --git a/classes/feeds.php b/classes/feeds.php index 5fc75cb2f..536f1b793 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -725,7 +725,7 @@ class Feeds extends Handler_Protected { $reply['content'] .= ""; $reply['content'] .= ""; - $reply['content'] .= "
"; + $reply['content'] .= ""; $reply['content'] .= ""; diff --git a/css/cdm.css b/css/cdm.css index c6e309d27..5b004fccf 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -73,10 +73,16 @@ div.cdm.expanded { margin-bottom : 4px; } +div.cdm.expanded div.cdmFooter { + border-style : solid; + border-width : 0px 0px 1px 0px; + border-color : #f0f0f0; +} + div.cdm.expandable { background-color : #f0f0f0; border-width : 0px 0px 1px 0px; - border-color : #c0c0c0; + border-color : #ddd; border-style : solid; } @@ -98,8 +104,6 @@ div.cdm.expandable.Selected { } div.cdm.expandable.active { - box-shadow : inset 0px 0px 3px 0px rgba(0,0,0,0.1); - border-color : #88b0f0; background : white ! important; } @@ -247,9 +251,9 @@ div#floatingTitle { right : 0px; left : 0px; border-color : #ccc; - border-width : 1px 0px 1px 0px; + border-width : 0px 0px 1px 0px; border-style : solid; - background : #fcfcfc; + background : white; color : #555; box-shadow : 0px 1px 1px 0px rgba(0,0,0,0.1); } diff --git a/css/tt-rss.css b/css/tt-rss.css index 559b8f92b..41f163ccb 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -24,8 +24,8 @@ div.postReply { div.postReply div.postHeader { border-width : 0px 0px 1px 0px; border-style : solid; - border-color : #c0c0c0; - background : #fafafa; + border-color : #eee; + background : white; box-shadow : 0px 0px 3px 0px rgba(0,0,0,0.1); padding : 5px; color : #909090; @@ -66,12 +66,12 @@ div.postReply img.tagsPic { div.articleNote { background-color : #fff7d5; padding : 5px; - border-radius : 4px; + /* border-radius : 4px; */ margin : 5px; border-style : solid; border-color : #e7d796; border-width : 1px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ background-color : #fff7d5; color : #9a8c59; } @@ -108,8 +108,7 @@ h3 { hr { border-width : 0px 0px 1px 0px; border-style : solid; - border-color : #c0c0c0; - max-width : 90%; + border-color : #ccc; } a { @@ -138,7 +137,7 @@ a:hover { min-width : 100px; padding : 5px; -width : 200px; - box-shadow : 0px 0px 2px rgba(0,0,0,0.2); + /* box-shadow : 0px 0px 2px rgba(0,0,0,0.2); */ } #notify img { @@ -190,7 +189,7 @@ a:hover { } .hl.active { - box-shadow : inset 0px 0px 3px 0px rgba(0,0,0,0.1); + /* box-shadow : inset 0px 0px 3px 0px rgba(0,0,0,0.1); */ } .hl.active div.hlTitle a { @@ -217,7 +216,7 @@ a:hover { .hl { border-width : 0px 0px 1px 0px; border-style : solid; - border-color : #c0c0c0; + border-color : #eee; } .hl.active { @@ -232,8 +231,8 @@ div.filterTestHolder { margin : 0px 0px 5px 0px; background-color : #ecf4ff; border-width : 1px; - border-radius : 4px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* border-radius : 4px; */ + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } @@ -274,9 +273,9 @@ div.notice, div.warning, div.error { font-size : 12px; border-style : solid; border-color : #ccc; - border-radius : 4px; + /* border-radius : 4px; */ border-width : 1px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } div.notice div.inner, div.warning div.inner, div.error div.inner { @@ -325,9 +324,7 @@ div.prefHelp { } div#headlines-toolbar { - border-width : 0px 0px 1px 0px; - background-color : #fcfcfc; - border-color : #c0c0c0; + border-width : 0px; font-size : 12px; font-family : "Segoe UI", Tahoma, sans-serif; color : #555; @@ -337,6 +334,7 @@ div#headlines-toolbar { height : 25px; line-height : 25px; padding-left : 4px; + background : #fafafa; } div#headlines-toolbar .dijitSelect { @@ -377,7 +375,7 @@ span.hlLabelRef { display : inline-block; vertical-align : middle; white-space: nowrap; - border-radius : 4px; + border-radius : 4px; } div.postHeader div.postDate { @@ -408,7 +406,7 @@ a.hlFeed { font-size : 9px; font-style : italic; font-weight : normal; - border-radius : 4px; + /* border-radius : 4px; */ display : inline-block; padding : 1px 2px 1px 2px; margin-bottom : 2px; @@ -431,8 +429,8 @@ div.tagCloudContainer { margin : 5px 0px 5px 0px; padding : 5px; text-align : center; - border-radius : 4px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* border-radius : 4px; */ + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } div.errorExplained { @@ -440,8 +438,8 @@ div.errorExplained { background-color : #ecf4ff; margin : 5px 0px 5px 0px; padding : 5px; - border-radius : 4px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* border-radius : 4px; */ + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } ul.feedErrorsList { @@ -452,8 +450,8 @@ ul.feedErrorsList { background-color : #ecf4ff; margin : 0px 0px 5px 0px; padding : 5px; - border-radius : 4px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* border-radius : 4px; */ + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } ul.feedErrorsList em { @@ -667,7 +665,7 @@ span.labelColorIndicator { background-color : #fff7d5; color : #063064; text-align : center; - box-shadow : 0px 0px 1px 0px rgba(0,0,0,0.1); + /* box-shadow : 0px 0px 1px 0px rgba(0,0,0,0.1); */ } div#cmdline { @@ -771,7 +769,7 @@ div.fatalError textarea { #content-wrap { padding : 0px; - border-width : 0px 0px 0px 1px; + border-width : 0px 0px 0px 0px; border-style : solid; border-color : #c0c0c0; margin : 0px; @@ -779,13 +777,12 @@ div.fatalError textarea { #feeds-holder { padding : 0px; - border-color : #c0c0c0; - border-left-width : 0px; - border-bottom-width : 0px; - border-top-width : 0px; + border-width : 0px 1px 0px 0px; + border-style : solid; + border-color : #eee; overflow : hidden; + background : #fafafa; box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); - background : #f9fbff; } #headlines-wrap-inner { @@ -800,7 +797,7 @@ div.fatalError textarea { border-style : solid; border-width : 0px; margin-top : 0px; - box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); + /* box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); */ } #headlines-toolbar_splitter, #toolbar_splitter { @@ -813,7 +810,13 @@ div.fatalError textarea { border-width : 0px; white-space: nowrap; font-size : 12px; - box-shadow : 0px 0px 2px rgba(0,0,0,0.1); + /* box-shadow : 0px 0px 2px rgba(0,0,0,0.1); */ +} + +#main-toolbar { + background : white; + border-width : 0px; + padding-left : 0px; } #header { @@ -837,7 +840,7 @@ div.fatalError textarea { #content-insert { padding : 0px; - border-color : #c0c0c0; + border-color : #eee; border-bottom-width : 0px; border-right-width : 0px; border-left-width : 0px; @@ -937,6 +940,7 @@ img.feedIcon, img.tinyFeedIcon { color : #555; } + ul#filterDlg_Matches, ul#filterDlg_Actions { max-height : 100px; overflow : auto; @@ -947,7 +951,7 @@ ul#filterDlg_Matches, ul#filterDlg_Actions { background-color : #ecf4ff; margin : 0px 0px 5px 0px; padding : 0px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } ul#filterDlg_Matches li, ul#filterDlg_Actions li { @@ -967,8 +971,8 @@ ul.helpKbList { background-color : #ecf4ff; margin : 0px 0px 5px 0px; padding : 5px; - border-radius : 4px; - box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); + /* border-radius : 4px; */ + /* box-shadow : inset 0px 0px 2px rgba(0,0,0,0.1); */ } ul.helpKbList span.hksequence { @@ -1057,14 +1061,14 @@ body#ttrssZoom div.postContent p { body#ttrssZoom div.postHeader { margin : 10px; border : 1px solid #ccc; - box-shadow : none; - border-radius : 4px; + /* box-shadow : none; */ + /* border-radius : 4px; */ } body#ttrssZoom div.postReply { border : 1px solid #ccc; - border-radius : 4px; - box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); + /* border-radius : 4px; + box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); */ background : white; } @@ -1088,10 +1092,6 @@ select.attachments { max-width : 120px; } -div.hl.active { - border-color : #88b0f0; -} - #selected_prompt { margin-right : 25px; } @@ -1157,7 +1157,7 @@ body#ttrssMain #feedTree { float : right; position : relative; line-height : 14px; - margin-right : 4px; + margin-right : 8px; margin-top : 3px; min-width : 23px; height : 14px; @@ -1178,6 +1178,41 @@ body#ttrssPrefs hr { font-size : 13px; } +body#ttrssMain #feedTree .dijitTreeRowSelected { + background : #ecf4ff; + /* box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); */ +} + +body#ttrssMain #feedTree .dijitTreeRowHover { + background : white; +} + +body#ttrssMain #feedTree .dijitTreeRowActive { + background-color : transparent; + background-image : none; + border-color : transparent; +} + +/* body#ttrssMain .dijitTreeRowHover, +body#ttrssPrefs .dijitTreeRowHover, +body#ttrssMain .dijitTreeRowActive, +body#ttrssPrefs .dijitTreeRowActive { + background-color : transparent; + background-image : none; + border-color : transparent; +} */ + +body#ttrssMain .dijitTreeRowSelected .dijitTreeLabel, +body#ttrssPrefs .dijitTreeRowSelected .dijitTreeLabel { + color : #4684ff; + font-weight : bold; +} + +body#ttrssMain .dijitTreeRowHover .dijitTreeLabel, +body#ttrssPrefs .dijitTreeRowHover .dijitTreeLabel { + color : #4684ff; +} + .dijitTreeRowSelected .dijitTreeLabel { text-shadow : 1px 1px 2px #fff; } @@ -1192,7 +1227,18 @@ span.highlight { color : #cc90cc; } +#feedTree .dijitTreeRow .dijitTreeExpando { + background-image: url("../images/treeExpandImages.png"); + position : relative; + top : -1px; +} + +#feedTree .dijitTreeRow .dijitTreeExpandoLeaf { + display : none; +} + div.enclosure_title { } + diff --git a/images/treeExpandImages.png b/images/treeExpandImages.png new file mode 100644 index 000000000..c92171ba5 Binary files /dev/null and b/images/treeExpandImages.png differ diff --git a/js/tt-rss.js b/js/tt-rss.js index 04aec0cca..97a70b434 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -550,9 +550,6 @@ function init_second_stage() { updateFeedList(); closeArticlePanel(); - _widescreen_mode = getInitParam("widescreen"); - switchPanelMode(_widescreen_mode); - if (parseInt(getCookie("ttrss_fh_width")) > 0) { dijit.byId("feeds-holder").domNode.setStyle( {width: getCookie("ttrss_fh_width") + "px" }); @@ -624,6 +621,9 @@ function init_second_stage() { hotkeys[1] = tmp; setInitParam("hotkeys", hotkeys); + _widescreen_mode = getInitParam("widescreen"); + switchPanelMode(_widescreen_mode); + console.log("second stage ok"); if (getInitParam("simple_update")) { @@ -1064,11 +1064,8 @@ function switchPanelMode(wide) { dijit.byId("content-insert").domNode.setStyle({width: '50%', height: 'auto', - borderLeftWidth: '1px', - borderLeftColor: '#c0c0c0', borderTopWidth: '0px' }); - $("headlines-toolbar").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").addClassName("wide"); @@ -1078,11 +1075,8 @@ function switchPanelMode(wide) { dijit.byId("content-insert").domNode.setStyle({width: 'auto', height: '50%', - borderLeftWidth: '0px', borderTopWidth: '1px'}); - $("headlines-toolbar").setStyle({ borderBottomWidth: '1px' }); - $("headlines-frame").setStyle({ borderBottomWidth: '1px' }); $("headlines-frame").removeClassName("wide"); -- cgit v1.2.3-54-g00ecf From d728015d48e3150a9aa39c9db88781adb179182b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 27 Jan 2014 19:48:16 +0400 Subject: minor css tweaks --- css/tt-rss.css | 12 +++++------- js/tt-rss.js | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'js/tt-rss.js') diff --git a/css/tt-rss.css b/css/tt-rss.css index c7592e54c..722ad44e2 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -334,7 +334,7 @@ div#headlines-toolbar { height : 25px; line-height : 25px; padding-left : 4px; - background : #fafafa; + background : white; } div#headlines-toolbar .dijitSelect { @@ -792,7 +792,7 @@ div.fatalError textarea { #headlines-frame { padding : 0px; - border-color : #c0c0c0; + border-color : #eee; border-style : solid; border-width : 0px; margin-top : 0px; @@ -840,9 +840,7 @@ div.fatalError textarea { #content-insert { padding : 0px; border-color : #eee; - border-bottom-width : 0px; - border-right-width : 0px; - border-left-width : 0px; + border-width : 0px; line-height: 20px; overflow : auto; } @@ -1178,12 +1176,12 @@ body#ttrssPrefs hr { } body#ttrssMain #feedTree .dijitTreeRowSelected { - background : #ecf4ff; + background : white; /* box-shadow : inset 0px 0px 3px rgba(0,0,0,0.1); */ } body#ttrssMain #feedTree .dijitTreeRowHover { - background : white; + background : #ecf4ff; } body#ttrssMain #feedTree .dijitTreeRowActive { diff --git a/js/tt-rss.js b/js/tt-rss.js index 97a70b434..bb23169ec 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -1075,7 +1075,7 @@ function switchPanelMode(wide) { dijit.byId("content-insert").domNode.setStyle({width: 'auto', height: '50%', - borderTopWidth: '1px'}); + borderTopWidth: '0px'}); $("headlines-frame").setStyle({ borderBottomWidth: '1px' }); $("headlines-frame").removeClassName("wide"); -- cgit v1.2.3-54-g00ecf From 2ffe7a3b14caeb55a6338d769255cafa6f67d3c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 11 Mar 2014 13:59:14 +0400 Subject: add a less intimidating error message when backend times out and/or fails to return valid JSON --- js/functions.js | 2 +- js/tt-rss.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/functions.js b/js/functions.js index 1ad15fcc6..93b037152 100644 --- a/js/functions.js +++ b/js/functions.js @@ -833,7 +833,7 @@ function quickAddFeed() { var reply = JSON.parse(transport.responseText); } catch (e) { Element.hide("feed_add_spinner"); - alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to browser console.")); + alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to the browser console.")); console.log('quickAddFeed, backend returned:' + transport.responseText); return; } diff --git a/js/tt-rss.js b/js/tt-rss.js index bb23169ec..3b7793553 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -987,7 +987,12 @@ function newVersionDlg() { function handle_rpc_json(transport, scheduled_call) { try { - var reply = JSON.parse(transport.responseText); + try { + var reply = JSON.parse(transport.responseText); + } catch (e) { + alert(__("Failed to parse server reply. This could be caused by a server or network timeout. Backend output was logged to the browser console.")); + console.log("handle_rpc_json, received: " + transport.responseText); + } if (reply) { -- cgit v1.2.3-54-g00ecf From 5c812c2ea4f8fb60ccceb7dbf9ec06ff9372c077 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 11 Mar 2014 19:09:33 +0400 Subject: Revert "add a less intimidating error message when backend times out and/or fails to return valid JSON" This reverts commit 2ffe7a3b14caeb55a6338d769255cafa6f67d3c6. --- js/functions.js | 2 +- js/tt-rss.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/functions.js b/js/functions.js index 93b037152..1ad15fcc6 100644 --- a/js/functions.js +++ b/js/functions.js @@ -833,7 +833,7 @@ function quickAddFeed() { var reply = JSON.parse(transport.responseText); } catch (e) { Element.hide("feed_add_spinner"); - alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to the browser console.")); + alert(__("Failed to parse output. This can indicate server timeout and/or network issues. Backend output was logged to browser console.")); console.log('quickAddFeed, backend returned:' + transport.responseText); return; } diff --git a/js/tt-rss.js b/js/tt-rss.js index 3b7793553..bb23169ec 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -987,12 +987,7 @@ function newVersionDlg() { function handle_rpc_json(transport, scheduled_call) { try { - try { - var reply = JSON.parse(transport.responseText); - } catch (e) { - alert(__("Failed to parse server reply. This could be caused by a server or network timeout. Backend output was logged to the browser console.")); - console.log("handle_rpc_json, received: " + transport.responseText); - } + var reply = JSON.parse(transport.responseText); if (reply) { -- cgit v1.2.3-54-g00ecf From df63125dd7797064f0bbd5f70267c8b5e1fb36c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 14 Mar 2014 14:05:32 +0400 Subject: handle_rpc_json: do not crash if net-alert is somehow unavailable --- js/tt-rss.js | 21 ++++++++++++++++----- js/viewfeed.js | 9 ++------- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index bb23169ec..a66411d11 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -989,6 +989,12 @@ function handle_rpc_json(transport, scheduled_call) { try { var reply = JSON.parse(transport.responseText); + var netalert_dijit = dijit.byId("net-alert"); + var netalert = false; + + if (netalert_dijit) + netalert = netalert_dijit.domNode; + if (reply) { var error = reply['error']; @@ -1035,16 +1041,21 @@ function handle_rpc_json(transport, scheduled_call) { if (runtime_info) parse_runtime_info(runtime_info); - Element.hide(dijit.byId("net-alert").domNode); + if (netalert) Element.hide(netalert); } else { - //notify_error("Error communicating with server."); - Element.show(dijit.byId("net-alert").domNode); + if (netalert) + Element.show(netalert); + else + notify_error("Communication problem with server."); } } catch (e) { - Element.show(dijit.byId("net-alert").domNode); - //notify_error("Error communicating with server."); + if (netalert) + Element.show(netalert); + else + notify_error("Communication problem with server."); + console.log(e); //exception_error("handle_rpc_json", e, transport); } diff --git a/js/viewfeed.js b/js/viewfeed.js index 8a07965fc..1a5f87d7c 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -194,14 +194,11 @@ function headlines_callback2(transport, offset, background, infscroll_req) { else request_counters(true); - } else if (transport.responseText) { + } else { console.error("Invalid object received: " + transport.responseText); dijit.byId("headlines-frame").attr('content', "
" + __('Could not update headlines (invalid object received - see error console for details)') + "
"); - } else { - //notify_error("Error communicating with server."); - Element.show(dijit.byId("net-alert").domNode); } _infscroll_request_sent = 0; @@ -318,13 +315,11 @@ function article_callback2(transport, id) { // return; // } - } else if (transport.responseText) { + } else { console.error("Invalid object received: " + transport.responseText); render_article("
" + __('Could not display article (invalid object received - see error console for details)') + "
"); - } else { - Element.show(dijit.byId("net-alert").domNode); } var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length -- cgit v1.2.3-54-g00ecf From 89018afa13887c46de4c8ef8189fc7b500cdac0f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 11 Aug 2014 15:39:14 +0400 Subject: assign stored content-insert height/width in switchPanelMode(); reset stored sizes on widescreen switch --- js/tt-rss.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index a66411d11..7d6f22f87 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -500,6 +500,10 @@ function init() { if (!isCdmMode()) { _widescreen_mode = !_widescreen_mode; + // reset stored sizes because geometry changed + setCookie("ttrss_ci_width", 0); + setCookie("ttrss_ci_height", 0); + switchPanelMode(_widescreen_mode); } }; @@ -555,17 +559,6 @@ function init_second_stage() { {width: getCookie("ttrss_fh_width") + "px" }); } - if (parseInt(getCookie("ttrss_ci_width")) > 0) { - if (_widescreen_mode) { - dijit.byId("content-insert").domNode.setStyle( - {width: getCookie("ttrss_ci_width") + "px" }); - - } else { - dijit.byId("content-insert").domNode.setStyle( - {height: getCookie("ttrss_ci_height") + "px" }); - } - } - dijit.byId("main").resize(); var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize', @@ -706,6 +699,10 @@ function quickMenuGo(opid) { if (!isCdmMode()) { _widescreen_mode = !_widescreen_mode; + // reset stored sizes because geometry changed + setCookie("ttrss_ci_width", 0); + setCookie("ttrss_ci_height", 0); + switchPanelMode(_widescreen_mode); } break; @@ -1077,6 +1074,11 @@ function switchPanelMode(wide) { height: 'auto', borderTopWidth: '0px' }); + if (parseInt(getCookie("ttrss_ci_width")) > 0) { + dijit.byId("content-insert").domNode.setStyle( + {width: getCookie("ttrss_ci_width") + "px" }); + } + $("headlines-frame").setStyle({ borderBottomWidth: '0px' }); $("headlines-frame").addClassName("wide"); @@ -1088,6 +1090,11 @@ function switchPanelMode(wide) { height: '50%', borderTopWidth: '0px'}); + if (parseInt(getCookie("ttrss_ci_height")) > 0) { + dijit.byId("content-insert").domNode.setStyle( + {height: getCookie("ttrss_ci_height") + "px" }); + } + $("headlines-frame").setStyle({ borderBottomWidth: '1px' }); $("headlines-frame").removeClassName("wide"); -- cgit v1.2.3-54-g00ecf From 38bc9dad228444fc38c2cef75f7edd5039477257 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 26 Aug 2014 18:11:32 +0400 Subject: mail plugin: use dijit.form.ComboBox to allow random email input instead of only predefined ones --- js/tt-rss.js | 1 + plugins/mail/init.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 7d6f22f87..c64145159 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -231,6 +231,7 @@ function init() { dojo.require("dijit.form.Select"); dojo.require("dijit.form.SimpleTextarea"); dojo.require("dijit.form.TextBox"); + dojo.require("dijit.form.ComboBox"); dojo.require("dijit.form.ValidationTextBox"); dojo.require("dijit.InlineEditBox"); dojo.require("dijit.layout.AccordionContainer"); diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 4b1989f5f..e1da315c3 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -145,7 +145,7 @@ class Mail extends Plugin { style=\"width : 30em;\" name=\"destination\" id=\"emailArticleDlg_destination\">"; */ - print_select("destination", "", $addresslist, 'style="width: 30em" dojoType="dijit.form.FilteringSelect"'); + print_select("destination", "", $addresslist, 'style="width: 30em" dojoType="dijit.form.ComboBox"'); /* print "
"; */ -- cgit v1.2.3-54-g00ecf From 98cbae8dfa9e9d30fe2e843c7058d99671a830ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Oct 2014 10:25:16 +0400 Subject: hotkey actions: toggle_expand, collapse_article: check if element exists before acting on it (closes #815) --- js/tt-rss.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index c64145159..84f2e67b1 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -302,21 +302,27 @@ function init() { hotkey_actions["collapse_article"] = function() { var id = getActiveArticleId(); var elem = $("CICD-"+id); - if(elem.visible()) { - cdmCollapseArticle(null, id); - } - else { - cdmExpandArticle(id); + + if (elem) { + if (elem.visible()) { + cdmCollapseArticle(null, id); + } + else { + cdmExpandArticle(id); + } } }; hotkey_actions["toggle_expand"] = function() { var id = getActiveArticleId(); var elem = $("CICD-"+id); - if(elem.visible()) { - cdmCollapseArticle(null, id, false); - } - else { - cdmExpandArticle(id); + + if (elem) { + if (elem.visible()) { + cdmCollapseArticle(null, id, false); + } + else { + cdmExpandArticle(id); + } } }; hotkey_actions["search_dialog"] = function() { -- cgit v1.2.3-54-g00ecf