move ~/.atomicity loading into plugins.coffee

This commit is contained in:
Chris Wanstrath
2011-08-28 01:47:36 -07:00
parent c31111099a
commit 223e39a617
2 changed files with 14 additions and 15 deletions

View File

@@ -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