Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Richard Beales 2013-03-21 07:04:54 +00:00
commit f1fdfbea43
23 changed files with 95 additions and 95 deletions

View File

@ -194,11 +194,10 @@ class API extends Handler {
$search = db_escape_string($_REQUEST["search"]); $search = db_escape_string($_REQUEST["search"]);
$search_mode = db_escape_string($_REQUEST["search_mode"]); $search_mode = db_escape_string($_REQUEST["search_mode"]);
$match_on = db_escape_string($_REQUEST["match_on"]);
$headlines = $this->api_get_headlines($this->link, $feed_id, $limit, $offset, $headlines = $this->api_get_headlines($this->link, $feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, false, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false,
$include_attachments, $since_id, $search, $search_mode, $match_on, $include_attachments, $since_id, $search, $search_mode,
$include_nested, $sanitize_content); $include_nested, $sanitize_content);
print $this->wrap(self::STATUS_OK, $headlines); print $this->wrap(self::STATUS_OK, $headlines);
@ -584,11 +583,11 @@ class API extends Handler {
static function api_get_headlines($link, $feed_id, $limit, $offset, static function api_get_headlines($link, $feed_id, $limit, $offset,
$filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
$include_attachments, $since_id, $include_attachments, $since_id,
$search = "", $search_mode = "", $match_on = "", $search = "", $search_mode = "",
$include_nested = false, $sanitize_content = true) { $include_nested = false, $sanitize_content = true) {
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit, $qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
$view_mode, $is_cat, $search, $search_mode, $match_on, $view_mode, $is_cat, $search, $search_mode,
$order, $offset, 0, false, $since_id, $include_nested); $order, $offset, 0, false, $since_id, $include_nested);
$result = $qfh_ret[0]; $result = $qfh_ret[0];

View File

@ -236,8 +236,7 @@ class Dlg extends Handler_Protected {
print "<div style='float : right'> print "<div style='float : right'>
<img style='display : none' <img style='display : none'
id='feed_add_spinner' src='". id='feed_add_spinner' src='images/indicator_white.gif'></div>";
theme_image($this->link, 'images/indicator_white.gif')."'></div>";
print "<input style=\"font-size : 16px; width : 20em;\" print "<input style=\"font-size : 16px; width : 20em;\"
placeHolder=\"".__("Feed or site URL")."\" placeHolder=\"".__("Feed or site URL")."\"
@ -311,8 +310,7 @@ class Dlg extends Handler_Protected {
print "<div dojoType=\"dijit.Toolbar\"> print "<div dojoType=\"dijit.Toolbar\">
<div style='float : right'> <div style='float : right'>
<img style='display : none' <img style='display : none'
id='feed_browser_spinner' src='". id='feed_browser_spinner' src='images/indicator_white.gif'>
theme_image($this->link, 'images/indicator_white.gif')."'>
<input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\" <input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\"
onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\"> onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\">
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button> <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button>

View File

@ -22,7 +22,7 @@ class Feeds extends Handler_Protected {
} }
private function format_headline_subtoolbar($feed_site_url, $feed_title, private function format_headline_subtoolbar($feed_site_url, $feed_title,
$feed_id, $is_cat, $search, $match_on, $feed_id, $is_cat, $search,
$search_mode, $view_mode, $error) { $search_mode, $view_mode, $error) {
$page_prev_link = "viewFeedGoPage(-1)"; $page_prev_link = "viewFeedGoPage(-1)";
@ -50,7 +50,7 @@ class Feeds extends Handler_Protected {
if ($is_cat) $cat_q = "&is_cat=$is_cat"; if ($is_cat) $cat_q = "&is_cat=$is_cat";
if ($search) { if ($search) {
$search_q = "&q=$search&m=$match_on&smode=$search_mode"; $search_q = "&q=$search&smode=$search_mode";
} else { } else {
$search_q = ""; $search_q = "";
} }
@ -209,7 +209,6 @@ class Feeds extends Handler_Protected {
} }
@$search_mode = db_escape_string($_REQUEST["search_mode"]); @$search_mode = db_escape_string($_REQUEST["search_mode"]);
$match_on = "both"; // deprecated, TODO: remove
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info); if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H0", $timing_info);
@ -219,7 +218,7 @@ class Feeds extends Handler_Protected {
} }
// error_log("search_mode: " . $search_mode); // error_log("search_mode: " . $search_mode);
$qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $cat_view, $qfh_ret = queryFeedHeadlines($this->link, $feed, $limit, $view_mode, $cat_view,
$search, $search_mode, $match_on, $override_order, $offset, 0, $search, $search_mode, $override_order, $offset, 0,
false, 0, $include_children); false, 0, $include_children);
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info); if ($_REQUEST["debug"]) $timing_info = print_checkpoint("H1", $timing_info);
@ -233,7 +232,7 @@ class Feeds extends Handler_Protected {
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url, $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
$feed_title, $feed_title,
$feed, $cat_view, $search, $match_on, $search_mode, $view_mode, $feed, $cat_view, $search, $search_mode, $view_mode,
$last_error); $last_error);
$headlines_count = db_num_rows($result); $headlines_count = db_num_rows($result);
@ -321,24 +320,22 @@ class Feeds extends Handler_Protected {
if ($line["marked"] == "t" || $line["marked"] == "1") { if ($line["marked"] == "t" || $line["marked"] == "1") {
$marked_pic = "<img id=\"FMPIC-$id\" $marked_pic = "<img id=\"FMPIC-$id\"
src=\"".theme_image($this->link, 'images/mark_set.svg')."\" src=\"images/mark_set.svg\"
class=\"markedPic\" alt=\"Unstar article\" class=\"markedPic\" alt=\"Unstar article\"
onclick='javascript:toggleMark($id)'>"; onclick='javascript:toggleMark($id)'>";
} else { } else {
$marked_pic = "<img id=\"FMPIC-$id\" $marked_pic = "<img id=\"FMPIC-$id\"
src=\"".theme_image($this->link, 'images/mark_unset.svg')."\" src=\"images/mark_unset.svg\"
class=\"markedPic\" alt=\"Star article\" class=\"markedPic\" alt=\"Star article\"
onclick='javascript:toggleMark($id)'>"; onclick='javascript:toggleMark($id)'>";
} }
if ($line["published"] == "t" || $line["published"] == "1") { if ($line["published"] == "t" || $line["published"] == "1") {
$published_pic = "<img id=\"FPPIC-$id\" src=\"".theme_image($this->link, $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_set.svg\"
'images/pub_set.svg')."\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Unpublish article\" onclick='javascript:togglePub($id)'>"; alt=\"Unpublish article\" onclick='javascript:togglePub($id)'>";
} else { } else {
$published_pic = "<img id=\"FPPIC-$id\" src=\"".theme_image($this->link, $published_pic = "<img id=\"FPPIC-$id\" src=\"images/pub_unset.svg\"
'images/pub_unset.svg')."\"
class=\"markedPic\" class=\"markedPic\"
alt=\"Publish article\" onclick='javascript:togglePub($id)'>"; alt=\"Publish article\" onclick='javascript:togglePub($id)'>";
} }
@ -363,8 +360,7 @@ class Feeds extends Handler_Protected {
$score = $line["score"]; $score = $line["score"];
$score_pic = theme_image($this->link, $score_pic = "images/" . get_score_pic($score);
"images/" . get_score_pic($score));
/* $score_title = __("(Click to change)"); /* $score_title = __("(Click to change)");
$score_pic = "<img class='hlScorePic' src=\"images/$score_pic\" $score_pic = "<img class='hlScorePic' src=\"images/$score_pic\"
@ -628,14 +624,14 @@ class Feeds extends Handler_Protected {
$reply['content'] .= "<span id=\"CWRAP-$id\">"; $reply['content'] .= "<span id=\"CWRAP-$id\">";
if (!$expand_cdm) { // if (!$expand_cdm) {
$reply['content'] .= "<span id=\"CENCW-$id\">"; $reply['content'] .= "<span id=\"CENCW-$id\" style=\"display : none\">";
$reply['content'] .= htmlspecialchars($line["content"]); $reply['content'] .= htmlspecialchars($line["content"]);
$reply['content'] .= "</span."; $reply['content'] .= "</span.";
} else { // } else {
$reply['content'] .= $line["content"]; // $reply['content'] .= $line["content"];
} // }
$reply['content'] .= "</span>"; $reply['content'] .= "</span>";
@ -650,8 +646,7 @@ class Feeds extends Handler_Protected {
$tags_str = format_tags_string($line["tags"], $id); $tags_str = format_tags_string($line["tags"], $id);
$reply['content'] .= "<img src='".theme_image($this->link, $reply['content'] .= "<img src='images/tag.png' alt='Tags' title='Tags'>
'images/tag.png')."' alt='Tags' title='Tags'>
<span id=\"ATSTR-$id\">$tags_str</span> <span id=\"ATSTR-$id\">$tags_str</span>
<a title=\"".__('Edit tags for this article')."\" <a title=\"".__('Edit tags for this article')."\"
href=\"#\" onclick=\"editArticleTags($id, $feed_id, true)\">(+)</a>"; href=\"#\" onclick=\"editArticleTags($id, $feed_id, true)\">(+)</a>";

View File

@ -2,7 +2,7 @@
class Handler_Public extends Handler { class Handler_Public extends Handler {
private function generate_syndicated_feed($owner_uid, $feed, $is_cat, private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
$limit, $offset, $search, $search_mode, $match_on, $limit, $offset, $search, $search_mode,
$view_mode = false, $format = 'atom') { $view_mode = false, $format = 'atom') {
require_once "lib/MiniTemplator.class.php"; require_once "lib/MiniTemplator.class.php";
@ -25,7 +25,7 @@ class Handler_Public extends Handler {
$qfh_ret = queryFeedHeadlines($this->link, $feed, $qfh_ret = queryFeedHeadlines($this->link, $feed,
$limit, $view_mode, $is_cat, $search, $search_mode, $limit, $view_mode, $is_cat, $search, $search_mode,
$match_on, "$date_sort_field DESC", $offset, $owner_uid, "$date_sort_field DESC", $offset, $owner_uid,
false, 0, false, true); false, 0, false, true);
$result = $qfh_ret[0]; $result = $qfh_ret[0];
@ -314,7 +314,6 @@ class Handler_Public extends Handler {
$offset = (int)db_escape_string($_REQUEST["offset"]); $offset = (int)db_escape_string($_REQUEST["offset"]);
$search = db_escape_string($_REQUEST["q"]); $search = db_escape_string($_REQUEST["q"]);
$match_on = db_escape_string($_REQUEST["m"]);
$search_mode = db_escape_string($_REQUEST["smode"]); $search_mode = db_escape_string($_REQUEST["smode"]);
$view_mode = db_escape_string($_REQUEST["view-mode"]); $view_mode = db_escape_string($_REQUEST["view-mode"]);
@ -338,7 +337,7 @@ class Handler_Public extends Handler {
if ($owner_id) { if ($owner_id) {
$this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit, $this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
$offset, $search, $search_mode, $match_on, $view_mode, $format); $offset, $search, $search_mode, $view_mode, $format);
} else { } else {
header('HTTP/1.1 403 Forbidden'); header('HTTP/1.1 403 Forbidden');
} }

View File

@ -47,7 +47,7 @@ class Pref_Filters extends Handler_Protected {
$feed_title = getFeedTitle($this->link, $feed); $feed_title = getFeedTitle($this->link, $feed);
$qfh_ret = queryFeedHeadlines($this->link, -4, 30, "", false, false, false, $qfh_ret = queryFeedHeadlines($this->link, -4, 30, "", false, false, false,
false, "date_entered DESC", 0, $_SESSION["uid"], $filter); "date_entered DESC", 0, $_SESSION["uid"], $filter);
$result = $qfh_ret[0]; $result = $qfh_ret[0];
@ -370,9 +370,9 @@ class Pref_Filters extends Handler_Protected {
$result = db_query($this->link, "SELECT description FROM ttrss_filter_types $result = db_query($this->link, "SELECT description FROM ttrss_filter_types
WHERE id = ".(int)$rule["filter_type"]); WHERE id = ".(int)$rule["filter_type"]);
$match_on = db_fetch_result($result, 0, "description"); $filter_type = db_fetch_result($result, 0, "description");
return T_sprintf("%s on %s in %s", strip_tags($rule["reg_exp"]), $match_on, $feed); return T_sprintf("%s on %s in %s", strip_tags($rule["reg_exp"]), $filter_type, $feed);
} }
function printRuleName() { function printRuleName() {

View File

@ -663,7 +663,7 @@ class RPC extends Handler_Protected {
score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]); score = '$score' WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
print json_encode(array("id" => $id, print json_encode(array("id" => $id,
"score_pic" => theme_image($link, get_score_pic($score)))); "score_pic" => get_score_pic($score)));
} }
function setpanelmode() { function setpanelmode() {

View File

@ -786,11 +786,6 @@
} }
} }
// Deprecated, TODO: remove
function theme_image($link, $filename) {
return $filename;
}
function convert_timestamp($timestamp, $source_tz, $dest_tz) { function convert_timestamp($timestamp, $source_tz, $dest_tz) {
try { try {
@ -1825,10 +1820,10 @@
function make_init_params($link) { function make_init_params($link) {
$params = array(); $params = array();
$params["sign_progress"] = theme_image($link, "images/indicator_white.gif"); $params["sign_progress"] = "images/indicator_white.gif";
$params["sign_progress_tiny"] = theme_image($link, "images/indicator_tiny.gif"); $params["sign_progress_tiny"] = "images/indicator_tiny.gif";
$params["sign_excl"] = theme_image($link, "images/sign_excl.svg"); $params["sign_excl"] = "images/sign_excl.svg";
$params["sign_info"] = theme_image($link, "images/sign_info.svg"); $params["sign_info"] = "images/sign_info.svg";
foreach (array("ON_CATCHUP_SHOW_NEXT_FEED", "HIDE_READ_FEEDS", foreach (array("ON_CATCHUP_SHOW_NEXT_FEED", "HIDE_READ_FEEDS",
"ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP", "ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP",
@ -2065,7 +2060,7 @@
return $data; return $data;
} }
function search_to_sql($link, $search, $match_on) { function search_to_sql($link, $search) {
$search_query_part = ""; $search_query_part = "";
@ -2112,13 +2107,9 @@
//$k = date("Y-m-d", strtotime(substr($k, 1))); //$k = date("Y-m-d", strtotime(substr($k, 1)));
array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')"); array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
} else if ($match_on == "both") { } else {
array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");
} else if ($match_on == "title") {
array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%'))");
} else if ($match_on == "content") {
array_push($query_keywords, "(UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");
} }
} }
@ -2155,7 +2146,7 @@
return $rv; return $rv;
} }
function queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $match_on, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) { function queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false, $ignore_vfeed_group = false) {
if (!$owner_uid) $owner_uid = $_SESSION["uid"]; if (!$owner_uid) $owner_uid = $_SESSION["uid"];
@ -2172,7 +2163,7 @@
$search_query_part = "ref_id = -1 AND "; $search_query_part = "ref_id = -1 AND ";
} else { } else {
$search_query_part = search_to_sql($link, $search, $match_on); $search_query_part = search_to_sql($link, $search);
$search_query_part .= " AND "; $search_query_part .= " AND ";
} }
@ -2634,7 +2625,8 @@
$entries = $xpath->query('//iframe'); $entries = $xpath->query('//iframe');
foreach ($entries as $entry) { foreach ($entries as $entry) {
$entry->setAttribute('sandbox', true); $entry->setAttribute('sandbox', 'allow-scripts');
} }
global $pluginhost; global $pluginhost;
@ -2656,7 +2648,7 @@
$allowed_elements = array('a', 'address', 'audio', 'article', $allowed_elements = array('a', 'address', 'audio', 'article',
'b', 'big', 'blockquote', 'body', 'br', 'cite', 'b', 'big', 'blockquote', 'body', 'br', 'cite',
'code', 'dd', 'del', 'details', 'div', 'dl', 'code', 'dd', 'del', 'details', 'div', 'dl', 'font',
'dt', 'em', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'dt', 'em', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'header', 'html', 'i', 'img', 'ins', 'kbd', 'header', 'html', 'i', 'img', 'ins', 'kbd',
'li', 'nav', 'ol', 'p', 'pre', 'q', 's','small', 'li', 'nav', 'ol', 'p', 'pre', 'q', 's','small',
@ -2838,19 +2830,19 @@
function format_warning($msg, $id = "") { function format_warning($msg, $id = "") {
global $link; global $link;
return "<div class=\"warning\" id=\"$id\"> return "<div class=\"warning\" id=\"$id\">
<img src=\"".theme_image($link, "images/sign_excl.svg")."\">$msg</div>"; <img src=\"images/sign_excl.svg\">$msg</div>";
} }
function format_notice($msg, $id = "") { function format_notice($msg, $id = "") {
global $link; global $link;
return "<div class=\"notice\" id=\"$id\"> return "<div class=\"notice\" id=\"$id\">
<img src=\"".theme_image($link, "images/sign_info.svg")."\">$msg</div>"; <img src=\"images/sign_info.svg\">$msg</div>";
} }
function format_error($msg, $id = "") { function format_error($msg, $id = "") {
global $link; global $link;
return "<div class=\"error\" id=\"$id\"> return "<div class=\"error\" id=\"$id\">
<img src=\"".theme_image($link, "images/sign_excl.svg")."\">$msg</div>"; <img src=\"images/sign_excl.svg\">$msg</div>";
} }
function print_notice($msg) { function print_notice($msg) {
@ -3039,7 +3031,7 @@
if (!$entry_comments) $entry_comments = "&nbsp;"; # placeholder if (!$entry_comments) $entry_comments = "&nbsp;"; # placeholder
$rv['content'] .= "<div class='postTags' style='float : right'> $rv['content'] .= "<div class='postTags' style='float : right'>
<img src='".theme_image($link, 'images/tag.png')."' <img src='images/tag.png'
class='tagsPic' alt='Tags' title='Tags'>&nbsp;"; class='tagsPic' alt='Tags' title='Tags'>&nbsp;";
if (!$zoom_mode) { if (!$zoom_mode) {

View File

@ -128,11 +128,11 @@
<div id="header"> <div id="header">
<img id="net-alert" style="display : none" <img id="net-alert" style="display : none"
title="<?php echo __("Communication problem with server.") ?>" title="<?php echo __("Communication problem with server.") ?>"
src="<?php echo theme_image($link, 'images/alert.png') ?>"/> src="images/alert.png"/>
<img id="newVersionIcon" style="display:none" onclick="newVersionDlg()" <img id="newVersionIcon" style="display:none" onclick="newVersionDlg()"
width="13" height="13" width="13" height="13"
src="<?php echo theme_image($link, 'images/new_version.png') ?>" src="images/new_version.png"
title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>"
alt="new_version_icon"/> alt="new_version_icon"/>
</div> </div>
@ -185,7 +185,8 @@
<option value="score"><?php echo __('Score') ?></option> <option value="score"><?php echo __('Score') ?></option>
</select> </select>
<button dojoType="dijit.form.Button" name="update" <!-- deprecated -->
<button dojoType="dijit.form.Button" name="update" style="display : none"
onclick="viewCurrentFeed()"> onclick="viewCurrentFeed()">
<?php echo __('Update') ?></button> <?php echo __('Update') ?></button>
@ -200,12 +201,12 @@
<button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true" <button id="net-alert" dojoType="dijit.form.Button" style="display : none" disabled="true"
title="<?php echo __("Communication problem with server.") ?>"> title="<?php echo __("Communication problem with server.") ?>">
<img <img
src="<?php echo theme_image($link, 'images/alert.png') ?>" /> src="images/alert.png" />
</button> </button>
<button id="newVersionIcon" dojoType="dijit.form.Button" style="display : none"> <button id="newVersionIcon" dojoType="dijit.form.Button" style="display : none">
<img onclick="newVersionDlg()" <img onclick="newVersionDlg()"
src="<?php echo theme_image($link, 'images/new_version.png') ?>" src="images/new_version.png"
title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" /> title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" />
</button> </button>

View File

@ -1746,7 +1746,7 @@ function feedBrowser() {
} }); } });
}, },
removeFromArchive: function() { removeFromArchive: function() {
var selected = this.getSelectedFeeds(); var selected = this.getSelectedFeedIds();
if (selected.length > 0) { if (selected.length > 0) {
@ -1755,7 +1755,7 @@ function feedBrowser() {
if (confirm(pr)) { if (confirm(pr)) {
Element.show('feed_browser_spinner'); Element.show('feed_browser_spinner');
var query = "?op=rpc&method=remarchived&ids=" + var query = "?op=rpc&method=remarchive&ids=" +
param_escape(selected.toString());; param_escape(selected.toString());;
new Ajax.Request("backend.php", { new Ajax.Request("backend.php", {

View File

@ -205,6 +205,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
_infscroll_request_sent = 0; _infscroll_request_sent = 0;
headlines_scroll_handler($("headlines-frame"));
notify(""); notify("");
} catch (e) { } catch (e) {
@ -541,7 +543,7 @@ function moveToPost(mode, noscroll) {
} else if (next_id) { } else if (next_id) {
cdmExpandArticle(next_id); cdmExpandArticle(next_id);
cdmScrollToArticleId(next_id, noscroll); cdmScrollToArticleId(next_id, true);
} }
} else if (next_id) { } else if (next_id) {
@ -560,8 +562,13 @@ function moveToPost(mode, noscroll) {
var ctr = $("headlines-frame"); var ctr = $("headlines-frame");
if (!getInitParam("cdm_expanded")) { if (!getInitParam("cdm_expanded")) {
if (!noscroll && article.offsetTop < ctr.scrollTop) {
scrollArticle(-ctr.offsetHeight/3);
} else {
cdmExpandArticle(prev_id); cdmExpandArticle(prev_id);
cdmScrollToArticleId(prev_id, true); cdmScrollToArticleId(prev_id, true);
}
} else { } else {
if (!noscroll && article && article.offsetTop < ctr.scrollTop) { if (!noscroll && article && article.offsetTop < ctr.scrollTop) {
@ -1171,6 +1178,23 @@ function headlines_scroll_handler(e) {
try { try {
var hsp = $("headlines-spacer"); var hsp = $("headlines-spacer");
$$("#headlines-frame > div[id*=RROW]").each(
function(child) {
if (child.offsetTop <= $("headlines-frame").scrollTop +
$("headlines-frame").offsetHeight) {
var cencw = $("CENCW-" + child.id.replace("RROW-", ""));
if (cencw) {
cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
cencw.setAttribute('id', '');
Element.show(cencw);
}
}
}
);
if (!_infscroll_disable) { if (!_infscroll_disable) {
if ((hsp && e.scrollTop + e.offsetHeight >= hsp.offsetTop - hsp.offsetHeight) || if ((hsp && e.scrollTop + e.offsetHeight >= hsp.offsetTop - hsp.offsetHeight) ||
(e.scrollHeight != 0 && (e.scrollHeight != 0 &&
@ -1192,7 +1216,7 @@ function headlines_scroll_handler(e) {
$$("#headlines-frame > div[id*=RROW][class*=Unread]").each( $$("#headlines-frame > div[id*=RROW][class*=Unread]").each(
function(child) { function(child) {
if ($("headlines-frame").scrollTop > if (child.hasClassName("Unread") && $("headlines-frame").scrollTop >
(child.offsetTop + child.offsetHeight/2)) { (child.offsetTop + child.offsetHeight/2)) {
var id = child.id.replace("RROW-", ""); var id = child.id.replace("RROW-", "");
@ -1348,7 +1372,6 @@ function cdmCollapseArticle(event, id) {
function cdmExpandArticle(id) { function cdmExpandArticle(id) {
try { try {
console.log("cdmExpandArticle " + id); console.log("cdmExpandArticle " + id);
hideAuxDlg(); hideAuxDlg();
@ -1373,10 +1396,6 @@ function cdmExpandArticle(id) {
setActiveArticleId(id); setActiveArticleId(id);
if (!getInitParam("cdm_expanded")) {
cdmScrollToArticleId(id, true);
}
elem = $("CICD-" + id); elem = $("CICD-" + id);
var collapse = $$("div#RROW-" + id + var collapse = $$("div#RROW-" + id +
@ -1388,6 +1407,7 @@ function cdmExpandArticle(id) {
if (cencw) { if (cencw) {
cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML); cencw.innerHTML = htmlspecialchars_decode(cencw.innerHTML);
cencw.setAttribute('id', ''); cencw.setAttribute('id', '');
Element.show(cencw);
} }
Element.show(elem); Element.show(elem);
@ -1395,12 +1415,10 @@ function cdmExpandArticle(id) {
Element.show(collapse); Element.show(collapse);
} }
/* var new_offset = $("RROW-" + id).offsetTop; var new_offset = $("RROW-" + id).offsetTop;
$("headlines-frame").scrollTop += (new_offset-old_offset); if (old_offset > new_offset)
$("headlines-frame").scrollTop -= (old_offset-new_offset);
if ($("RROW-" + id).offsetTop != old_offset)
$("headlines-frame").scrollTop = new_offset; */
toggleUnread(id, 0, true); toggleUnread(id, 0, true);
toggleSelected(id); toggleSelected(id);

View File

@ -341,14 +341,12 @@
if ($search) { if ($search) {
$search_mode = 'this_feed'; $search_mode = 'this_feed';
$match_on = 'both';
} else { } else {
$search_mode = ''; $search_mode = '';
$match_on = '';
} }
$qfh_ret = queryFeedHeadlines($link, $feed_id, $limit, $qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
$view_mode, $is_cat, $search, $search_mode, $match_on, $view_mode, $is_cat, $search, $search_mode,
"score DESC, date_entered ".(mobile_get_pref($link, 'REVERSE_HEADLINES') ? 'ASC' : 'DESC'), $offset); "score DESC, date_entered ".(mobile_get_pref($link, 'REVERSE_HEADLINES') ? 'ASC' : 'DESC'), $offset);
$result = $qfh_ret[0]; $result = $qfh_ret[0];

View File

@ -18,7 +18,7 @@ class Close_Button extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
if (!get_pref($this->link, "COMBINED_DISPLAY_MODE")) { if (!get_pref($this->link, "COMBINED_DISPLAY_MODE")) {
$rv = "<img src=\"".theme_image($this->link, 'plugins/close_button/button.png')."\" $rv = "<img src=\"plugins/close_button/button.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"closeArticlePanel()\" onclick=\"closeArticlePanel()\"
title='".__('Close article')."'>"; title='".__('Close article')."'>";

View File

@ -25,7 +25,7 @@ class Flattr extends Plugin {
$encoded = urlencode($article_link); $encoded = urlencode($article_link);
$r = file_get_contents("https://api.flattr.com/rest/v2/things/lookup/?url=$encoded"); $r = file_get_contents("https://api.flattr.com/rest/v2/things/lookup/?url=$encoded");
$response = json_decode($r, true); $response = json_decode($r, true);
$image = "<img src=\"".theme_image($this->link, 'plugins/flattr/flattr.png')."\" $image = "<img src=\"plugins/flattr/flattr.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
title='".__('Flattr this article.')."'>"; title='".__('Flattr this article.')."'>";
// if Flattr has it in the catalogue, we display the button // if Flattr has it in the catalogue, we display the button

View File

@ -23,7 +23,7 @@ class GooglePlus extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
$article_id = $line["id"]; $article_id = $line["id"];
$rv = "<img src=\"".theme_image($this->link, 'plugins/googleplus/googleplus.png')."\" $rv = "<img src=\"plugins/googleplus/googleplus.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"shareArticleToGooglePlus($article_id)\" onclick=\"shareArticleToGooglePlus($article_id)\"
title='".__('Share on Google+')."'>"; title='".__('Share on Google+')."'>";

View File

@ -23,7 +23,7 @@ class Identica extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
$article_id = $line["id"]; $article_id = $line["id"];
$rv = "<img src=\"".theme_image($this->link, 'plugins/identica/identica.png')."\" $rv = "<img src=\"plugins/identica/identica.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"shareArticleToIdentica($article_id)\" onclick=\"shareArticleToIdentica($article_id)\"
title='".__('Share on identi.ca')."'>"; title='".__('Share on identi.ca')."'>";

View File

@ -22,7 +22,7 @@ class Mail extends Plugin {
} }
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"".theme_image($link, 'plugins/mail/mail.png')."\" return "<img src=\"plugins/mail/mail.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"emailArticle(".$line["id"].")\" onclick=\"emailArticle(".$line["id"].")\"
alt='Zoom' title='".__('Forward by email')."'>"; alt='Zoom' title='".__('Forward by email')."'>";

View File

@ -22,7 +22,7 @@ class MailTo extends Plugin {
} }
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"".theme_image($link, 'plugins/mailto/mail.png')."\" return "<img src=\"plugins/mailto/mail.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"mailtoArticle(".$line["id"].")\" onclick=\"mailtoArticle(".$line["id"].")\"
alt='Zoom' title='".__('Forward by email')."'>"; alt='Zoom' title='".__('Forward by email')."'>";

View File

@ -22,7 +22,7 @@ class Note extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"".theme_image($this->link, "plugins/note/note.png")."\" return "<img src=\"plugins/note/note.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\"
onclick=\"editArticleNote(".$line["id"].")\" onclick=\"editArticleNote(".$line["id"].")\"
class='tagsPic' title='".__('Edit article note')."'>"; class='tagsPic' title='".__('Edit article note')."'>";

View File

@ -68,7 +68,7 @@ class OwnCloud extends Plugin {
} }
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"".theme_image($this->link, "plugins/owncloud/owncloud.png")."\" return "<img src=\"plugins/owncloud/owncloud.png\"
style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\" style=\"cursor : pointer\"
onclick=\"ownArticle(".$line["id"].")\" onclick=\"ownArticle(".$line["id"].")\"
class='tagsPic' title='".__('Bookmark on OwnCloud ')."'>"; class='tagsPic' title='".__('Bookmark on OwnCloud ')."'>";

View File

@ -23,7 +23,7 @@ class Pinterest extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
$article_id = $line["id"]; $article_id = $line["id"];
$rv = "<img src=\"".theme_image($this->link, 'plugins/pinterest/pinterest.png')."\" $rv = "<img src=\"plugins/pinterest/pinterest.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"pinterest($article_id)\" onclick=\"pinterest($article_id)\"
title='".__('Pinterest')."'>"; title='".__('Pinterest')."'>";

View File

@ -24,7 +24,7 @@ class Pocket extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
$article_id = $line["id"]; $article_id = $line["id"];
$rv = "<img src=\"".theme_image($this->link, 'plugins/pocket/pocket.png')."\" $rv = "<img src=\"plugins/pocket/pocket.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"shareArticleToPocket($article_id)\" onclick=\"shareArticleToPocket($article_id)\"
title='".__('Pocket')."'>"; title='".__('Pocket')."'>";

View File

@ -21,7 +21,7 @@ class Share extends Plugin {
} }
function hook_article_button($line) { function hook_article_button($line) {
return "<img src=\"".theme_image($this->link, 'plugins/share/share.png')."\" return "<img src=\"plugins/share/share.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"shareArticle(".$line['int_id'].")\" onclick=\"shareArticle(".$line['int_id'].")\"
title='".__('Share by URL')."'>"; title='".__('Share by URL')."'>";

View File

@ -23,7 +23,7 @@ class Tweet extends Plugin {
function hook_article_button($line) { function hook_article_button($line) {
$article_id = $line["id"]; $article_id = $line["id"];
$rv = "<img src=\"".theme_image($this->link, 'plugins/tweet/tweet.png')."\" $rv = "<img src=\"plugins/tweet/tweet.png\"
class='tagsPic' style=\"cursor : pointer\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"tweetArticle($article_id)\" onclick=\"tweetArticle($article_id)\"
title='".__('Share on Twitter')."'>"; title='".__('Share on Twitter')."'>";