From e90f19da978c547af69cb7274b71b10666e9fa1e Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 14 Nov 2013 14:26:25 -0800 Subject: [PATCH] Rename keystrokeByCommmand to keystrokesByCommmand --- src/browser/application-menu.coffee | 20 ++++++++++---------- src/browser/atom-application.coffee | 4 ++-- src/menu-manager.coffee | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index a7b2f485f..7b8844bad 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -20,11 +20,11 @@ class ApplicationMenu # # * template: # The Object which describes the menu to display. - # * keystrokeByCommand: + # * keystrokesByCommand: # An Object where the keys are commands and the values are Arrays containing # the keystroke. - update: (template, keystrokeByCommand) -> - @translateTemplate(template, keystrokeByCommand) + update: (template, keystrokesByCommand) -> + @translateTemplate(template, keystrokesByCommand) @substituteVersion(template) @menu = Menu.buildFromTemplate(template) Menu.setApplicationMenu(@menu) @@ -102,33 +102,33 @@ class ApplicationMenu # * template: # An Object conforming to atom-shell's menu api but lacking accelerator and # click properties. - # * keystrokeByCommand: + # * keystrokesByCommand: # An Object where the keys are commands and the values are Arrays containing # the keystroke. # # Returns a complete menu configuration object for atom-shell's menu API. - translateTemplate: (template, keystrokeByCommand) -> + translateTemplate: (template, keystrokesByCommand) -> template.forEach (item) => item.metadata = {} if item.command - item.accelerator = @acceleratorForCommand(item.command, keystrokeByCommand) + item.accelerator = @acceleratorForCommand(item.command, keystrokesByCommand) item.click = => global.atomApplication.sendCommand(item.command) item.metadata['windowSpecific'] = true unless /^application:/.test(item.command) - @translateTemplate(item.submenu, keystrokeByCommand) if item.submenu + @translateTemplate(item.submenu, keystrokesByCommand) if item.submenu template # Private: Determine the accelerator for a given command. # # * command: # The name of the command. - # * keystrokeByCommand: + # * keystrokesByCommand: # An Object where the keys are commands and the values are Arrays containing # the keystroke. # # Returns a String containing the keystroke in a format that can be interpreted # by atom shell to provide nice icons where available. - acceleratorForCommand: (command, keystrokeByCommand) -> - firstKeystroke = keystrokeByCommand[command]?[0] + acceleratorForCommand: (command, keystrokesByCommand) -> + firstKeystroke = keystrokesByCommand[command]?[0] return null unless firstKeystroke modifiers = firstKeystroke.split('-') diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 263a9a26f..0bc6d0add 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -176,8 +176,8 @@ class AtomApplication else @promptForPath() - ipc.on 'update-application-menu', (processId, routingId, template, keystrokeByCommand) => - @applicationMenu.update(template, keystrokeByCommand) + ipc.on 'update-application-menu', (processId, routingId, template, keystrokesByCommand) => + @applicationMenu.update(template, keystrokesByCommand) ipc.on 'run-package-specs', (processId, routingId, specDirectory) => @runSpecs({resourcePath: global.devResourcePath, specDirectory: specDirectory, exitWhenDone: false}) diff --git a/src/menu-manager.coffee b/src/menu-manager.coffee index e5f80c983..9d730122f 100644 --- a/src/menu-manager.coffee +++ b/src/menu-manager.coffee @@ -34,7 +34,7 @@ class MenuManager for mapping in atom.keymap.allMappings() when mapping.selector in selectors keystrokesByCommand[mapping.command] ?= [] keystrokesByCommand[mapping.command].push mapping.keystroke - @sendToBrowserProcess(@template, keystrokeByCommand) + @sendToBrowserProcess(@template, keystrokesByCommand) # Private loadCoreItems: -> @@ -56,9 +56,9 @@ class MenuManager # Private: OSX can't handle displaying accelerators for multiple keystrokes. # If they are sent across, it will stop processing accelerators for the rest # of the menu items. - filterMultipleKeystroke: (keystrokeByCommand) -> + filterMultipleKeystroke: (keystrokesByCommand) -> filtered = {} - for key, bindings of keystrokeByCommand + for key, bindings of keystrokesByCommand for binding in bindings continue if binding.indexOf(' ') != -1 @@ -67,6 +67,6 @@ class MenuManager filtered # Private - sendToBrowserProcess: (template, keystrokeByCommand) -> - keystrokeByCommand = @filterMultipleKeystroke(keystrokeByCommand) - ipc.sendChannel 'update-application-menu', template, keystrokeByCommand + sendToBrowserProcess: (template, keystrokesByCommand) -> + keystrokesByCommand = @filterMultipleKeystroke(keystrokesByCommand) + ipc.sendChannel 'update-application-menu', template, keystrokesByCommand