summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-11 21:42:38 +0300
committerAndrew Dolgov <[email protected]>2021-02-11 21:42:38 +0300
commit1a680d4eae7a5a6adb856f4db8adaa04ea4d64e3 (patch)
treef76f0109a793a8a7bc6f16d8c0f3876f928e3ed6 /js
parent848bc57f29ca4aa8357617a8470afb063748dd99 (diff)
publishedOPML: use client dialog
Diffstat (limited to 'js')
-rw-r--r--js/CommonDialogs.js51
-rw-r--r--js/Feeds.js47
2 files changed, 78 insertions, 20 deletions
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index b344967a7..08a32de86 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -359,5 +359,54 @@ const CommonDialogs = {
});
}
return false;
- }
+ },
+ publishedOPML: function() {
+
+ Notify.progress("Loading, please wait...", true);
+
+ xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
+ try {
+ if (dijit.byId("publicOPMLDlg"))
+ dijit.byId("publicOPMLDlg").destroyRecursive();
+
+ const dialog = new dijit.Dialog({
+ title: "Public OPML URL",
+ id: 'publicOPMLDlg',
+ style: "width: 600px",
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ },
+ content: `
+ <header>${__("Your Public OPML URL is:")}</header>
+ <section>
+ <div class='panel text-center'>
+ <a id='pub_opml_url' href='$url_path' target='_blank'>${reply.link}</a>
+ </div>
+ </section>
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' onclick="return Helpers.OPML.changeKey()">
+ ${__('Generate new URL')}
+ </button>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
+ ${__('Close this window')}
+ </button>
+ </footer>
+ `
+ });
+
+ dialog.show();
+
+ Notify.close();
+
+ } catch (e) {
+ this.Error.report(e);
+ }
+ });
+ },
};
diff --git a/js/Feeds.js b/js/Feeds.js
index 64e932ca2..1e476dd98 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -226,25 +226,34 @@ 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;
- }
- });
-
- dialog.show();
+ 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',
+ style: "width: 600px",
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ }
});
+
+ dialog.show();
}
if (dijit.byId("safeModeDlg"))
@@ -258,7 +267,7 @@ const Feeds = {
${__('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'>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
${__('Close this window')}
</button>
</footer>