Remove hash params from url

Load settings are now stored on the browser window.
This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-06-11 11:17:16 -07:00
parent a57c5c7c93
commit bcc16fbefe
8 changed files with 20 additions and 37 deletions

View File

@@ -7,25 +7,19 @@ remote = require 'remote'
crypto = require 'crypto'
window.atom =
exitWhenDone: window.location.params.exitWhenDone
devMode: window.location.params.devMode
loadedThemes: []
loadedPackages: {}
activePackages: {}
packageStates: {}
getLoadSettings: ->
remote.getCurrentWindow().loadSettings
getPathToOpen: ->
window.location.params.pathToOpen
@getLoadSettings().pathToOpen
setPathToOpen: (pathToOpen) ->
window.location.params.pathToOpen = pathToOpen
@saveWindowParameters()
saveWindowParameters: ->
hashSegments = []
for name, value of window.location.params
hashSegments.push("#{encodeURIComponent(name)}=#{encodeURIComponent(value)}")
window.location.hash = '#' + hashSegments.join('&')
@getLoadSettings().pathToOpen = pathToOpen
getPackageState: (name) ->
@packageStates[name]
@@ -211,7 +205,6 @@ window.atom =
remote.getCurrentWindow().toggleDevTools()
reload: ->
@saveWindowParameters()
remote.getCurrentWindow().restart()
focus: ->

View File

@@ -18,6 +18,8 @@ windowEventHandler = null
# This method is called in any window needing a general environment, including specs
window.setUpEnvironment = ->
window.resourcePath = remote.getCurrentWindow().loadSettings.resourcePath
Config = require 'config'
Syntax = require 'syntax'
Pasteboard = require 'pasteboard'