From 223e39a617c53520f79510b1930360dce4e149cb Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 28 Aug 2011 01:47:36 -0700 Subject: [PATCH] move ~/.atomicity loading into plugins.coffee --- src/editor.coffee | 14 -------------- src/plugins.coffee | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index 78fcc3b7e..9d98acac8 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -23,20 +23,6 @@ define (require, exports, module) -> editor.resize() , 50 - if css = File.read "~/.atomicity/twilight.css" - head = $('head')[0] - style = document.createElement 'style' - rules = document.createTextNode css - style.type = 'text/css' - style.appendChild rules - head.appendChild style - - _.map Dir.list("~/.atomicity/"), (path) -> - if /\.js$/.test path - $.getScript path - else if /\.coffee/.test path - eval CoffeeScript.compile File.read path - filename = null editor.getSession().on 'change', -> Chrome.setDirty true diff --git a/src/plugins.coffee b/src/plugins.coffee index 626fc5d5f..7f2ea2c55 100644 --- a/src/plugins.coffee +++ b/src/plugins.coffee @@ -1,4 +1,5 @@ -{Chrome, Dir} = require 'osx' +{Chrome, Dir, File} = require 'osx' + _.map Dir.list(Chrome.appRoot() + "/plugins"), (plugin) -> try @@ -6,3 +7,15 @@ _.map Dir.list(Chrome.appRoot() + "/plugins"), (plugin) -> catch e name = _.last plugin.split '/' console.error "Problem loading plugin #{name}: #{e.message}" + + +if css = File.read "~/.atomicity/twilight.css" + head = $('head')[0] + style = document.createElement 'style' + rules = document.createTextNode css + style.type = 'text/css' + style.appendChild rules + head.appendChild style + +_.map Dir.list("~/.atomicity/"), (path) -> + require path