From a80297b6eb83a79dfdce3ec505d19c2d1edf31bb Mon Sep 17 00:00:00 2001 From: Lennart Kats Date: Sun, 29 Nov 2015 20:09:25 +0000 Subject: [PATCH] Improve reload tip --- plugins/c9.ide.plugins/manager.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/c9.ide.plugins/manager.js b/plugins/c9.ide.plugins/manager.js index abe19c2b..d6110d4c 100644 --- a/plugins/c9.ide.plugins/manager.js +++ b/plugins/c9.ide.plugins/manager.js @@ -665,13 +665,7 @@ define(function(require, exports, module) { } function reload(name) { - var key = commands.getHotkey("reloadLastPlugin"); - if (commands.platform == "mac") - key = apf.hotkeys.toMacNotation(key); - if (!getLastReloaded()) - showInfo("Reloaded " + name + ". Press " + key + " to reload again.", 3000); - else - showInfo("Reloaded " + name + ".", 1000); + showReloadTip(); var href = document.location.href.replace(/[?&]reload=[^&]+/, "") + (document.location.href.match(/\?/) ? "&" : "?") @@ -687,6 +681,19 @@ define(function(require, exports, module) { } } + function showReloadTip() { + if (options.devel) { + var key = commands.getHotkey("reloadLastPlugin"); + if (commands.platform == "mac") + key = apf.hotkeys.toMacNotation(key); + if (!getLastReloaded()) { + showInfo("Reloaded " + name + ". Press " + key + " to reload again.", 3000); + return; + } + } + showInfo("Reloaded " + name + ".", 1000); + } + function getLastReloaded() { return qs.parse(document.location.search.substr(1)).reload; }