summaryrefslogtreecommitdiff
path: root/js/Feeds.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Feeds.js')
-rw-r--r--js/Feeds.js55
1 files changed, 54 insertions, 1 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index a6eecaf81..2cc5586b3 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -23,6 +23,7 @@ const Feeds = {
infscroll_in_progress: 0,
infscroll_disabled: 0,
_infscroll_timeout: false,
+ _filter_query: false, // TODO: figure out the UI for this
_search_query: false,
last_search_query: [],
_viewfeed_wait_timeout: false,
@@ -154,6 +155,10 @@ const Feeds = {
toggle: function() {
Element.toggle("feeds-holder");
},
+ cancelFilter: function() {
+ this._filter_query = "";
+ this.reload();
+ },
cancelSearch: function() {
this._search_query = "";
this.reloadCurrent();
@@ -178,8 +183,14 @@ const Feeds = {
dijit.byId("feedTree").destroyRecursive();
}
+ let query = {op: 'Pref_Feeds', method: 'getfeedtree', mode: 2};
+
+ if (this._filter_query) {
+ query = Object.assign(query, this._filter_query);
+ }
+
const store = new dojo.data.ItemFileWriteStore({
- url: "backend.php?op=Pref_Feeds&method=getfeedtree&mode=2"
+ url: "backend.php?" + dojo.objectToQuery(query)
});
// noinspection JSUnresolvedFunction
@@ -683,6 +694,48 @@ const Feeds = {
});
},
+ filter: function() {
+ const dialog = new fox.SingleUseDialog({
+ content: `
+ <form onsubmit='return false'>
+ <section>
+ <fieldset>
+ <input dojoType='dijit.form.ValidationTextBox' id='filter_query'
+ style='font-size : 16px; width : 540px;'
+ placeHolder="${__("Show feeds matching...")}"
+ name='search' type='search' value=''>
+ </fieldset>
+ </section>
+
+ <footer>
+ ${App.FormFields.submit_tag(App.FormFields.icon("search") + " " + __('Search'), {onclick: "App.dialogOf(this).execute()"})}
+ ${App.FormFields.cancel_dialog_tag(__('Cancel'))}
+ </footer>
+ </form>
+ `,
+ title: __("Search feeds"),
+ execute: function () {
+ if (this.validate()) {
+ Feeds._filter_query = this.attr('value');
+
+ this.hide();
+ Feeds.reload();
+ }
+ },
+ });
+
+ const tmph = dojo.connect(dialog, 'onShow', function () {
+ dojo.disconnect(tmph);
+
+ if (Feeds._filter_query && Feeds._filter_query.search) {
+ dijit.byId('filter_query')
+ .attr('value', Feeds._filter_query.search);
+ }
+ });
+
+ dialog.show();
+
+ },
updateRandom: function() {
console.log("in update_random_feed");