mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
window loads plugins. prepping for plugin refactor
This commit is contained in:
parent
5abe161f7d
commit
4cb47ab96f
@ -1,24 +1,20 @@
|
||||
_ = require 'underscore'
|
||||
Window = require 'window'
|
||||
Plugins = require 'plugins'
|
||||
|
||||
module.exports =
|
||||
class App
|
||||
@windows: []
|
||||
|
||||
|
||||
@root: OSX.NSBundle.mainBundle.resourcePath
|
||||
|
||||
@activeWindow: null
|
||||
|
||||
@setup: ->
|
||||
@setActiveWindow new Window controller : WindowController
|
||||
@setActiveWindow new Window
|
||||
controller : WindowController
|
||||
path : localStorage.lastOpenedPath
|
||||
|
||||
# Move this someone more approriate
|
||||
if localStorage.lastOpenedPath
|
||||
@activeWindow.open localStorage.lastOpenedPath
|
||||
|
||||
Plugins.load()
|
||||
@activeWindow.document.ace._emit "loaded"
|
||||
@activeWindow.loadPlugins()
|
||||
|
||||
@setActiveWindow: (window) ->
|
||||
@activeWindow = window
|
||||
|
@ -1,12 +0,0 @@
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
|
||||
File = require 'fs'
|
||||
|
||||
exports.load = ->
|
||||
App = require 'app'
|
||||
_.map File.list(App.root + "/plugins"), (plugin) ->
|
||||
require plugin
|
||||
|
||||
_.map File.list("~/.atomicity/"), (path) ->
|
||||
require path
|
@ -1,4 +1,7 @@
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
|
||||
File = require 'fs'
|
||||
|
||||
Chrome = require 'chrome'
|
||||
Pane = require 'pane'
|
||||
@ -26,10 +29,22 @@ class Window
|
||||
for shortcut, method of @keymap()
|
||||
bindKey @, shortcut, method
|
||||
|
||||
@nswindow = @controller?.window
|
||||
|
||||
loadPlugins: ->
|
||||
Editor = require 'editor'
|
||||
@document = new Editor
|
||||
|
||||
@nswindow = @controller?.window
|
||||
@open @path if @path?
|
||||
|
||||
App = require 'app'
|
||||
_.map File.list(App.root + "/plugins"), (plugin) ->
|
||||
require plugin
|
||||
|
||||
_.map File.list("~/.atomicity/"), (path) ->
|
||||
require path
|
||||
|
||||
@document.ace._emit "loaded"
|
||||
|
||||
addPane: ({position, html}) ->
|
||||
verticalDiv = $('#app-vertical')
|
||||
|
Loading…
Reference in New Issue
Block a user