From d9c5c93cef313127b9b5010fbe279fdbddedadec Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 20:07:57 +0300 Subject: move some more stuff out of common.js rework client-side cookie functions a bit limit dojo cachebust based on server scripts modification time remove param_escape() --- js/CommonDialogs.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'js/CommonDialogs.js') diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index d8733e1c2..efdc4e503 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -2,6 +2,40 @@ /* global __, ngettext */ define(["dojo/_base/declare"], function (declare) { return declare("fox.CommonDialogs", null, { + closeInfoBox: function() { + const dialog = dijit.byId("infoBox"); + if (dialog) dialog.hide(); + }, + removeFeedIcon: function(id) { + if (confirm(__("Remove stored feed icon?"))) { + notify_progress("Removing feed icon...", true); + + const query = {op: "pref-feeds", method: "removeicon", feed_id: id}; + + xhrPost("backend.php", query, () => { + notify_info("Feed icon removed."); + if (App.isPrefs()) { + Feeds.reload(); + } else { + setTimeout('Feeds.reload(false, false)', 50); + } + }); + } + + return false; + }, + uploadFeedIcon: function() { + const file = $("icon_file"); + + if (file.value.length == 0) { + alert(__("Please select an image file to upload.")); + } else if (confirm(__("Upload new icon for this feed?"))) { + notify_progress("Uploading, please wait...", true); + return true; + } + + return false; + }, quickAddFeed: function() { const query = "backend.php?op=feeds&method=quickAddFeed"; -- cgit v1.2.3