show safe mode warning dialog in prefs

This commit is contained in:
Andrew Dolgov 2021-11-14 16:12:27 +03:00
parent d3d3bceec9
commit cf93371607
3 changed files with 21 additions and 13 deletions

View File

@ -820,6 +820,10 @@ const App = {
App.updateRuntimeInfo(); App.updateRuntimeInfo();
}, 60 * 1000) }, 60 * 1000)
if (App.getInitParam("safe_mode") && this.isPrefs()) {
CommonDialogs.safeModeWarning();
}
console.log("second stage ok"); console.log("second stage ok");
}, },

View File

@ -11,6 +11,21 @@ const CommonDialogs = {
const dialog = dijit.byId("infoBox"); const dialog = dijit.byId("infoBox");
if (dialog) dialog.hide(); if (dialog) dialog.hide();
}, },
safeModeWarning: function() {
const dialog = new fox.SingleUseDialog({
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>`
});
dialog.show();
},
subscribeToFeed: function() { subscribeToFeed: function() {
xhr.json("backend.php", xhr.json("backend.php",
{op: "feeds", method: "subscribeToFeed"}, {op: "feeds", method: "subscribeToFeed"},

View File

@ -278,19 +278,8 @@ const Feeds = {
} }
if (App.getInitParam("safe_mode")) { if (App.getInitParam("safe_mode")) {
const dialog = new fox.SingleUseDialog({ /* global CommonDialogs */
title: __("Safe mode"), CommonDialogs.safeModeWarning();
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>`
});
dialog.show();
} }
// bw_limit disables timeout() so we request initial counters separately // bw_limit disables timeout() so we request initial counters separately