Improve reload tip

pull/223/head
Lennart Kats 2015-11-29 20:09:25 +00:00
rodzic dcf4e5076e
commit a80297b6eb
1 zmienionych plików z 14 dodań i 7 usunięć

Wyświetl plik

@ -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;
}