1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 07:15:55 +00:00

remove PTITLE kludge; use ajax

This commit is contained in:
Andrew Dolgov
2013-03-22 09:49:45 +04:00
parent d6cb941459
commit 5defc29ff8
5 changed files with 25 additions and 46 deletions

View File

@@ -1216,20 +1216,31 @@ function quickAddFilter() {
var lh = dojo.connect(dialog, "onLoad", function(){
dojo.disconnect(lh);
var title = $("PTITLE-FULL-" + getActiveArticleId());
var query = "op=rpc&method=getlinktitlebyid&id=" + getActiveArticleId();
if (title || getActiveFeedId() || activeFeedIsCat()) {
if (title) title = title.innerHTML;
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
var reply = JSON.parse(transport.responseText);
console.log(title + " " + getActiveFeedId());
var title = false;
var feed_id = activeFeedIsCat() ? 'CAT:' + parseInt(getActiveFeedId()) :
getActiveFeedId();
if (reply && reply) title = reply.title;
var rule = { reg_exp: title, feed_id: feed_id, filter_type: 1 };
if (title || getActiveFeedId() || activeFeedIsCat()) {
console.log(title + " " + getActiveFeedId());
var feed_id = activeFeedIsCat() ? 'CAT:' + parseInt(getActiveFeedId()) :
getActiveFeedId();
var rule = { reg_exp: title, feed_id: feed_id, filter_type: 1 };
addFilterRule(null, dojo.toJson(rule));
}
} });
addFilterRule(null, dojo.toJson(rule));
}
});
}