mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Making it require'y
This commit is contained in:
parent
90773a8930
commit
853980b188
@ -1,4 +1,15 @@
|
||||
# This file is the first thing loaded on startup.
|
||||
|
||||
c = AtomWindowController.alloc.initWithWindowNibName "AtomWindow"
|
||||
c.window
|
||||
modules = {}
|
||||
this.require = (path) ->
|
||||
console.log(path)
|
||||
return modules[path] if modules[path]
|
||||
|
||||
root = OSX.NSBundle.mainBundle.resourcePath + '/HTML/'
|
||||
file = OSX.NSString.stringWithContentsOfFile "#{root}/#{path}.js"
|
||||
exports = {}
|
||||
eval "(function(exports){#{file}}).call(exports, exports);"
|
||||
|
||||
modules[path] = exports
|
||||
modules[path]
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
# This is the CoffeeScript API that wraps all of Cocoa.
|
||||
|
||||
# leak
|
||||
canon = require 'pilot/canon'
|
||||
{canon} = require 'pilot/canon'
|
||||
|
||||
# Handles the UI chrome
|
||||
Chrome =
|
||||
@ -161,7 +160,9 @@ Project =
|
||||
|
||||
@showing = not @showing
|
||||
|
||||
this.Chrome = Chrome
|
||||
this.File = File
|
||||
this.Dir = Dir
|
||||
this.Project = Project
|
||||
exports ?= this
|
||||
|
||||
exports.Chrome = Chrome
|
||||
exports.File = File
|
||||
exports.Dir = Dir
|
||||
exports.Project = Project
|
||||
|
Loading…
Reference in New Issue
Block a user