summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-31 17:33:22 +0400
committerAndrew Dolgov <[email protected]>2012-08-31 17:33:22 +0400
commitab564aef7b4ea33dd764cf8ccb2e8cc81650b51f (patch)
treeb9c3e8d8facfc07c02aa006606843a55c7384801 /js
parent84d9750edcb52602a0e69b52df73a93a54d585c8 (diff)
filterEditDlg: automatically open new rule dialog when active feed or article title present
Diffstat (limited to 'js')
-rw-r--r--js/functions.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/functions.js b/js/functions.js
index a01ce3cad..313cbe5c9 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1169,6 +1169,27 @@ function quickAddFilter() {
},
href: query});
+ if (!inPreferences()) {
+ var lh = dojo.connect(dialog, "onLoad", function(){
+ dojo.disconnect(lh);
+
+ var title = $("PTITLE-FULL-" + active_post_id);
+
+ if (title || getActiveFeedId() || activeFeedIsCat()) {
+ if (title) title = title.innerHTML;
+
+ 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));
+ }
+ });
+ }
+
dialog.show();
} catch (e) {