mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-03 20:33:33 +03:00
Set bootstrapScript and resourcePath params in URL.
This commit is contained in:
parent
30b635527c
commit
3b87c5d84b
@ -3,6 +3,8 @@ delegate = require 'atom_delegate'
|
||||
path = require 'path'
|
||||
Window = require 'window'
|
||||
|
||||
resourcePath = path.dirname(__dirname)
|
||||
|
||||
# All opened windows.
|
||||
windows = []
|
||||
|
||||
@ -10,12 +12,24 @@ windows = []
|
||||
app.on 'window-all-closed', ->
|
||||
app.quit()
|
||||
|
||||
delegate.browserMainParts.preMainMessageLoopRun = ->
|
||||
win = new Window width: 800, height: 600, show: false
|
||||
win.loadUrl "file://#{__dirname}/../static/index.html"
|
||||
openWindowWithParams = (pairs) ->
|
||||
win = new Window width: 800, height: 600, show: false, title: 'Atom'
|
||||
|
||||
windows.push win
|
||||
win.on 'destroyed', ->
|
||||
windows.splice windows.indexOf(win), 1
|
||||
|
||||
windows.push win
|
||||
url = "file://#{resourcePath}/static/index.html"
|
||||
separator = '?'
|
||||
for pair in pairs
|
||||
url += "#{separator}#{pair.name}=#{pair.param}"
|
||||
separator = '&' if separator is '?'
|
||||
|
||||
win.loadUrl url
|
||||
win.show()
|
||||
|
||||
delegate.browserMainParts.preMainMessageLoopRun = ->
|
||||
openWindowWithParams [
|
||||
{name: 'bootstrapScript', param: 'window-bootstrap'},
|
||||
{name: 'resourcePath', param: resourcePath},
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user