Made App a fake singleton. It only has class methods and variables.

This commit is contained in:
Corey Johnson
2011-09-20 11:06:03 -07:00
parent c22587ab66
commit e60fa30daa
5 changed files with 54 additions and 72 deletions

View File

@@ -1,6 +1,6 @@
$ = require 'jquery'
App = require 'app'
Chrome = require 'chrome'
Pane = require 'pane'
module.exports =
@@ -17,6 +17,12 @@ class Window extends Pane
'Command-Ctrl-K' : 'showConsole'
'Command-Ctrl-R' : 'reload'
constructor: (options={}) ->
super options
Editor = require 'editor'
@document = new Editor
initialize: ->
@nswindow = @controller?.window
@@ -44,7 +50,7 @@ class Window extends Pane
@controller.close()
reload: ->
App.newWindow()
Chrome.newWindow()
@close()
isDirty: ->
@@ -58,14 +64,15 @@ class Window extends Pane
@_inspector ?= WindowController.webView.inspector
new: ->
App.newWindow()
Chrome.newWindow()
open: (path) ->
@document?.open path
openURL: (url) ->
if url = prompt "Enter URL:"
App.openURL url
Chrome = require 'app'
Chrome.openURL url
showConsole: ->
@inspector().showConsole(1)