print "<form name='filter_new_form' id='filter_new_form'>";
- $active_feed_id = (int) db_escape_string($_REQUEST["feed"]);
- $cat_filter = db_escape_string($_REQUEST["is_cat"]) == "true";
-
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"add\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"csrf_token\" value=\"".$_SESSION['csrf_token']."\">";
},
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) {