mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
WIP: pushing message id to front of message data so browser process can reply
This commit is contained in:
@@ -1,2 +1,20 @@
|
||||
messageIdCounter = 1
|
||||
|
||||
originalSendMessageToBrowserProcess = atom.sendMessageToBrowserProcess
|
||||
|
||||
atom.pendingBrowserProcessCallbacks = {}
|
||||
|
||||
atom.sendMessageToBrowserProcess = (name, data, callback) ->
|
||||
messageId = messageIdCounter++
|
||||
data.unshift(messageId)
|
||||
pendingBrowserProcessCallbacks[messageId] = callback
|
||||
|
||||
atom.open = (args...) ->
|
||||
@sendMessageToBrowserProcess('open', args)
|
||||
|
||||
atom.confirm = (prompt, buttonsAndCallbacks...) ->
|
||||
console.log prompt, buttonsAndCallbacks
|
||||
|
||||
atom.confirm "Are you sure?",
|
||||
"Yes", (-> )
|
||||
"No", (-> )
|
||||
|
||||
Reference in New Issue
Block a user