diff options
author | Andrew Dolgov <[email protected]> | 2021-03-03 19:35:11 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-03 19:35:11 +0300 |
commit | 0cb719a40447e30011142714d5e5ce55c051a118 (patch) | |
tree | b629f55148996ee6e4aedab227bb161f58b55db6 /js/PrefHelpers.js | |
parent | dfdb746a76231bfb4c8066328bf99cd54f83783c (diff) |
add basic local plugin uninstaller
Diffstat (limited to 'js/PrefHelpers.js')
-rw-r--r-- | js/PrefHelpers.js | 16 |
1 files changed, 16 insertions, 0 deletions
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", |