From 0cb719a40447e30011142714d5e5ce55c051a118 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 3 Mar 2021 19:35:11 +0300 Subject: add basic local plugin uninstaller --- js/PrefHelpers.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/PrefHelpers.js') diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index e6a37c6e8..241bb6e71 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -349,6 +349,22 @@ const Helpers = { } }); }, + uninstall: function(plugin) { + const msg = __("Uninstall plugin %s?").replace("%s", plugin); + + if (confirm(msg)) { + Notify.progress("Loading, please wait..."); + + xhr.json("backend.php", {op: "pref-prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { + if (reply && reply.status == 1) + Helpers.Prefs.refresh(); + else { + Notify.error("Plugin uninstallation failed."); + } + }); + + } + }, install: function() { const dialog = new fox.SingleUseDialog({ PI_RES_ALREADY_INSTALLED: "PI_RES_ALREADY_INSTALLED", -- cgit v1.2.3-54-g00ecf