summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/App.js4
-rw-r--r--js/CommonDialogs.js15
-rw-r--r--js/Feeds.js15
-rw-r--r--js/PrefHelpers.js7
4 files changed, 28 insertions, 13 deletions
diff --git a/js/App.js b/js/App.js
index 6c4b6a187..95a9796ff 100644
--- a/js/App.js
+++ b/js/App.js
@@ -820,6 +820,10 @@ const App = {
App.updateRuntimeInfo();
}, 60 * 1000)
+ if (App.getInitParam("safe_mode") && this.isPrefs()) {
+ CommonDialogs.safeModeWarning();
+ }
+
console.log("second stage ok");
},
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index 4c169b026..4cfc6ec70 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -11,6 +11,21 @@ const CommonDialogs = {
const dialog = dijit.byId("infoBox");
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() {
xhr.json("backend.php",
{op: "feeds", method: "subscribeToFeed"},
diff --git a/js/Feeds.js b/js/Feeds.js
index 27586ab13..5ef554af0 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -278,19 +278,8 @@ const Feeds = {
}
if (App.getInitParam("safe_mode")) {
- 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();
+ /* global CommonDialogs */
+ CommonDialogs.safeModeWarning();
}
// bw_limit disables timeout() so we request initial counters separately
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index 09e6a7fbd..c0fff66c9 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -363,8 +363,15 @@ const Helpers = {
xhr.json("backend.php", {op: "pref-prefs", method: "getPluginsList"}, (reply) => {
this._list_of_plugins = reply;
this.render_contents();
+ }, (e) => {
+ this.render_error(e);
});
},
+ render_error: function(e) {
+ const container = document.querySelector(".prefs-plugin-list");
+
+ container.innerHTML = `<li class='text-error'>${__("Error while loading plugins list: %s.").replace("%s", e)}</li>`;
+ },
render_contents: function() {
const container = document.querySelector(".prefs-plugin-list");