mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-18 16:11:30 +00:00
api: support published status in getHeadlines; digest: code cleanup
This commit is contained in:
11
digest.css
11
digest.css
@@ -159,14 +159,17 @@ a:hover {
|
|||||||
max-width : 65%;
|
max-width : 65%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headlines ul#headlines-content img.digest-check {
|
#headlines ul#headlines-content div.digest-check {
|
||||||
cursor : pointer;
|
float : right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#headlines ul#headlines-content div.digest-check {
|
#headlines ul#headlines-content div.digest-check img {
|
||||||
float : right;
|
cursor : pointer;
|
||||||
|
margin-right : 0px;
|
||||||
|
margin-left : 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#headlines ul#headlines-content img.icon {
|
#headlines ul#headlines-content img.icon {
|
||||||
width : 16px;
|
width : 16px;
|
||||||
height : 16px;
|
height : 16px;
|
||||||
|
|||||||
70
digest.js
70
digest.js
@@ -14,7 +14,7 @@ function catchup_feed(feed_id, callback) {
|
|||||||
|
|
||||||
var is_cat = "";
|
var is_cat = "";
|
||||||
|
|
||||||
if (feed_id == -4) is_cat = "true";
|
if (feed_id < 0) is_cat = "true"; // KLUDGE
|
||||||
|
|
||||||
var query = "?op=rpc&subop=catchupFeed&feed_id=" +
|
var query = "?op=rpc&subop=catchupFeed&feed_id=" +
|
||||||
feed_id + "&is_cat=" + is_cat;
|
feed_id + "&is_cat=" + is_cat;
|
||||||
@@ -290,18 +290,32 @@ function add_headline_entry(article, feed) {
|
|||||||
|
|
||||||
icon_part = "<img class='icon' src='" + get_feed_icon(feed) + "'/>";
|
icon_part = "<img class='icon' src='" + get_feed_icon(feed) + "'/>";
|
||||||
|
|
||||||
|
var mark_part = "";
|
||||||
|
var publ_part = "";
|
||||||
|
|
||||||
|
if (article.marked)
|
||||||
|
mark_part = "<img title='"+ __("Unstar article")+"' onclick=\"toggle_mark(this, "+article.id+")\" src='images/mark_set.png'>";
|
||||||
|
else
|
||||||
|
mark_part = "<img title='"+__("Star article")+"' onclick=\"toggle_mark(this, "+article.id+")\" src='images/mark_unset.png'>";
|
||||||
|
|
||||||
|
if (article.published)
|
||||||
|
publ_part = "<img title='"+__("Unpublish article")+"' onclick=\"toggle_pub(this, "+article.id+")\" src='images/pub_set.png'>";
|
||||||
|
else
|
||||||
|
publ_part = "<img title='"+__("Publish article")+"' onclick=\"toggle_pub(this, "+article.id+")\" src='images/pub_unset.png'>";
|
||||||
|
|
||||||
|
|
||||||
var tmp_html = "<li id=\"A-"+article.id+"\">" +
|
var tmp_html = "<li id=\"A-"+article.id+"\">" +
|
||||||
icon_part +
|
icon_part +
|
||||||
"<div class='digest-check'>" +
|
"<div class='digest-check'>" +
|
||||||
"<img title='Set starred' onclick=\"toggleMark(this, "+article.id+")\" src='images/mark_unset.png'>" +
|
mark_part +
|
||||||
"<img title='Set published' onclick=\"togglePub(this, "+article.id+")\" src='images/pub_unset.png'>" +
|
publ_part +
|
||||||
"<img title='" + __("Mark as read") + "' onclick=\"view("+article.id+", true)\" class='digest-check' src='images/digest_checkbox.png'>" +
|
"<img title='" + __("Mark as read") + "' onclick=\"view("+article.id+", true)\" src='images/digest_checkbox.png'>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"<a target=\"_blank\" href=\""+article.link+"\""+
|
"<a target=\"_blank\" href=\""+article.link+"\""+
|
||||||
"onclick=\"return view("+article.id+")\" class='title'>" +
|
"onclick=\"return view("+article.id+")\" class='title'>" +
|
||||||
article.title + "</a>" +
|
article.title + "</a>" +
|
||||||
"<div class='body'>" +
|
"<div class='body'>" +
|
||||||
"<div title=\"Click to expand article\" onclick=\"zoom("+article.id+")\" class='excerpt'>" +
|
"<div title=\""+__("Click to expand article")+"\" onclick=\"zoom("+article.id+")\" class='excerpt'>" +
|
||||||
article.excerpt + "</div>" +
|
article.excerpt + "</div>" +
|
||||||
"<div style='display : none' class='content'>" +
|
"<div style='display : none' class='content'>" +
|
||||||
article.content + "</div>" +
|
article.content + "</div>" +
|
||||||
@@ -450,41 +464,7 @@ function init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tMark_afh_off(effect) {
|
function toggle_mark(mark_img, id) {
|
||||||
try {
|
|
||||||
var elem = effect.effects[0].element;
|
|
||||||
|
|
||||||
console.log("tMark_afh_off : " + elem.id);
|
|
||||||
|
|
||||||
if (elem) {
|
|
||||||
elem.src = elem.src.replace("mark_set", "mark_unset");
|
|
||||||
elem.alt = __("Star article");
|
|
||||||
Element.show(elem);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
exception_error("tMark_afh_off", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function tPub_afh_off(effect) {
|
|
||||||
try {
|
|
||||||
var elem = effect.effects[0].element;
|
|
||||||
|
|
||||||
console.log("tPub_afh_off : " + elem.id);
|
|
||||||
|
|
||||||
if (elem) {
|
|
||||||
elem.src = elem.src.replace("pub_set", "pub_unset");
|
|
||||||
elem.alt = __("Publish article");
|
|
||||||
Element.show(elem);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
exception_error("tPub_afh_off", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleMark(mark_img, id) {
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -510,15 +490,15 @@ function toggleMark(mark_img, id) {
|
|||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
//
|
update();
|
||||||
} });
|
} });
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("toggleMark", e);
|
exception_error("toggle_mark", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function togglePub(mark_img, id, note) {
|
function toggle_pub(mark_img, id, note) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -552,11 +532,11 @@ function togglePub(mark_img, id, note) {
|
|||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
//
|
update();
|
||||||
} });
|
} });
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("togglePub", e);
|
exception_error("toggle_pub", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6777,6 +6777,7 @@
|
|||||||
"id" => (int)$line["id"],
|
"id" => (int)$line["id"],
|
||||||
"unread" => sql_bool_to_bool($line["unread"]),
|
"unread" => sql_bool_to_bool($line["unread"]),
|
||||||
"marked" => sql_bool_to_bool($line["marked"]),
|
"marked" => sql_bool_to_bool($line["marked"]),
|
||||||
|
"published" => sql_bool_to_bool($line["published"]),
|
||||||
"updated" => strtotime($line["updated"]),
|
"updated" => strtotime($line["updated"]),
|
||||||
"is_updated" => $is_updated,
|
"is_updated" => $is_updated,
|
||||||
"title" => $line["title"],
|
"title" => $line["title"],
|
||||||
|
|||||||
Reference in New Issue
Block a user