From 76a7ae56d3eb47a28b97879f1ad7a88ed7e7706d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 14:16:34 +0400 Subject: [PATCH 1/5] add plugin based on google reader css at http://tt-rss.org/forum/viewtopic.php?f=22&t=1287&start=15#p5956 --- plugins/googlereadertheme/init.css | 73 ++++++++++++++++++++++++++++++ plugins/googlereadertheme/init.php | 25 ++++++++++ 2 files changed, 98 insertions(+) create mode 100644 plugins/googlereadertheme/init.css create mode 100644 plugins/googlereadertheme/init.php diff --git a/plugins/googlereadertheme/init.css b/plugins/googlereadertheme/init.css new file mode 100644 index 000000000..8d5c8cefe --- /dev/null +++ b/plugins/googlereadertheme/init.css @@ -0,0 +1,73 @@ +/* fix dijit */ +:focus { + outline: none; +} +input[type="search"] { + -webkit-appearance: none; +} +.claro .dijitToolbar .dijitButton .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboButton .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboBox .dijitButtonNode { + -moz-transition: background-color, border-color, color; + -webkit-transition-property: background-color, border-color, color; + transition: background-color, border-color, color; +} + + +/* some style */ +body#ttrssMain, +a, +.titleWrap .title { + color: #444; +} +a:hover, +.Unread .titleWrap .title, +.Selected .titleWrap .title, +html div.cdmContent a { + color: #15c; +} +#feeds-holder, +#content-wrap, +#headlines-frame { + border: none; +} +#ttrssMain #headlines-toolbar, +#ttrssMain .dijitToolbar, +#ttrssMain .cdmHeader { + background: #fff; + border-color: transparent; +} +#ttrssMain #headlines-toolbar { + border-color: #ebebeb; +} +#ttrssMain .cdm { + margin: 5px 25px 10px 5px; + border: 1px solid #ddd !important; + box-shadow: 0 0 4px rgba(0,0,0,.1); + background: #fff !important; +} +#ttrssMain .cdm.Selected { + border-left-color: #4d90f0 !important; + background: #fff !important; +} +#ttrssMain .cdmFeedTitle { + border-color: #ebebeb; + background: #fff; + font-size: 1.2em; + font-weight: bold; +} +#headlines-frame .cdmFooter { + border-top: 1px solid #ebebeb; + background: #fafafa; +} + +.titleWrap .title { + font-size: 1.5em; + font-weight: bold; +} +div.cdmHeader span.hlFeed { + padding-top: .5em; +} + diff --git a/plugins/googlereadertheme/init.php b/plugins/googlereadertheme/init.php new file mode 100644 index 000000000..76e6fa421 --- /dev/null +++ b/plugins/googlereadertheme/init.php @@ -0,0 +1,25 @@ +link = $host->get_link(); + $this->host = $host; + + // force-enable combined mode + set_pref($this->link, "COMBINED_DISPLAY_MODE", true); + } + + function get_css() { + return file_get_contents(dirname(__FILE__) . "/init.css"); + } +} +?> From 08dfc22391eab9934cde1f747240d9ff5bc50b41 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 15:42:28 +0400 Subject: [PATCH 2/5] in combined mode, when viewing vfeeds relative urls are rewritten incorrectly (fixes #586) --- classes/feeds.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index b5010a05f..d6cd2a255 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -388,6 +388,8 @@ class Feeds extends Handler_Protected { $feed_icon_img = "\"\""; } + $entry_site_url = $line["site_url"]; + if (!get_pref($this->link, 'COMBINED_DISPLAY_MODE')) { if (get_pref($this->link, 'VFEED_GROUP_BY_FEED')) { @@ -474,7 +476,7 @@ class Feeds extends Handler_Protected { unset($line["tag_cache"]); $line["content"] = sanitize($this->link, $line["content_preview"], - false, false, $feed_site_url); + false, false, $entry_site_url); foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_CDM) as $p) { $line = $p->hook_render_article_cdm($line); @@ -614,8 +616,6 @@ class Feeds extends Handler_Protected { } } - $feed_site_url = $line["site_url"]; - $reply['content'] .= ""; $reply['content'] .= $line["content"]; $reply['content'] .= ""; From 11191fdba1e7e986b8c144394943e44ccac053f0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 16:15:32 +0400 Subject: [PATCH 3/5] googlereadertheme: check for UID being present --- plugins/googlereadertheme/init.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/googlereadertheme/init.php b/plugins/googlereadertheme/init.php index 76e6fa421..4ee4a4ba3 100644 --- a/plugins/googlereadertheme/init.php +++ b/plugins/googlereadertheme/init.php @@ -14,8 +14,10 @@ class GoogleReaderTheme extends Plugin { $this->link = $host->get_link(); $this->host = $host; - // force-enable combined mode - set_pref($this->link, "COMBINED_DISPLAY_MODE", true); + if ($_SESSION["uid"]) { + // force-enable combined mode + set_pref($this->link, "COMBINED_DISPLAY_MODE", true, $_SESSION["uid"]); + } } function get_css() { From 478d406767e42b56a140f229fd8676c03ba5afe1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 16:44:23 +0400 Subject: [PATCH 4/5] make sure reset password notification does not hide automatically; add manual close link to persistent notifications (closes #569) --- js/functions.js | 5 +++++ js/prefs.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/functions.js b/js/functions.js index e00690c1c..be78294df 100644 --- a/js/functions.js +++ b/js/functions.js @@ -212,6 +212,11 @@ function notify_real(msg, no_hide, n_type) { // msg = " " + msg; + if (no_hide) { + msg += " (X)"; + } + + nb.innerHTML = msg; if (!no_hide) { diff --git a/js/prefs.js b/js/prefs.js index 676fb914a..e6257e1fb 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -547,7 +547,7 @@ function resetSelectedUserPass() { new Ajax.Request("backend.php", { parameters: query, onComplete: function(transport) { - notify_info(transport.responseText); + notify_info(transport.responseText, true); } }); } From e9f42579a38a03c9cdc454a712cb0ab68069226d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 18 Mar 2013 17:53:53 +0400 Subject: [PATCH 5/5] fix boolean wrapped as a string literal passed when saving user (closes #568) --- classes/pref/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pref/users.php b/classes/pref/users.php index 0d7ca3c6e..d36ed29f7 100644 --- a/classes/pref/users.php +++ b/classes/pref/users.php @@ -214,7 +214,7 @@ class Pref_Users extends Handler_Protected { } db_query($this->link, "UPDATE ttrss_users SET $pass_query_part login = '$login', - access_level = '$access_level', email = '$email', otp_enabled = 'false' + access_level = '$access_level', email = '$email', otp_enabled = false WHERE id = '$uid'"); }