mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-25 21:21:29 +00:00
allow setting article score manually
This commit is contained in:
@@ -2137,3 +2137,30 @@ function cancelSearch() {
|
||||
exception_error("cancelSearch", e);
|
||||
}
|
||||
}
|
||||
|
||||
function changeScore(id, pic) {
|
||||
try {
|
||||
var score = pic.getAttribute("score");
|
||||
|
||||
var new_score = prompt(__("Please enter new score for this article:"), score);
|
||||
|
||||
if (new_score != undefined) {
|
||||
|
||||
var query = "op=rpc&method=setScore&id=" + param_escape(id) +
|
||||
"&score=" + param_escape(new_score);
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: query,
|
||||
onComplete: function(transport) {
|
||||
var reply = JSON.parse(transport.responseText);
|
||||
|
||||
if (reply) {
|
||||
pic.src = pic.src.replace(/score_.*?\.png/, reply["score_pic"]);
|
||||
pic.setAttribute("score", new_score);
|
||||
}
|
||||
} });
|
||||
}
|
||||
} catch (e) {
|
||||
exception_error("changeScore", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user