mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-06 06:28: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'
|
path = require 'path'
|
||||||
Window = require 'window'
|
Window = require 'window'
|
||||||
|
|
||||||
|
resourcePath = path.dirname(__dirname)
|
||||||
|
|
||||||
# All opened windows.
|
# All opened windows.
|
||||||
windows = []
|
windows = []
|
||||||
|
|
||||||
@ -10,12 +12,24 @@ windows = []
|
|||||||
app.on 'window-all-closed', ->
|
app.on 'window-all-closed', ->
|
||||||
app.quit()
|
app.quit()
|
||||||
|
|
||||||
delegate.browserMainParts.preMainMessageLoopRun = ->
|
openWindowWithParams = (pairs) ->
|
||||||
win = new Window width: 800, height: 600, show: false
|
win = new Window width: 800, height: 600, show: false, title: 'Atom'
|
||||||
win.loadUrl "file://#{__dirname}/../static/index.html"
|
|
||||||
|
|
||||||
|
windows.push win
|
||||||
win.on 'destroyed', ->
|
win.on 'destroyed', ->
|
||||||
windows.splice windows.indexOf(win), 1
|
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()
|
win.show()
|
||||||
|
|
||||||
|
delegate.browserMainParts.preMainMessageLoopRun = ->
|
||||||
|
openWindowWithParams [
|
||||||
|
{name: 'bootstrapScript', param: 'window-bootstrap'},
|
||||||
|
{name: 'resourcePath', param: resourcePath},
|
||||||
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user