From 44cd77b642df47aef617d74f0571d4354d4be67d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 09:00:21 +0400 Subject: format_inline_player: add a link to original audio file --- include/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 1feedcbf0..99c621f5f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2870,6 +2870,8 @@ $entry = ""; + $url = htmlspecialchars($url); + if (strpos($ctype, "audio/") === 0) { if ($_SESSION["hasAudio"] && (strpos($ctype, "ogg") !== false || @@ -2896,7 +2898,8 @@ "; } - if ($entry) $entry .= " " . basename($url); + if ($entry) $entry .= "  " . basename($url) . ""; return $entry; -- cgit v1.2.3-54-g00ecf From 911845b5e7f6c3ebc59f6fdc3d800414fcb45c8d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 09:14:41 +0400 Subject: geturl: remove logging --- include/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 99c621f5f..e66ec0737 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4030,8 +4030,8 @@ $oline=''; foreach($status as $key=>$eline){$oline.='['.$key.']'.$eline.' ';} $line =$oline." \r\n ".$url."\r\n-----------------\r\n"; - $handle = @fopen('./curl.error.log', 'a'); - fwrite($handle, $line); +# $handle = @fopen('./curl.error.log', 'a'); +# fwrite($handle, $line); return FALSE; } return $url; -- cgit v1.2.3-54-g00ecf From b799dc8b0d540d671a7f9c4f1202d428692367c9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 09:15:59 +0400 Subject: only use geturl() if in safe mode --- include/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index e66ec0737..3b73ed5f7 100644 --- a/include/functions.php +++ b/include/functions.php @@ -286,8 +286,12 @@ global $fetch_last_error; if (function_exists('curl_init') && !ini_get("open_basedir")) { - //$ch = curl_init($url); - $ch = curl_init(geturl($url)); + + if (ini_get("safe_mode")) { + $ch = curl_init(geturl($url)); + } else { + $ch = curl_init($url); + } curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : 15); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : 45); -- cgit v1.2.3-54-g00ecf From 414191d4280d6884b575a82bc5b5452c6ddcb62b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Mar 2013 10:21:14 +0400 Subject: make a separate headline button to collapse current article in unexpanded cdm mode; modify a q hotkey to collapse article in unexpanded mode and dismiss article in expanded mode --- classes/feeds.php | 5 ++++- images/collapse.png | Bin 0 -> 186 bytes include/functions.php | 2 +- js/tt-rss.js | 10 +++++++++- js/viewfeed.js | 44 ++++++++++++++++++++++++++++++++++++++++++-- tt-rss.css | 4 ++++ 6 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 images/collapse.png (limited to 'include/functions.php') diff --git a/classes/feeds.php b/classes/feeds.php index 297cad300..0d5d8c8a0 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -548,6 +548,10 @@ class Feeds extends Handler_Protected { $reply['content'] .= $labels_str; + $reply['content'] .= ""; + if (!$expand_cdm) $content_hidden = "style=\"display : none\""; else @@ -555,7 +559,6 @@ class Feeds extends Handler_Protected { $reply['content'] .= " - $content_preview"; - $reply['content'] .= ""; if (!get_pref($this->link, 'VFEED_GROUP_BY_FEED')) { diff --git a/images/collapse.png b/images/collapse.png new file mode 100644 index 000000000..5adbd5e1c Binary files /dev/null and b/images/collapse.png differ diff --git a/include/functions.php b/include/functions.php index 3b73ed5f7..62699e175 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1889,7 +1889,7 @@ "article_scroll_up" => __("Scroll up"), "select_article_cursor" => __("Select article under cursor"), "email_article" => __("Email article"), - "close_article" => __("Close article"), + "close_article" => __("Close/collapse article"), "toggle_widescreen" => __("Toggle widescreen mode")), __("Article selection") => array( "select_all" => __("Select all articles"), diff --git a/js/tt-rss.js b/js/tt-rss.js index e9bc9d412..bced92674 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -669,7 +669,15 @@ function hotkey_handler(e) { scrollArticle(-ctr.offsetHeight/3); return false; case "close_article": - closeArticlePanel(); + if (isCdmMode()) { + if (!getInitParam("cdm_expanded")) { + cdmCollapseArticle(false, getActiveArticleId()); + } else { + dismissArticle(getActiveArticleId()); + } + } else { + closeArticlePanel(); + } return false; case "email_article": if (typeof emailArticle != "undefined") { diff --git a/js/viewfeed.js b/js/viewfeed.js index 9a16befff..584fff574 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1312,6 +1312,35 @@ function catchupRelativeToArticle(below, id) { } } +function cdmCollapseArticle(event, id) { + try { + var row = $("RROW-" + id); + var elem = $("CICD-" + id); + + if (elem && row) { + row.removeClassName("Selected"); + + var collapse = $$("div#RROW-" + id + + " span[class='collapseBtn']")[0]; + + Element.hide(elem); + Element.show("CEXC-" + id); + Element.hide(collapse); + + markHeadline(id, false); + + if (id == getActiveArticleId()) { + setActiveArticleId(0); + } + + if (event) Event.stop(event); + } + + } catch (e) { + exception_error("cdmCollapseArticle", e); + } +} + function cdmExpandArticle(id) { try { @@ -1327,17 +1356,25 @@ function cdmExpandArticle(id) { var old_offset = $("RROW-" + id).offsetTop; if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) { + var collapse = $$("div#RROW-" + getActiveArticleId() + + " span[class='collapseBtn']")[0]; + Element.hide(elem); Element.show("CEXC-" + getActiveArticleId()); + Element.hide(collapse); } setActiveArticleId(id); elem = $("CICD-" + id); + var collapse = $$("div#RROW-" + id + + " span[class='collapseBtn']")[0]; + if (!Element.visible(elem)) { Element.show(elem); Element.hide("CEXC-" + id); + Element.show(collapse); } /* var new_offset = $("RROW-" + id).offsetTop; @@ -1514,6 +1551,7 @@ function cdmClicked(event, id) { if (!event.ctrlKey) { if (!getInitParam("cdm_expanded")) { + if (event) Event.stop(event); return cdmExpandArticle(id); } else { @@ -1609,13 +1647,15 @@ function isCdmMode() { return getInitParam("combined_display_mode"); } -function markHeadline(id) { +function markHeadline(id, marked) { + if (marked == undefined) marked = true; + var row = $("RROW-" + id); if (row) { var check = dijit.byId("RCHK-" + id); if (check) { - check.attr("checked", true); + check.attr("checked", marked); } row.addClassName("Selected"); diff --git a/tt-rss.css b/tt-rss.css index 72e73e0d3..545d8c8d1 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1189,3 +1189,7 @@ ul.helpKbList h2 { .dijitTreeNode .loadingNode { margin-left : 3px; } + +span.collapseBtn { + cursor : pointer; +} -- cgit v1.2.3-54-g00ecf