mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Remove hash params from url
Load settings are now stored on the browser window.
This commit is contained in:
@@ -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: ->
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user