diff options
Diffstat (limited to 'js/PrefHelpers.js')
-rw-r--r-- | js/PrefHelpers.js | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index 125cc20d0..ff7766d8a 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -295,7 +295,34 @@ const Helpers = { }); } }, - updateLocal: function(name = null) { + checkForUpdate: function(name = null) { + Notify.progress("Checking for plugin updates..."); + + xhr.json("backend.php", {op: "pref-prefs", method: "checkForPluginUpdates", name: name}, (reply) => { + Notify.close(); + + if (reply) { + let plugins_with_updates = 0; + + reply.forEach((p) => { + if (p.rv.o) { + const button = dijit.getEnclosingWidget(App.find(`*[data-update-btn-for-plugin="${p.plugin}"]`)); + + if (button) { + button.domNode.show(); + ++plugins_with_updates; + } + } + }); + + if (plugins_with_updates > 0) + App.find(".update-all-plugins-btn").show(); + } else { + Notify.error("Unable to check for plugin updates."); + } + }); + }, + update: function(name = null) { const msg = name ? __("Update %p using git?").replace("%p", name) : __("Update all local plugins using git?"); |