diff options
Diffstat (limited to 'js/Feeds.js')
-rw-r--r-- | js/Feeds.js | 79 |
1 files changed, 58 insertions, 21 deletions
diff --git a/js/Feeds.js b/js/Feeds.js index ccb982cb3..45b8193e4 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -226,25 +226,64 @@ const Feeds = { if (dijit.byId("defaultPasswordDlg")) dijit.byId("defaultPasswordDlg").destroyRecursive(); - xhrPost("backend.php", {op: 'dlg', method: 'defaultpasswordwarning'}, (transport) => { - const dialog = new dijit.Dialog({ - title: __("Your password is at default value"), - content: transport.responseText, - id: 'defaultPasswordDlg', - style: "width: 600px", - onCancel: function () { - return true; - }, - onExecute: function () { - return true; - }, - onClose: function () { - return true; - } - }); + const dialog = new dijit.Dialog({ + title: __("Your password is at default value"), + content: `<div class='alert alert-error'> + ${__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication).")} + </div> + + <footer class='text-center'> + <button dojoType='dijit.form.Button' class='alt-primary' onclick="document.location.href = 'prefs.php'"> + ${__('Open Preferences')} + </button> + <button dojoType='dijit.form.Button' onclick="return dijit.byId('defaultPasswordDlg').hide()"> + ${__('Close this window')} + </button> + </footer>`, + id: 'defaultPasswordDlg', + onCancel: function () { + return true; + }, + onExecute: function () { + return true; + }, + onClose: function () { + return true; + } + }); + + dialog.show(); + } - dialog.show(); + if (dijit.byId("safeModeDlg")) + dijit.byId("safeModeDlg").destroyRecursive(); + + if (App.getInitParam("safe_mode")) { + const dialog = new dijit.Dialog({ + title: __("Safe mode"), + content: ` + <div class='alert alert-info'> + ${__('Tiny Tiny RSS is running in safe mode. All themes and plugins are disabled. You will need to log out and back in to disable it.')} + </div> + <footer class='text-center'> + <button dojoType='dijit.form.Button' type='submit' class='alt-primary'> + ${__('Close this window')} + </button> + </footer> + `, + id: 'safeModeDlg', + onCancel: function () { + return true; + }, + onExecute: function () { + return true; + }, + onClose: function () { + return true; + } }); + + dialog.show(); } // bw_limit disables timeout() so we request initial counters separately @@ -555,19 +594,17 @@ const Feeds = { return tree.model.store.getValue(nuf, 'bare_id'); }, search: function() { - if (dijit.byId("searchDlg")) - dijit.byId("searchDlg").destroyRecursive(); - xhrPost("backend.php", {op: "feeds", method: "search", param: Feeds.getActive() + ":" + Feeds.activeIsCat()}, (transport) => { + if (dijit.byId("searchDlg")) + dijit.byId("searchDlg").destroyRecursive(); const dialog = new dijit.Dialog({ id: "searchDlg", content: transport.responseText, title: __("Search"), - style: "width: 600px", execute: function () { if (this.validate()) { Feeds._search_query = this.attr('value'); |