Add atom.showDevTools and replace calls to $native.showDevTools

This commit is contained in:
Nathan Sobo
2012-08-30 11:24:01 -06:00
parent d5ffdb153a
commit 3cc2faf7c2
9 changed files with 23 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ originalSendMessageToBrowserProcess = atom.sendMessageToBrowserProcess
atom.pendingBrowserProcessCallbacks = {}
atom.sendMessageToBrowserProcess = (name, data, callbacks) ->
atom.sendMessageToBrowserProcess = (name, data=[], callbacks) ->
messageId = messageIdCounter++
data.unshift(messageId)
callbacks = [callbacks] if typeof callbacks is 'function'
@@ -37,8 +37,11 @@ atom.confirm = (message, detailedMessage, buttonLabelsAndCallbacks...) ->
atom.showSaveDialog = (callback) ->
@sendMessageToBrowserProcess('showSaveDialog', [], callback)
atom.toggleDevTools = (args...)->
@sendMessageToBrowserProcess('toggleDevTools', args)
atom.toggleDevTools = ->
@sendMessageToBrowserProcess('toggleDevTools')
atom.showDevTools = ->
@sendMessageToBrowserProcess('showDevTools')
atom.getRootViewStateForPath = (path) ->
if json = localStorage[path]