mirror of
https://github.com/atom/atom.git
synced 2026-02-17 18:11:29 -05:00
Add reload and toggle dev tools key bindings to test window
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
# Start the crash reporter before anything else.
|
||||
require('crash-reporter').start(productName: 'Atom', companyName: 'GitHub')
|
||||
|
||||
path = require 'path'
|
||||
|
||||
|
||||
ipc = require 'ipc'
|
||||
ipc.send('call-window-method', 'openDevTools')
|
||||
|
||||
|
||||
try
|
||||
path = require 'path'
|
||||
ipc = require 'ipc'
|
||||
|
||||
require '../src/window'
|
||||
Atom = require '../src/atom'
|
||||
window.atom = new Atom
|
||||
@@ -17,6 +13,15 @@ try
|
||||
# that are focused in the very first spec run.
|
||||
atom.getCurrentWindow().show() unless atom.getLoadSettings().headless
|
||||
|
||||
window.addEventListener 'keydown', (event) ->
|
||||
# Reload: cmd-r / ctrl-r
|
||||
if (event.metaKey or event.ctrlKey) and event.keyCode is 82
|
||||
ipc.send('call-window-method', 'restart')
|
||||
|
||||
# Toggle Dev Tools: cmd-alt-i / ctrl-alt-i
|
||||
if (event.metaKey or event.ctrlKey) and event.altKey and event.keyCode is 73
|
||||
ipc.send('call-window-method', 'toggleDevTools')
|
||||
|
||||
# Add 'exports' to module search path.
|
||||
exportsPath = path.join(atom.getLoadSettings().resourcePath, 'exports')
|
||||
require('module').globalPaths.push(exportsPath)
|
||||
|
||||
Reference in New Issue
Block a user