From 2e009a512f6f89ec83beda3e0f7f71f77f097aad Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Fri, 7 Sep 2012 09:18:12 -0700 Subject: [PATCH 1/8] added module utils/KeyEvent that defiens key event constants --- src/document/DocumentCommandHandlers.js | 5 +- src/editor/InlineWidget.js | 5 +- src/project/ProjectManager.js | 6 +- src/search/FindInFiles.js | 8 +- src/utils/KeyEvent.js | 151 ++++++++++++++++++++++++ src/widgets/PopUpManager.js | 5 +- test/spec/CodeHint-test.js | 3 +- 7 files changed, 171 insertions(+), 12 deletions(-) create mode 100644 src/utils/KeyEvent.js diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 095dd97f0ba..a7d8641c2f2 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -45,7 +45,8 @@ define(function (require, exports, module) { Dialogs = require("widgets/Dialogs"), Strings = require("strings"), PreferencesManager = require("preferences/PreferencesManager"), - PerfUtils = require("utils/PerfUtils"); + PerfUtils = require("utils/PerfUtils"), + KeyEvent = require("utils/KeyEvent"); /** * Handlers for commands related to document handling (opening, saving, etc.) @@ -746,7 +747,7 @@ define(function (require, exports, module) { * @param {jQueryEvent} event Key-up event */ function detectDocumentNavEnd(event) { - if (event.keyCode === 17) { // Ctrl key + if (event.keyCode === KeyEvent.DOM_VK_CONTROL) { // Ctrl key DocumentManager.finalizeDocumentNavigation(); _addedNavKeyHandler = false; diff --git a/src/editor/InlineWidget.js b/src/editor/InlineWidget.js index 3a9dcb7e7ec..12f97ba5525 100644 --- a/src/editor/InlineWidget.js +++ b/src/editor/InlineWidget.js @@ -29,7 +29,8 @@ define(function (require, exports, module) { "use strict"; // Load dependent modules - var EditorManager = require("editor/EditorManager"); + var EditorManager = require("editor/EditorManager"), + KeyEvent = require("utils/KeyEvent"); /** * @constructor @@ -45,7 +46,7 @@ define(function (require, exports, module) { .append("
"); this.$htmlContent.on("keydown", function (e) { - if (e.keyCode === 27) { + if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) { self.close(); e.stopImmediatePropagation(); } diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index b4bba483dd1..f1f64f2434c 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -59,7 +59,8 @@ define(function (require, exports, module) { PerfUtils = require("utils/PerfUtils"), ViewUtils = require("utils/ViewUtils"), FileUtils = require("file/FileUtils"), - Urls = require("i18n!nls/urls"); + Urls = require("i18n!nls/urls"), + KeyEvent = require("utils/KeyEvent"); /** * @private @@ -926,7 +927,8 @@ define(function (require, exports, module) { $renameInput.on("keydown", function (event) { // Listen for escape key on keydown, so we can remove the node in the create.jstree handler above - if (event.keyCode === 27) { + if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) { + escapeKeyPressed = true; } }); diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 0ceba5a3ff0..8766de1cb76 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -49,7 +49,9 @@ define(function (require, exports, module) { StringUtils = require("utils/StringUtils"), DocumentManager = require("document/DocumentManager"), EditorManager = require("editor/EditorManager"), - FileIndexManager = require("project/FileIndexManager"); + FileIndexManager = require("project/FileIndexManager"), + KeyEvent = require("utils/KeyEvent"); + var FIND_IN_FILES_MAX = 100; @@ -108,13 +110,13 @@ define(function (require, exports, module) { $searchField.get(0).select(); $searchField.bind("keydown", function (event) { - if (event.keyCode === 13 || event.keyCode === 27) { // Enter/Return key or Esc key + if (event.keyCode === KeyEvent.DOM_VK_RETURN || event.keyCode === KeyEvent.DOM_VK_ESCAPE) { // Enter/Return key or Esc key event.stopPropagation(); event.preventDefault(); var query = $searchField.val(); - if (event.keyCode === 27) { + if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) { query = null; } diff --git a/src/utils/KeyEvent.js b/src/utils/KeyEvent.js new file mode 100644 index 00000000000..de3eff06bd0 --- /dev/null +++ b/src/utils/KeyEvent.js @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + + +/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ +/*global define, $, window */ + +/** + * Utilities for working with Deferred, Promise, and other asynchronous processes. + */ +define({ + DOM_VK_CANCEL: 3, + DOM_VK_HELP: 6, + DOM_VK_BACK_SPACE: 8, + DOM_VK_TAB: 9, + DOM_VK_CLEAR: 12, + DOM_VK_RETURN: 13, + DOM_VK_ENTER: 14, + DOM_VK_SHIFT: 16, + DOM_VK_CONTROL: 17, + DOM_VK_ALT: 18, + DOM_VK_PAUSE: 19, + DOM_VK_CAPS_LOCK: 20, + DOM_VK_ESCAPE: 27, + DOM_VK_SPACE: 32, + DOM_VK_PAGE_UP: 33, + DOM_VK_PAGE_DOWN: 34, + DOM_VK_END: 35, + DOM_VK_HOME: 36, + DOM_VK_LEFT: 37, + DOM_VK_UP: 38, + DOM_VK_RIGHT: 39, + DOM_VK_DOWN: 40, + DOM_VK_PRINTSCREEN: 44, + DOM_VK_INSERT: 45, + DOM_VK_DELETE: 46, + DOM_VK_0: 48, + DOM_VK_1: 49, + DOM_VK_2: 50, + DOM_VK_3: 51, + DOM_VK_4: 52, + DOM_VK_5: 53, + DOM_VK_6: 54, + DOM_VK_7: 55, + DOM_VK_8: 56, + DOM_VK_9: 57, + DOM_VK_SEMICOLON: 59, + DOM_VK_EQUALS: 61, + DOM_VK_A: 65, + DOM_VK_B: 66, + DOM_VK_C: 67, + DOM_VK_D: 68, + DOM_VK_E: 69, + DOM_VK_F: 70, + DOM_VK_G: 71, + DOM_VK_H: 72, + DOM_VK_I: 73, + DOM_VK_J: 74, + DOM_VK_K: 75, + DOM_VK_L: 76, + DOM_VK_M: 77, + DOM_VK_N: 78, + DOM_VK_O: 79, + DOM_VK_P: 80, + DOM_VK_Q: 81, + DOM_VK_R: 82, + DOM_VK_S: 83, + DOM_VK_T: 84, + DOM_VK_U: 85, + DOM_VK_V: 86, + DOM_VK_W: 87, + DOM_VK_X: 88, + DOM_VK_Y: 89, + DOM_VK_Z: 90, + DOM_VK_CONTEXT_MENU: 93, + DOM_VK_NUMPAD0: 96, + DOM_VK_NUMPAD1: 97, + DOM_VK_NUMPAD2: 98, + DOM_VK_NUMPAD3: 99, + DOM_VK_NUMPAD4: 100, + DOM_VK_NUMPAD5: 101, + DOM_VK_NUMPAD6: 102, + DOM_VK_NUMPAD7: 103, + DOM_VK_NUMPAD8: 104, + DOM_VK_NUMPAD9: 105, + DOM_VK_MULTIPLY: 106, + DOM_VK_ADD: 107, + DOM_VK_SEPARATOR: 108, + DOM_VK_SUBTRACT: 109, + DOM_VK_DECIMAL: 110, + DOM_VK_DIVIDE: 111, + DOM_VK_F1: 112, + DOM_VK_F2: 113, + DOM_VK_F3: 114, + DOM_VK_F4: 115, + DOM_VK_F5: 116, + DOM_VK_F6: 117, + DOM_VK_F7: 118, + DOM_VK_F8: 119, + DOM_VK_F9: 120, + DOM_VK_F10: 121, + DOM_VK_F11: 122, + DOM_VK_F12: 123, + DOM_VK_F13: 124, + DOM_VK_F14: 125, + DOM_VK_F15: 126, + DOM_VK_F16: 127, + DOM_VK_F17: 128, + DOM_VK_F18: 129, + DOM_VK_F19: 130, + DOM_VK_F20: 131, + DOM_VK_F21: 132, + DOM_VK_F22: 133, + DOM_VK_F23: 134, + DOM_VK_F24: 135, + DOM_VK_NUM_LOCK: 144, + DOM_VK_SCROLL_LOCK: 145, + DOM_VK_SEMICOLON: 186, + DOM_VK_EQUALS: 187, + DOM_VK_COMMA: 188, + DOM_VK_DASH: 189, + DOM_VK_PERIOD: 190, + DOM_VK_SLASH: 191, + DOM_VK_BACK_QUOTE: 192, + DOM_VK_OPEN_BRACKET: 219, + DOM_VK_BACK_SLASH: 220, + DOM_VK_CLOSE_BRACKET: 221, + DOM_VK_QUOTE: 222, + DOM_VK_META: 224 + +}); \ No newline at end of file diff --git a/src/widgets/PopUpManager.js b/src/widgets/PopUpManager.js index e989bda4379..f7c3d0986fc 100644 --- a/src/widgets/PopUpManager.js +++ b/src/widgets/PopUpManager.js @@ -31,7 +31,8 @@ define(function (require, exports, module) { "use strict"; - var EditorManager = require("editor/EditorManager"); + var EditorManager = require("editor/EditorManager"), + KeyEvent = require("utils/KeyEvent"); var _popUps = []; @@ -82,7 +83,7 @@ define(function (require, exports, module) { } function _keydownCaptureListener(keyEvent) { - if (keyEvent.keyCode !== 27) { // escape key + if (keyEvent.keyCode !== KeyEvent.DOM_VK_ESCAPE) { // escape key return; } diff --git a/test/spec/CodeHint-test.js b/test/spec/CodeHint-test.js index 73414ded90f..7b1784a74dc 100644 --- a/test/spec/CodeHint-test.js +++ b/test/spec/CodeHint-test.js @@ -31,6 +31,7 @@ define(function (require, exports, module) { var HTMLUtils = require("language/HTMLUtils"), SpecRunnerUtils = require("spec/SpecRunnerUtils"), Editor = require("editor/Editor").Editor, + KeyEvent = require("utils/KeyEvent"), EditorManager, // loaded from brackets.test CodeHintManager; @@ -103,7 +104,7 @@ define(function (require, exports, module) { // simulate Ctrl+space keystroke to invoke code hints menu runs(function () { var e = $.Event("keydown"); - e.keyCode = 32; // spacebar key + e.keyCode = KeyEvent.DOM_VK_SPACE; // spacebar key e.ctrlKey = true; editor = EditorManager.getCurrentFullEditor(); From 3de4d78c70391fdda2beae983229bf627980db9d Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Fri, 7 Sep 2012 09:38:20 -0700 Subject: [PATCH 2/8] removed dupe definitions for DOM_VK_EQUALS and DOM_VK_SEMICOLON --- src/utils/KeyEvent.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/utils/KeyEvent.js b/src/utils/KeyEvent.js index de3eff06bd0..dd1a920bd93 100644 --- a/src/utils/KeyEvent.js +++ b/src/utils/KeyEvent.js @@ -64,8 +64,6 @@ define({ DOM_VK_7: 55, DOM_VK_8: 56, DOM_VK_9: 57, - DOM_VK_SEMICOLON: 59, - DOM_VK_EQUALS: 61, DOM_VK_A: 65, DOM_VK_B: 66, DOM_VK_C: 67, @@ -136,7 +134,7 @@ define({ DOM_VK_NUM_LOCK: 144, DOM_VK_SCROLL_LOCK: 145, DOM_VK_SEMICOLON: 186, - DOM_VK_EQUALS: 187, + DOM_VK_EQUALS: 187, DOM_VK_COMMA: 188, DOM_VK_DASH: 189, DOM_VK_PERIOD: 190, From a7f7d52c8508c8659369eae9d3d8cd54c3bfe0a6 Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Fri, 7 Sep 2012 12:07:16 -0700 Subject: [PATCH 3/8] fixed comment + indents, updated widgets/Dialogs to make use of KeyEvent module --- src/utils/KeyEvent.js | 4 ++-- src/widgets/Dialogs.js | 9 +++++---- src/widgets/PopUpManager.js | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/utils/KeyEvent.js b/src/utils/KeyEvent.js index dd1a920bd93..d195dcf198a 100644 --- a/src/utils/KeyEvent.js +++ b/src/utils/KeyEvent.js @@ -26,7 +26,7 @@ /*global define, $, window */ /** - * Utilities for working with Deferred, Promise, and other asynchronous processes. + * Utilities module to provide constants for keyCodes */ define({ DOM_VK_CANCEL: 3, @@ -134,7 +134,7 @@ define({ DOM_VK_NUM_LOCK: 144, DOM_VK_SCROLL_LOCK: 145, DOM_VK_SEMICOLON: 186, - DOM_VK_EQUALS: 187, + DOM_VK_EQUALS: 187, DOM_VK_COMMA: 188, DOM_VK_DASH: 189, DOM_VK_PERIOD: 190, diff --git a/src/widgets/Dialogs.js b/src/widgets/Dialogs.js index 905c89cf461..36840011b7b 100644 --- a/src/widgets/Dialogs.js +++ b/src/widgets/Dialogs.js @@ -33,7 +33,8 @@ define(function (require, exports, module) { require("utils/Global"); - var KeyBindingManager = require("command/KeyBindingManager"); + var KeyBindingManager = require("command/KeyBindingManager"), + KeyEvent = require("utils/KeyEvent"); var DIALOG_BTN_CANCEL = "cancel", DIALOG_BTN_OK = "ok", @@ -66,12 +67,12 @@ define(function (require, exports, module) { buttonId = null, which = String.fromCharCode(e.which); - if (e.which === 13) { + if (e.which === KeyEvent.DOM_VK_RETURN) { // Click primary button if (primaryBtn) { buttonId = primaryBtn.attr("data-button-id"); } - } else if (e.which === 32) { + } else if (e.which === KeyEvent.DOM_VK_SPACE) { // Space bar on focused button this.find(".dialog-button:focus").click(); } else if (brackets.platform === "mac") { @@ -81,7 +82,7 @@ define(function (require, exports, module) { buttonId = DIALOG_BTN_DONTSAVE; } // FIXME (issue #418) CMD+. Cancel swallowed by native shell - } else if (e.metaKey && (e.which === 190)) { + } else if (e.metaKey && (e.which === KeyEventDOM_VK_PERIOD)) { buttonId = DIALOG_BTN_CANCEL; } } else { // if (brackets.platform === "win") { diff --git a/src/widgets/PopUpManager.js b/src/widgets/PopUpManager.js index f7c3d0986fc..29bebc82710 100644 --- a/src/widgets/PopUpManager.js +++ b/src/widgets/PopUpManager.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, $, brackets, window */ +/*global define, brackets */ /** * Utilities for managing pop-ups. @@ -32,7 +32,7 @@ define(function (require, exports, module) { "use strict"; var EditorManager = require("editor/EditorManager"), - KeyEvent = require("utils/KeyEvent"); + KeyEvent = require("utils/KeyEvent"); var _popUps = []; From ce51302affec75647826e6e72290c413eaa3e15c Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Mon, 10 Sep 2012 11:10:18 -0700 Subject: [PATCH 4/8] added KeyEvent util to KeyBindingManager.js and CodeHintManager.js --- src/command/KeyBindingManager.js | 25 +++++++++++++------------ src/editor/CodeHintManager.js | 15 ++++++++------- src/utils/KeyEvent.js | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index 8b4314193f4..a6f0ee6f669 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -33,7 +33,8 @@ define(function (require, exports, module) { require("utils/Global"); - var CommandManager = require("command/CommandManager"); + var CommandManager = require("command/CommandManager"), + KeyEvent = require("utils/KeyEvent"); /** * Maps normalized shortcut descriptor to key binding info. @@ -181,27 +182,27 @@ define(function (require, exports, module) { **/ function _mapKeycodeToKey(keycode, key) { switch (keycode) { - case 186: + case KeyEvent.DOM_VK_SEMICOLON: return ";"; - case 187: + case KeyEvent.DOM_VK_EQUALS: return "="; - case 188: + case KeyEvent.DOM_VK_COMMA: return ","; - case 189: + case KeyEvent.DOM_VK_DASH: return "-"; - case 190: + case KeyEvent.DOM_VK_PERIOD: return "."; - case 191: + case KeyEvent.DOM_VK_SLASH: return "/"; - case 192: + case KeyEvent.DOM_VK_BACK_QUOTE: return "`"; - case 219: + case KeyEvent.DOM_VK_OPEN_BRACKET: return "["; - case 220: + case KeyEvent.DOM_VK_BACK_SLASH: return "\\"; - case 221: + case KeyEvent.DOM_VK_CLOSE_BRACKET: return "]"; - case 222: + case KeyEvent.DOM_VK_QUOTE: return "'"; default: return key; diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index 18b178436c2..3d641eec863 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -34,7 +34,8 @@ define(function (require, exports, module) { StringUtils = require("utils/StringUtils"), EditorManager = require("editor/EditorManager"), PopUpManager = require("widgets/PopUpManager"), - ViewUtils = require("utils/ViewUtils"); + ViewUtils = require("utils/ViewUtils"), + KeyEvent = require("utils/KeyEvent"); var hintProviders = [], @@ -178,20 +179,20 @@ define(function (require, exports, module) { // Up arrow, down arrow and enter key are always handled here if (event.type !== "keypress" && - (keyCode === 38 || keyCode === 40 || keyCode === 13 || - keyCode === 33 || keyCode === 34)) { + (keyCode === KeyEvent.DOM_VK_UP || keyCode === KeyEvent.DOM_VK_DOWN || keyCode === KeyEvent.DOM_VK_RETURN || + keyCode === KeyEvent.DOM_VK_PAGE_UP || keyCode === KeyEvent.DOM_VK_PAGE_DOWN)) { if (event.type === "keydown") { - if (keyCode === 38) { + if (keyCode === KeyEvent.DOM_VK_UP) { // Up arrow this.setSelectedIndex(this.selectedIndex - 1); - } else if (keyCode === 40) { + } else if (keyCode === KeyEvent.DOM_VK_DOWN) { // Down arrow this.setSelectedIndex(this.selectedIndex + 1); - } else if (keyCode === 33) { + } else if (keyCode === KeyEvent.DOM_VK_PAGE_UP) { // Page Up this.setSelectedIndex(this.selectedIndex - this.getItemsPerPage()); - } else if (keyCode === 34) { + } else if (keyCode === KeyEvent.DOM_VK_PAGE_DOWN) { // Page Down this.setSelectedIndex(this.selectedIndex + this.getItemsPerPage()); } else { diff --git a/src/utils/KeyEvent.js b/src/utils/KeyEvent.js index d195dcf198a..3be26b593bf 100644 --- a/src/utils/KeyEvent.js +++ b/src/utils/KeyEvent.js @@ -134,7 +134,7 @@ define({ DOM_VK_NUM_LOCK: 144, DOM_VK_SCROLL_LOCK: 145, DOM_VK_SEMICOLON: 186, - DOM_VK_EQUALS: 187, + DOM_VK_EQUALS: 187, DOM_VK_COMMA: 188, DOM_VK_DASH: 189, DOM_VK_PERIOD: 190, From 92a58c9e2a6c6afc5335cafaaa3dffd802c02f6a Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Wed, 12 Sep 2012 13:33:54 -0700 Subject: [PATCH 5/8] remove unnecessary global define --- src/utils/KeyEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/KeyEvent.js b/src/utils/KeyEvent.js index 3be26b593bf..7543040d206 100644 --- a/src/utils/KeyEvent.js +++ b/src/utils/KeyEvent.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, $, window */ +/*global define */ /** * Utilities module to provide constants for keyCodes From 064e58c680d3c4655fd463146be2803c7fd4da54 Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Wed, 12 Sep 2012 13:57:41 -0700 Subject: [PATCH 6/8] add global $ t satisfy JSLint --- src/widgets/PopUpManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/PopUpManager.js b/src/widgets/PopUpManager.js index 29bebc82710..b7d6b4c6b7f 100644 --- a/src/widgets/PopUpManager.js +++ b/src/widgets/PopUpManager.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, brackets */ +/*global define, $, brackets */ /** * Utilities for managing pop-ups. From bd175a4a64af3f4e46695c8468f59b40500ee0df Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Wed, 12 Sep 2012 14:00:34 -0700 Subject: [PATCH 7/8] add global window to satisfy JSLint --- src/widgets/PopUpManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/PopUpManager.js b/src/widgets/PopUpManager.js index b7d6b4c6b7f..62e888836ac 100644 --- a/src/widgets/PopUpManager.js +++ b/src/widgets/PopUpManager.js @@ -23,7 +23,7 @@ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ -/*global define, $, brackets */ +/*global define, window, $, brackets */ /** * Utilities for managing pop-ups. From 951247cb2a361ad16a9c55a51f9ead56522b30a7 Mon Sep 17 00:00:00 2001 From: Jacques Couzteau Date: Wed, 12 Sep 2012 14:08:44 -0700 Subject: [PATCH 8/8] fix typo --- src/widgets/Dialogs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/Dialogs.js b/src/widgets/Dialogs.js index 36840011b7b..dc56282eff2 100644 --- a/src/widgets/Dialogs.js +++ b/src/widgets/Dialogs.js @@ -82,7 +82,7 @@ define(function (require, exports, module) { buttonId = DIALOG_BTN_DONTSAVE; } // FIXME (issue #418) CMD+. Cancel swallowed by native shell - } else if (e.metaKey && (e.which === KeyEventDOM_VK_PERIOD)) { + } else if (e.metaKey && (e.which === KeyEvent.DOM_VK_PERIOD)) { buttonId = DIALOG_BTN_CANCEL; } } else { // if (brackets.platform === "win") {