summaryrefslogtreecommitdiff
path: root/js/prefs.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-03 12:26:49 +0300
committerAndrew Dolgov <[email protected]>2018-12-03 12:26:49 +0300
commitb3bc638a9fa87cdaf61bff446f8aa0534d2b49ee (patch)
treef5bd8fa16550252660cda74ec7267889efaa6cb7 /js/prefs.js
parent78cc470193448048759b3f315ee630e50acb064b (diff)
refactor OPML export/import code to be less horrible
Diffstat (limited to 'js/prefs.js')
-rwxr-xr-xjs/prefs.js77
1 files changed, 1 insertions, 76 deletions
diff --git a/js/prefs.js b/js/prefs.js
index edb11bc7d..4bdfb45ef 100755
--- a/js/prefs.js
+++ b/js/prefs.js
@@ -152,79 +152,4 @@ require(["dojo/_base/kernel",
exception_error(e);
}
});
-});
-
-function opmlImportComplete(iframe) {
- if (!iframe.contentDocument.body.innerHTML) return false;
-
- Element.show(iframe);
-
- Notify.close();
-
- if (dijit.byId('opmlImportDlg'))
- dijit.byId('opmlImportDlg').destroyRecursive();
-
- const content = iframe.contentDocument.body.innerHTML;
-
- const dialog = new dijit.Dialog({
- id: "opmlImportDlg",
- title: __("OPML Import"),
- style: "width: 600px",
- onCancel: function () {
- window.location.reload();
- },
- execute: function () {
- window.location.reload();
- },
- content: content
- });
-
- dialog.show();
-}
-
-function opmlImport() {
-
- const opml_file = $("opml_file");
-
- if (opml_file.value.length == 0) {
- alert(__("Please choose an OPML file first."));
- return false;
- } else {
- Notify.progress("Importing, please wait...", true);
-
- Element.show("upload_iframe");
-
- return true;
- }
-}
-
-function opmlRegenKey() {
- if (confirm(__("Replace current OPML publishing address with a new one?"))) {
- Notify.progress("Trying to change address...", true);
-
- xhrJson("backend.php", { op: "pref-feeds", method: "regenOPMLKey" }, (reply) => {
- if (reply) {
- const new_link = reply.link;
- const e = $('pub_opml_url');
-
- if (new_link) {
- e.href = new_link;
- e.innerHTML = new_link;
-
- new Effect.Highlight(e);
-
- Notify.close();
-
- } else {
- Notify.error("Could not change feed URL.");
- }
- }
- });
- }
- return false;
-}
-
-function gotoExportOpml(filename, settings) {
- const tmp = settings ? 1 : 0;
- document.location.href = "backend.php?op=opml&method=export&filename=" + filename + "&settings=" + tmp;
-}
+}); \ No newline at end of file