From 9af38c8c53ceef668ff90912b23d28076b5db7ce Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sat, 27 Aug 2011 15:13:08 -0700 Subject: [PATCH] plugins/ (not working yet) --- Rakefile | 8 +- .../project/index.coffee | 0 plugins/project/project.css | 12 +++ plugins/project/project.html | 2 + plugins/tabs/index.coffee | 1 + {src => plugins/tabs}/tabs.coffee | 7 +- plugins/tabs/tabs.css | 86 ++++++++++++++++ plugins/tabs/tabs.html | 9 ++ src/atomicity.coffee | 7 +- static/project.html | 22 ----- static/tabs.html | 99 ------------------- 11 files changed, 125 insertions(+), 128 deletions(-) rename src/project.coffee => plugins/project/index.coffee (100%) create mode 100644 plugins/project/project.css create mode 100644 plugins/project/project.html create mode 100644 plugins/tabs/index.coffee rename {src => plugins/tabs}/tabs.coffee (79%) create mode 100644 plugins/tabs/tabs.css create mode 100644 plugins/tabs/tabs.html delete mode 100644 static/project.html delete mode 100644 static/tabs.html diff --git a/Rakefile b/Rakefile index bc374e39d..6d5defc09 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,7 @@ task :build do dest = File.join(built_dir, contents_dir, "Resources") - %w( src docs static vendor ).each do |dir| + %w( src docs static plugins vendor ).each do |dir| rm_rf File.join(dest, dir) cp_r dir, File.join(dest, dir) end @@ -19,8 +19,10 @@ task :build do "http://coffeescript.org/ - (try `npm i -g coffee-script`)" end - Dir['src/**/*.coffee'].each do |file| - sh "coffee -c #{dest}/src" + %w( src plugins ).each do |dir| + Dir["#{dir}/**/*.coffee"].each do |file| + sh "coffee -c #{dest}/#{dir}" + end end end diff --git a/src/project.coffee b/plugins/project/index.coffee similarity index 100% rename from src/project.coffee rename to plugins/project/index.coffee diff --git a/plugins/project/project.css b/plugins/project/project.css new file mode 100644 index 000000000..50b49ac2e --- /dev/null +++ b/plugins/project/project.css @@ -0,0 +1,12 @@ +ul { + margin: 0; + padding: 0; +} + +li { + list-style-type: none; +} + +li:hover { + background-color: grey; +} diff --git a/plugins/project/project.html b/plugins/project/project.html new file mode 100644 index 000000000..f6879742c --- /dev/null +++ b/plugins/project/project.html @@ -0,0 +1,2 @@ +
+ \ No newline at end of file diff --git a/plugins/tabs/index.coffee b/plugins/tabs/index.coffee new file mode 100644 index 000000000..ece5454df --- /dev/null +++ b/plugins/tabs/index.coffee @@ -0,0 +1 @@ +require('./tabs').show() \ No newline at end of file diff --git a/src/tabs.coffee b/plugins/tabs/tabs.coffee similarity index 79% rename from src/tabs.coffee rename to plugins/tabs/tabs.coffee index 4f4e3667b..d770878d4 100644 --- a/src/tabs.coffee +++ b/plugins/tabs/tabs.coffee @@ -3,11 +3,12 @@ $ = require 'jquery' {Chrome, File, Dir, Process} = require 'osx' exports.show = -> - root = OSX.NSBundle.mainBundle.resourcePath + '/HTML/' + root = OSX.NSBundle.mainBundle.resourcePath + '/plugins/tabs' tabs = OSX.NSString.stringWithContentsOfFile "#{root}/tabs.html" - edit = OSX.NSString.stringWithContentsOfFile "#{root}/editor.html" + console.log tabs +# edit = OSX.NSString.stringWithContentsOfFile "#{root}/editor.html" - Chrome.addPane 'main', tabs.replace '<%= editor %>', edit + Chrome.addPane 'main', 'derp' # events $('#tabs ul li:not(.add) a').live 'click', -> diff --git a/plugins/tabs/tabs.css b/plugins/tabs/tabs.css new file mode 100644 index 000000000..7bfe9c9b0 --- /dev/null +++ b/plugins/tabs/tabs.css @@ -0,0 +1,86 @@ +* { margin: 0; padding: 0; } +body { + font: 12px "Lucida Grande", Helvetica, Arial, serif; + overflow: hidden; +} +iframe { border: 0; } + +.clearfix:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; +} + +#tabs { + background: -webkit-gradient(linear, left top, left bottom, from(#EEEEEE), to(#D8D7D8)); + padding: 3px 0 0 0; +} + +#tabs .add a { + width: 12px; + height: 12px; + + margin-top: 2px; + margin-left: 10px; + padding: 2px; + + font-size: 15px; + font-weight: bold; + color: #fff; + text-shadow: #000 1px 1px 0; + background: #d8d7d8; + border: 1px solid #a0a0a0; + border-bottom: none; + + -webkit-border-top-right-radius: 10px 5px; + -webkit-border-top-left-radius: 10px 5px; + -webkit-box-shadow: inset 0 1px 0 white; +} +#tabs .add span { + display: block; + margin-top: -4px; +} + +#tabs ul { + list-style: none; + border-bottom: 1px solid #a0a0a0; +} +#tabs ul li { display: inline; } + +#tabs ul li.active a { + position: relative; + z-index: 1; + height: 8px; + + background: #eee; + padding-top: 4px; +} + +#tabs ul li a { + display: block; + float: left; + text-decoration: none; + position: relative; + height: 8px; + + padding: 3px 50px 7px; + margin: 0 -5px 0 0; + color: #222; + background: #d8d7d8; + + -webkit-border-top-right-radius: 10px 20px; + -webkit-border-top-left-radius: 10px 20px; + -webkit-box-shadow: inset 1px 1px 0 white; + + border: 1px solid #a0a0a0; + border-bottom: 0; +} + +.content { + -webkit-box-shadow: inset 0 1px 0 white; + -moz-box-shadow: inset 0 1px 0 white; + height: 97%; +} \ No newline at end of file diff --git a/plugins/tabs/tabs.html b/plugins/tabs/tabs.html new file mode 100644 index 000000000..088528789 --- /dev/null +++ b/plugins/tabs/tabs.html @@ -0,0 +1,9 @@ +
+ +
+ +
+
diff --git a/src/atomicity.coffee b/src/atomicity.coffee index f134ae215..4f548eda5 100644 --- a/src/atomicity.coffee +++ b/src/atomicity.coffee @@ -149,4 +149,9 @@ bindKey 'consolelog', 'Ctrl-L', (env) -> env.editor.navigateLeft() bindKey 'toggleProjectDrawer', 'Command-Ctrl-N', (env) -> - Project.toggle() \ No newline at end of file + Project.toggle() + + +## load plugins +plugins = _.map Dir.list("./plugins"), (plugin) -> + require plugin \ No newline at end of file diff --git a/static/project.html b/static/project.html deleted file mode 100644 index 680c5ccac..000000000 --- a/static/project.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
- - - \ No newline at end of file diff --git a/static/tabs.html b/static/tabs.html deleted file mode 100644 index f87132426..000000000 --- a/static/tabs.html +++ /dev/null @@ -1,99 +0,0 @@ - - -
- -
- -
- <%= editor %> -