plugins/ (not working yet)

This commit is contained in:
Chris Wanstrath
2011-08-27 15:13:08 -07:00
parent cfdce83925
commit 9af38c8c53
11 changed files with 125 additions and 128 deletions

View File

@@ -149,4 +149,9 @@ bindKey 'consolelog', 'Ctrl-L', (env) ->
env.editor.navigateLeft()
bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) ->
Project.toggle()
Project.toggle()
## load plugins
plugins = _.map Dir.list("./plugins"), (plugin) ->
require plugin

View File

@@ -1,13 +0,0 @@
$ = require 'jquery'
$ ->
dir = OSX.NSFileManager.defaultManager.currentDirectoryPath
$('#cwd').text(dir)
files = Dir.list(dir)
files = _.map files, (file) ->
listItems = _.map files, (file) ->
file = file.replace(dir, "")
"<li>#{file}</li>"
$('#files').append(listItems.join('\n'))

View File

@@ -1,31 +0,0 @@
$ = require 'jquery'
{Chrome, File, Dir, Process} = require 'osx'
exports.show = ->
root = OSX.NSBundle.mainBundle.resourcePath + '/HTML/'
tabs = OSX.NSString.stringWithContentsOfFile "#{root}/tabs.html"
edit = OSX.NSString.stringWithContentsOfFile "#{root}/editor.html"
Chrome.addPane 'main', tabs.replace '<%= editor %>', edit
# events
$('#tabs ul li:not(.add) a').live 'click', ->
$('#tabs ul .active').removeClass()
$(this).parents('li').addClass 'active'
idx = $('#tabs ul a').index this
$('.content iframe').hide().eq(idx).show().focus()
false
$('#tabs .add a').click ->
$('#tabs ul .active').removeClass()
$('#tabs ul .add').before '<li><a href="#">untitled</a></li>'
$('.content iframe').hide()
$('.content').append '<iframe src="editor.html" width="100%" height="100%"></iframe>'
$('#tabs ul .add').prev().addClass 'active'
false