From fc8aa0e2a3983df94055b3a210a328cdabb3d10c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 19 Nov 2014 09:39:06 +0800 Subject: [PATCH] F5 - Build --- static/js/hotkeys.js | 18 ++++++++++++++++-- static/js/menu.js | 4 ++-- views/keyboard_shortcuts.html | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/static/js/hotkeys.js b/static/js/hotkeys.js index a27096e..33f05ce 100644 --- a/static/js/hotkeys.js +++ b/static/js/hotkeys.js @@ -86,7 +86,14 @@ var hotkeys = { shiftKey: true, which: 79 }, - // F6 构建并运行 + // F5 Build + build: { + ctrlKey: false, + altKey: false, + shiftKey: false, + which: 116 + }, + // F6 Build & Run buildRun: { ctrlKey: false, altKey: false, @@ -416,7 +423,14 @@ var hotkeys = { return false; } - if (event.which === hotKeys.buildRun.which) { // F6 构建并运行 + if (event.which === hotKeys.build.which) { // F5 Build + menu.build(); + event.preventDefault(); + + return; + } + + if (event.which === hotKeys.buildRun.which) { // F6 Build & Run menu.run(); event.preventDefault(); diff --git a/static/js/menu.js b/static/js/menu.js index b9a34f6..b65b4a3 100644 --- a/static/js/menu.js +++ b/static/js/menu.js @@ -216,7 +216,7 @@ var menu = { } }); }, - // 构建并运行. + // Build & Run. run: function () { menu.saveAllFiles(); @@ -253,7 +253,7 @@ var menu = { } }); }, - // 构建 + // Build. build: function () { menu.saveAllFiles(); diff --git a/views/keyboard_shortcuts.html b/views/keyboard_shortcuts.html index c48c08d..1d73215 100644 --- a/views/keyboard_shortcuts.html +++ b/views/keyboard_shortcuts.html @@ -47,6 +47,7 @@

{{.i18n.run}}