mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 07:55:57 +00:00
bayes: properly reset score when going good -> ugly
article: add helper to refresh article score pic, properly set scorepic title
This commit is contained in:
@@ -2,12 +2,13 @@ function bayesTrain(id, train_up) {
|
||||
try {
|
||||
|
||||
var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=trainArticle&article_id=" + param_escape(id) +
|
||||
"&train_up=" + train_up;
|
||||
"&train_up=" + param_escape(train_up);
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: query,
|
||||
onComplete: function(transport) {
|
||||
notify(transport.responseText);
|
||||
updateScore(id);
|
||||
} });
|
||||
|
||||
} catch (e) {
|
||||
|
||||
@@ -79,14 +79,14 @@ class Af_Sort_Bayes extends Plugin {
|
||||
switch ($current_category) {
|
||||
case "UGLY":
|
||||
$dst_category = "BAD";
|
||||
$score = -$this->score_modifier;
|
||||
$score = $this->score_modifier;
|
||||
break;
|
||||
case "BAD":
|
||||
$dst_category = "BAD";
|
||||
break;
|
||||
case "GOOD":
|
||||
$dst_category = "UGLY";
|
||||
$score = -$this->score_modifier;
|
||||
$score = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user