diff --git a/extensions-to-port/project/index.coffee b/extensions-to-port/project/index.coffee deleted file mode 100644 index e677baaf7..000000000 --- a/extensions-to-port/project/index.coffee +++ /dev/null @@ -1 +0,0 @@ -module.exports = Project = require 'project/project' diff --git a/extensions-to-port/project/project.coffee b/extensions-to-port/project/project.coffee deleted file mode 100644 index d8453d27f..000000000 --- a/extensions-to-port/project/project.coffee +++ /dev/null @@ -1,45 +0,0 @@ -_ = require 'underscore' - -File = require 'fs' -Extension = require 'extension' -ProjectPane = require 'project/projectpane' - -module.exports = -class Project extends Extension - keymap: -> - 'Command-Ctrl-N': -> @pane.toggle() - - storageNamespace: -> - @.constructor.name + @window.path - - constructor: (args...) -> - super args... - - @pane = new ProjectPane @window, @ - @pane.toggle() - - @window.on 'open', ({filename}) => - if File.isDirectory filename - @pane.reload filename # I don't think this can ever happen. - else - openedPaths = @get 'openedPaths', [] - if not _.include openedPaths, filename - openedPaths.push filename - @set 'openedPaths', openedPaths - - @window.on 'close', ({filename}) => - if File.isFile filename - openedPaths = @get 'openedPaths', [] - openedPaths = _.without openedPaths, filename - @set 'openedPaths', openedPaths - - load: -> - # Reopen files (remove ones that no longer exist) - openedPaths = @get 'openedPaths', [] - for path in openedPaths - if File.isFile path - @window.open path - else if not File.exists path - openedPaths = _.without openedPaths, path - @set 'openedPaths', openedPaths - diff --git a/extensions-to-port/project/projectpane.coffee b/extensions-to-port/project/projectpane.coffee deleted file mode 100644 index 83d82cfcc..000000000 --- a/extensions-to-port/project/projectpane.coffee +++ /dev/null @@ -1,71 +0,0 @@ -$ = require 'jquery' -_ = require 'underscore' - -File = require 'fs' -Pane = require 'pane' - -module.exports = -class ProjectPane extends Pane - position: 'left' - - project: null - - html: $ require "project/project.html" - - constructor: (@window, @project) -> - super @window - - @reload() - - $('#project li').live 'click', (event) => - return true if event.__projectClicked__ - - $('#project .active').removeClass 'active' - el = $(event.currentTarget) - path = decodeURIComponent el.attr 'path' - if File.isDirectory path - openedPaths = @project.get 'openedPaths', [] - if el.hasClass 'open' - openedPaths = _.without openedPaths, path - el.removeClass 'open' - el.children("ul").remove() - else - openedPaths.push path unless _.include openedPaths, path - el.addClass 'open' - list = @createList path - el.append list - - @project.set 'openedPaths', openedPaths - else - el.addClass 'active' - @window.open path - - # HACK I need the event to propogate beyond the project pane, - # but I need the project pane to ignore it. Need somehting - # cleaner here. - event.__projectClicked__ = true - - true - - reload: -> - @html.children('#project .cwd').text _.last @window.path.split '/' - fileList = @createList @window.path - fileList.addClass('files') - @html.children('#project .files').replaceWith(fileList) - - createList: (root) -> - paths = File.list root - - list = $('