Move Syntax global to Atom class

This commit is contained in:
Kevin Sawicki 2013-09-26 09:00:39 -07:00
parent 5c4a8f55c8
commit e2d727f838
2 changed files with 7 additions and 8 deletions

View File

@ -16,6 +16,7 @@ PackageManager = require './package-manager'
Pasteboard = require './pasteboard'
Project = require './project'
RootView = require './root-view'
Syntax = require './syntax'
Subscriber = require './subscriber'
ThemeManager = require './theme-manager'
ContextMenuManager = require './context-menu-manager'
@ -24,12 +25,14 @@ ContextMenuManager = require './context-menu-manager'
module.exports =
class Atom extends Subscriber
constructor: ->
@rootViewParentSelector = 'body'
@packages = new PackageManager()
@themes = new ThemeManager()
@contextMenu = new ContextMenuManager(@getLoadSettings().devMode)
@config = new Config()
@pasteboard = new Pasteboard()
@keymap = new KeyMap()
@syntax = deserialize(@getWindowState('syntax')) ? new Syntax()
getCurrentWindow: ->
remote.getCurrentWindow()
@ -72,7 +75,7 @@ class Atom extends Subscriber
@rootView = new RootView()
state.set('rootView', @rootView.getState())
$(rootViewParentSelector).append(rootView)
$(@rootViewParentSelector).append(rootView)
@subscribe @project, 'path-changed', ->
projectPath = project.getPath()

View File

@ -26,14 +26,10 @@ displayWindow = ->
# This method is called in any window needing a general environment, including specs
window.setUpEnvironment = (windowMode) ->
atom.windowMode = windowMode
#TODO remove once all packages use the atom global
window.resourcePath = atom.getLoadSettings().resourcePath
Syntax = require './syntax'
window.rootViewParentSelector = 'body'
#TODO remove once all packages use the atom globa
window.config = atom.config
window.syntax = deserialize(atom.getWindowState('syntax')) ? new Syntax
window.syntax = atom.syntax
window.pasteboard = atom.pasteboard
window.keymap = atom.keymap
@ -105,7 +101,7 @@ window.onDrop = (e) ->
window.deserializeEditorWindow = ->
atom.deserializeEditorWindow()
#TODO remove once all packages use the atom globa
#TODO remove once all packages use the atom global
window.project = atom.project
window.rootView = atom.rootView