diff options
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", |