diff options
author | Andrew Dolgov <[email protected]> | 2018-12-01 18:25:32 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-01 18:25:32 +0300 |
commit | 4bed9be57d671324921bfd1d90d25b8cd0af3d4f (patch) | |
tree | 8ef670bc3f695e4948561c406e2d97cbc60053ed /js/feedlist.js | |
parent | 44d3aedd382f6b9f38776fd2f2a8119f4160da55 (diff) |
js-ification: start on some common dialogs
Diffstat (limited to 'js/feedlist.js')
-rw-r--r-- | js/feedlist.js | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/js/feedlist.js b/js/feedlist.js index ddef1a586..f2f5e60ba 100644 --- a/js/feedlist.js +++ b/js/feedlist.js @@ -190,7 +190,7 @@ const Feeds = { try { Feeds.init(); - setLoadingProgress(25); + Utils.setLoadingProgress(25); } catch (e) { exception_error(e); } @@ -204,7 +204,7 @@ const Feeds = { init: function() { console.log("in feedlist init"); - setLoadingProgress(50); + Utils.setLoadingProgress(50); document.onkeydown = App.hotkeyHandler; setInterval(hotkeyPrefixTimeout, 3 * 1000); @@ -602,5 +602,35 @@ const Feeds = { if (nuf) return tree.model.store.getValue(nuf, 'bare_id'); - } + }, + search: function() { + const query = "backend.php?op=feeds&method=search¶m=" + + param_escape(Feeds.getActiveFeedId() + ":" + Feeds.activeFeedIsCat()); + + if (dijit.byId("searchDlg")) + dijit.byId("searchDlg").destroyRecursive(); + + const dialog = new dijit.Dialog({ + id: "searchDlg", + title: __("Search"), + style: "width: 600px", + execute: function () { + if (this.validate()) { + Feeds._search_query = this.attr('value'); + this.hide(); + Feeds.viewCurrentFeed(); + } + }, + href: query + }); + + dialog.show(); + }, + updateRandomFeed: function() { + console.log("in update_random_feed"); + + xhrPost("backend.php", {op: "rpc", method: "updateRandomFeed"}, (transport) => { + Utils.handleRpcJson(transport, true); + }); + }, }; |