Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 18 commits
  • 20 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 18, 2011
@zdennis zdennis Beginning move to coffee script. ea4723d
Commits on Aug 23, 2011
@zdennis zdennis Updating process.coffee to use "=>" for auto-binding. c2d580a
@zdennis zdennis Removing left-over semi-colons in process.coffee a7323e7
@zdennis zdennis Removing app/process_interaction.js as it is no longer used. 67a495d
@zdennis zdennis Extracting out JavaRuntime and CompassRuntime into their own files. U…
…pdating rake file to combine all coffee files into process.js.
0da9e6b
@zdennis zdennis Use -b option when compiling with coffee script so we have access to …
…the global namespace while we're converting to coffee script.
2ed4324
@zdennis zdennis Beginning to move out some application.js code into a presenter triplet. 7c1c5bc
Commits on Aug 24, 2011
@zdennis zdennis Committing to going all the way with presenter-triplets and separatio…
…n of concerns.
9829ebf
Commits on Nov 05, 2011
@zdennis zdennis Moving createProjectBySelectingDirectory to coffee-script.
* extracting ScoutAppPresenter to initialize the two main views
* extracting out presenter and views for ProjectListFooter and the ProjectMainView
7e59d85
@zdennis zdennis Moved creating a project by selecting a directory to coffee-script. 7ccfa06
@zdennis zdennis Updat Input/Output folders to include text to give hint that its the …
…sass/css folders.
f087735
@zdennis zdennis Updating projector reference when saving a project. cc56d87
@zdennis zdennis Updating comment for stubbed method. eff14b0
@zdennis zdennis Display the project directory in the configuration view for a project. eee8fc5
@zdennis zdennis Wired up removing projects in coffee-script.
* it stops any running process if there is one for that project
2eacd2d
@zdennis zdennis Merge branch 'move_to_coffeescript' 4bd1b57
@zdennis zdennis Updated how ScoutAppSpec creates/lists projects in the app. Fixes all…
… specs!
27da89e
@zdennis zdennis Merge branch 'move_to_coffeescript' edaae9e
View
13 lib/tasks/build.rake
@@ -1,5 +1,5 @@
desc "Build Scout"
-task :build => ["environment", "air:runtime:check", "air:sdk:check", "build:jruby", "build:bundle", "build:bin", "build:staticmatic", "build:config"]
+task :build => ["environment", "air:runtime:check", "air:sdk:check", "build:jruby", "build:bundle", "build:bin", "build:staticmatic", "build:config", "compile:coffee"]
namespace :build do
%w(development test production).each do |env|
@@ -53,4 +53,15 @@ namespace :build do
desc "Runs dev:clean, then dev:setup"
task :redo => ["build:clean", "build"]
+end
+
+namespace :compile do
+ task :coffee => 'environment' do
+ src = File.join Scout.root, "src/javascripts/src/"
+ src_files = Dir["#{src}/**/**.coffee"].join " "
+ puts src_files.inspect
+ dest = File.join Scout.root, "build/javascripts/app/process.js"
+ system "coffee -b -j #{dest} -c #{src_files}"
+ fail unless $?.exitstatus == 0
+ end
end
View
10 src/_layouts/default.haml
@@ -13,7 +13,7 @@
%script{:src => "../javascripts/vendor/Lawnchair.js", :type => "text/javascript"}
= yield
%script{:src => "../javascripts/app/application.js", :type => "text/javascript"}
- %script{:src => "../javascripts/app/process_interaction.js", :type => "text/javascript"}
+ %script{:src => "../javascripts/app/process.js", :type => "text/javascript"}
%script#colorize_template{:type => "text/x-jquery-tmpl"}
%div
%span{:class => "${color}"} ${string}
@@ -39,19 +39,21 @@
.option_container
%h2 Configuration
.options
-
+ .option_group.project_directory
+ %h3 Project Directory
+ ${projectDir}
.option_group.stylesheet_directories
%h3 Stylesheet Directories
.notice
%em*Required field
.option.input
- %label{:for => "sass_input"} Input Folder:
+ %label{:for => "sass_input"} Input Folder (Sass):
%button.dir_find.select_sass_dir
%span Choose
%input#sass_input.setting.sass_dir{:value => "${sassDir}"}/
%em *
.option.output
- %label{:for => "css_input"} Output Folder:
+ %label{:for => "css_input"} Output Folder (CSS):
%button.dir_find.select_css_dir
%span Choose
%input#css_input.setting.css_dir{:value => "${cssDir}"}/
View
130 src/javascripts/app/application.js
@@ -9,125 +9,10 @@ var app = {
};
},
- initialize: function() {
- app.listProjects();
- app.resizeApp();
-
- var project_list = $(".pane.project_list");
- project_list.resizable({
- handles: {e: $('.pane.project_list .footer .splitter') },
- minWidth: parseInt($(".project").css("min-width")),
- maxWidth: parseInt($(".project").css("max-width"))
- });
-
- project_list.bind("resize", app.resizeApp);
- $(window).resize(function(){
- project_list.trigger('resize');
- });
- },
-
- resizeApp: function(e, ui){
- var project_list = $(".pane.project_list"),
- list_height = $(window).height() - project_list.position().top;
- list_min_width = parseInt(project_list.css("min-width")),
- list_max_width = parseInt(project_list.css("max-width")),
- list_width = project_list.outerWidth(),
- wnd_width = $(window).width();
-
- if(list_width > list_max_width){
- list_width = list_max_width;
- } else if(list_width < list_min_width){
- list_width = list_min_width;
- }
-
- project_list.height(list_height);
- project_list.width(list_width);
-
- $("#main").css({
- width: wnd_width - list_width,
- left: list_width
- });
-
- var project_item_width = $(".project .item").width(),
- project_commands_width = $(".project .commands").outerWidth(),
- project_source_width = project_item_width - project_commands_width;
-
- if(project_source_width < 0) project_source_width = 0;
- $(".project .source").width(project_source_width);
- return false;
- },
-
- createProjectBySelectingDirectory: function() {
- browseDirectories(air.File.userDirectory.nativePath, function(evnt) {
- if(air.Capabilities.os.match(/Windows/)) {
- app.createProject({
- name: evnt.target.nativePath.replace(/\\$/, '').split('\\').last(),
- projectDir: evnt.target.nativePath
- });
- } else {
- app.createProject({
- name: evnt.target.nativePath.replace(/\/$/, '').split('/').last(),
- projectDir: evnt.target.nativePath
- });
- }
- });
- },
-
createProjectByDroppingADirectory: function(evnt){
evnt.preventDefault();
directoryPath = evnt.dataTransfer.getData("text/uri-list");
- app.createProject({
- name: directoryPath.replace(/\/$/, '').split('/').last(),
- projectDir: directoryPath
- });
- },
-
- createProject: function(options) {
- var defaults = {
- name:"",
- projectDir:"",
- sassDir:"",
- cssDir:"",
- javascriptsDir:"",
- imagesDir:"",
- environment:"development",
- outputStyle: "expanded"
- };
-
- options = $.extend(defaults, options);
-
- Projects.save({
- name: options.name,
- projectDir: options.projectDir,
- sassDir: options.sassDir,
- cssDir: options.cssDir,
- javascriptsDir: options.javascriptsDir,
- imagesDir: options.imagesDir,
- environment: options.environment,
- outputStyle: options.outputStyle
- }, function(project){
- $('.projects').trigger(':changed');
- $('.project[data-key='+project.key+']').trigger(':select_and_configure');
- });
- },
-
- listProjects: function() {
- $('.projects').empty();
- Projects.all(function(projects) {
- $.each(projects, function(i, project){
- if(project) {
- // add project to project_list
- $.tmpl($("#project_template"), project).appendTo(".projects");
- // add project details pane
- if($('.project_details[data-key='+project.key+']').length == 0){
- $.tmpl($("#project_details_template"), project).appendTo("#main");
-
- $('.project_details[data-key='+project.key+']').find("option[data-environment=" + project.environment + "]").attr("selected", "selected");
- $('.project_details[data-key='+project.key+']').find("option[data-output_style=" + project.outputStyle + "]").attr("selected", "selected");
- }
- }
- });
- });
+ // stub
},
nukeAllProjects: function(){
@@ -141,7 +26,7 @@ var app = {
});
Projects.nuke();
$('.projects').trigger(':changed');
- $('.projects').trigger('processes:killAll');
+ $('.projects').trigger('processes:stopAll');
$('.project_details').hide();
$('.non_selected').show();
},
@@ -164,11 +49,7 @@ $(document).ready(function() {
$.tmpl($('#project_template'));
$.tmpl($('#project_details_template'));
- // create new project
- $('.option.add').live('click', app.delegateTo('createProjectBySelectingDirectory'));
-
$('.content').live('drop', app.createProjectByDroppingADirectory);
- $('.projects').live(':changed', app.listProjects);
$('.project').live(':started', projectStarted);
$('.project').live(':stopped', projectStopped);
@@ -332,19 +213,20 @@ $(document).ready(function() {
setProjectState(this, "started");
}
- app.initialize();
+ new ScoutApp().initialize();
});
function deleteProject() {
- key = $(this).parents('.project_details:first').attr('data-key');
+ var project_details = $(this).parents('.project_details:first');
+ key = project_details.attr('data-key');
Projects.get(key, function(project) {
Projects.remove(project);
});
$('.project[data-key='+key+']:first').trigger('watch:stop');
$('.projects').trigger(':changed');
- $('.project_details').hide();
+ project_details.remove();
$('.non_selected').show();
return false;
View
101 src/javascripts/app/process_interaction.js
@@ -1,101 +0,0 @@
-$(function(){
- var process_map = {};
-
- $(".project").live("watch:start", startWatchingProject);
- $(".project").live("watch:stop", stopWatchingProject);
- $(".projects").live("processes:killAll", killWatchingProcesses);
- air.NativeApplication.nativeApplication.addEventListener(air.Event.EXITING, killWatchingProcesses);
-
- function startWatchingProject(evnt, data) {
- var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
- nativeProcessStartupInfo.executable = javaDir();
-
- var processArgs = new air.Vector["<String>"]();
- processArgs.push(
- '-jar', jruby_complete_jar(),
- // '-r' + jar('vendor/scout.jar'),
- '-S',
- compassExecutable(),
- "watch",
- '--require', 'ninesixty',
- '--require', 'yui',
- "--sass-dir", data.project.sassDir,
- "--css-dir", data.project.cssDir,
- "--images-dir", data.project.imagesDir,
- "--javascripts-dir", data.project.javascriptsDir,
- "--environment", data.project.environment,
- "--output-style", data.project.outputStyle,
- "--trace"
- );
- // air.trace(processArgs);
- nativeProcessStartupInfo.arguments = processArgs;
-
- process = new air.NativeProcess();
- process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, outputDataHandler);
- process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, errorDataHandler);
- process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
- process.start(nativeProcessStartupInfo);
-
- $('.project[data-key='+data.project.key+']').trigger(':started');
-
- function onExit(evnt) {
- $('.project[data-key='+data.project.key+']').trigger('watch:stop');
- }
-
- function outputDataHandler(evnt) {
- var bytes = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
- $('.project_details[data-key='+data.project.key+']').trigger(':newLogOutput', bytes.toString());
- }
-
- function errorDataHandler(evnt) {
- var bytes = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
- $('.project_details[data-key='+data.project.key+']').trigger(':newLogOutput', bytes.toString());
- }
-
- process_map[data.project.key] = process;
- }
-
- function stopWatchingProject(evnt, data) {
- var project_key = $(this).attr('data-key');
- var process = process_map[project_key];
- if(process){
- process.exit();
- delete process_map[project_key];
- $('.project[data-key='+project_key+']').trigger(':stopped');
- }
- }
-
- function killWatchingProcesses() {
- for (var i in process_map) {
- process_map[i].exit();
- }
- }
-
- function compassExecutable() {
- return air.File.applicationDirectory.resolvePath('bin/compass').nativePath;
- }
-
- function jruby_complete_jar() {
- return air.File.applicationDirectory.resolvePath('vendor/jruby-complete.jar').nativePath;
- }
-
- function jar(path) {
- // air.trace(path);
- // var app_path = air.File.applicationDirectory.resolvePath('.');
- // air.trace(app_path);
- // var jar_path = air.File.applicationDirectory.resolvePath(path);
- // air.trace(jar_path);
- // air.trace(app_path.getRelativePath(jar_path));
- // return app_path.getRelativePath(jar_path);
- return air.File.applicationDirectory.resolvePath(path).nativePath;
- }
-
- function javaDir() {
- if(air.Capabilities.os.match(/Windows/)) {
- return air.File.applicationDirectory.resolvePath("C:\\Program Files\\Java\\jre6\\bin\\java.exe");
- } else {
- return air.File.applicationDirectory.resolvePath("/usr/bin/java");
- }
- }
-
-});
View
32 src/javascripts/src/models/project_model.coffee
@@ -0,0 +1,32 @@
+class ProjectModel
+ constructor: (@attrs) ->
+
+ save: () ->
+ defaults =
+ name:"",
+ projectDir:"",
+ sassDir:"",
+ cssDir:"",
+ javascriptsDir:"",
+ imagesDir:"",
+ environment:"development",
+ outputStyle: "expanded"
+
+ options = $.extend defaults, @attrs;
+
+ saveable_attrs =
+ name: options.name,
+ projectDir: options.projectDir,
+ sassDir: options.sassDir,
+ cssDir: options.cssDir,
+ javascriptsDir: options.javascriptsDir,
+ imagesDir: options.imagesDir,
+ environment: options.environment,
+ outputStyle: options.outputStyle
+
+ Projects.save saveable_attrs, (project) =>
+ $(ProjectModel).trigger("after_save", project)
+
+
+ProjectModel.create = (attrs) ->
+ new ProjectModel(attrs).save()
View
0  src/javascripts/src/models/scout_model.coffee
No changes.
View
6 src/javascripts/src/presenters/project_list_footer_presenter.coffee
@@ -0,0 +1,6 @@
+class ProjectListFooterPresenter
+ constructor: (@view) ->
+ $(@view).bind "add_project", (event, details) ->
+ ProjectModel.create details
+
+
View
9 src/javascripts/src/presenters/project_list_presenter.coffee
@@ -0,0 +1,9 @@
+class ProjectListPresenter
+ constructor: (@view) ->
+
+ appInitialized: () ->
+ @view.listProjects()
+
+ selectAndConfigure: (project) ->
+ air.trace("stub: selecting and configuring project")
+
View
11 src/javascripts/src/presenters/scout_app_presenter.coffee
@@ -0,0 +1,11 @@
+class ScoutAppPresenter
+ constructor: (@project_list, @project_main) ->
+ $(ProjectModel).bind "after_save", (event, project) =>
+ @project_list.listProjects()
+ this.selectAndConfigure project
+
+ selectAndConfigure: (project) ->
+ @project_list.select project
+ @project_main.select project
+
+
View
80 src/javascripts/src/process.coffee
@@ -0,0 +1,80 @@
+Processes = {}
+
+class ProjectWatcher
+ constructor: (@data, @java_runtime = new JavaRuntime(), @compass_runtime = new CompassRuntime()) ->
+
+ watch: () ->
+ this.start_native_process()
+
+ stop: () ->
+ this.stop_native_process()
+
+ start_native_process: () ->
+ @process = new air.NativeProcess()
+ @process.addEventListener air.ProgressEvent.STANDARD_OUTPUT_DATA, this.output_data_handler()
+ @process.addEventListener air.ProgressEvent.STANDARD_ERROR_DATA, this.error_data_handler()
+ @process.addEventListener air.NativeProcessExitEvent.EXIT, this.on_exit()
+ @process.start this.startup_info()
+ $('.project[data-key=' + @data.project.key + ']').trigger ':started'
+
+ startup_info: () ->
+ @startup_info = new air.NativeProcessStartupInfo
+ @startup_info.arguments = this.process_args()
+ @startup_info.executable = @java_runtime.absolute_path()
+ @startup_info
+
+ process_args: () ->
+ args = new air.Vector["<String>"]()
+ args.push(
+ '-jar', air.File.applicationDirectory.resolvePath('vendor/jruby-complete.jar').nativePath,
+ '-S',
+ @compass_runtime.absolute_path(),
+ "watch",
+ '--require', 'ninesixty',
+ '--require', 'yui',
+ "--sass-dir", @data.project.sassDir,
+ "--css-dir", @data.project.cssDir,
+ "--images-dir", @data.project.imagesDir,
+ "--javascripts-dir", @data.project.javascriptsDir,
+ "--environment", @data.project.environment,
+ "--output-style", @data.project.outputStyle,
+ "--trace"
+ )
+ args
+
+ stop_native_process: () ->
+ @process.exit()
+ $('.project[data-key=' + @data.project.key + ']').trigger ':stopped'
+
+ error_data_handler: () ->
+ (event) =>
+ bytes = @process.standardError.readUTFBytes @process.standardError.bytesAvailable
+ $('.project_details[data-key=' + @data.project.key + ']').trigger ':newLogOutput', bytes.toString()
+
+ output_data_handler: () ->
+ (event) =>
+ bytes = @process.standardOutput.readUTFBytes @process.standardOutput.bytesAvailable
+ $('.project_details[data-key=' + @data.project.key + ']').trigger ':newLogOutput', bytes.toString()
+
+ on_exit: () ->
+ (event) =>
+ $('.project[data-key=' + @data.project.key + ']').trigger 'watch:stop'
+
+
+startWatchingProject = (event, data) ->
+ Processes[$(this)] = watcher = new ProjectWatcher(data)
+ watcher.watch()
+
+stopWatchingProject = (event, data) ->
+ watcher = Processes[$(this)]
+ watcher.stop() if watcher
+
+stopAllWatchers = (event, data) ->
+ watcher.stop() for project, watcher of Processes
+
+$(".project").live "watch:start", startWatchingProject
+$(".project").live "watch:stop", stopWatchingProject
+$(".projects").live "processes:stopAll", stopAllWatchers
+
+air.NativeApplication.nativeApplication.addEventListener air.Event.EXITING, stopAllWatchers
+window.nativeWindow.addEventListener air.Event.CLOSING, stopAllWatchers
View
4 src/javascripts/src/runtimes/compass_runtime.coffee
@@ -0,0 +1,4 @@
+class CompassRuntime
+ absolute_path: () ->
+ air.File.applicationDirectory.resolvePath('bin/compass').nativePath
+
View
8 src/javascripts/src/runtimes/java_runtime.coffee
@@ -0,0 +1,8 @@
+class JavaRuntime
+ absolute_path: () ->
+ if(air.Capabilities.os.match(/Windows/))
+ air.File.applicationDirectory.resolvePath("C:\\Program Files\\Java\\jre6\\bin\\java.exe")
+ else
+ air.File.applicationDirectory.resolvePath("/usr/bin/java")
+
+
View
19 src/javascripts/src/scout_app.coffee
@@ -0,0 +1,19 @@
+class ScoutApp
+ constructor: () ->
+ @project_list_footer_view = new ProjectListFooterView()
+ @project_list_footer_presenter = new ProjectListFooterPresenter @project_list_footer_view
+
+ @project_list_view = new ProjectListView()
+ @project_list_presenter = new ProjectListPresenter @project_list_view
+
+ @project_main_view = new ProjectMainView()
+
+ @scout_app_presenter = new ScoutAppPresenter @project_list_view, @project_main_view
+
+ @window = new AppWindow $(window), @project_list_view, @project_main_view
+
+ initialize: () ->
+ @project_list_presenter.appInitialized()
+ @window.appInitialized()
+
+
View
28 src/javascripts/src/scout_utils.coffee
@@ -0,0 +1,28 @@
+ScoutUtils = {}
+
+ScoutUtils.browseForDirectory = (initial_path, callback) ->
+ dir = new air.File(initial_path)
+ try
+ dir.browseForDirectory "Select Directory"
+ dir.addEventListener air.Event.SELECT, callback
+ catch err
+ air.trace "Failed", err.message
+
+ScoutUtils.createProjectBySelectingDirectory = (callback) ->
+ ScoutUtils.browseForDirectory air.File.userDirectory.nativePath, (event) ->
+ callback ScoutUtils.osIndependentDetailsForFileEvent(event)
+
+ScoutUtils.osIndependentDetailsForFileEvent = (event) ->
+ if(air.Capabilities.os.match(/Windows/))
+ name: event.target.nativePath.replace(/\\$/, '').split('\\').last(),
+ projectDir: event.target.nativePath
+ else
+ name: event.target.nativePath.replace(/\/$/, '').split('/').last(),
+ projectDir: event.target.nativePath
+
+ScoutUtils.projectSelector = (project) ->
+ '.project[data-key=' + project.key + ']'
+
+ScoutUtils.projectDetailsSelector = (project) ->
+ '.project_details[data-key=' + project.key + ']'
+
View
11 src/javascripts/src/views/app_window.coffee
@@ -0,0 +1,11 @@
+class AppWindow
+ constructor: (@window, @list_view, @main_view) ->
+
+ appInitialized: () ->
+ @window.resize =>
+ this.resize()
+
+ resize: () ->
+ @list_view.resize()
+ @main_view.resize()
+
View
11 src/javascripts/src/views/project_list_footer_view.coffee
@@ -0,0 +1,11 @@
+class ProjectListFooterView
+ constructor: () ->
+ @footer = $(".project_list .footer")
+ @add_project_btn = @footer.find(".option.add")
+ @add_project_btn.bind "click", this.addProjectByClick()
+
+ addProjectByClick: () ->
+ (event) =>
+ ScoutUtils.createProjectBySelectingDirectory (details) =>
+ $(this).trigger "add_project", details
+
View
70 src/javascripts/src/views/project_list_view.coffee
@@ -0,0 +1,70 @@
+class ProjectListView
+ constructor: () ->
+ this._makeResizable()
+ @list = $(".project_list")
+ $('.projects').live ":changed", (event) =>
+ this.listProjects()
+
+ listProjects: () ->
+ $('.projects').empty()
+ Projects.all (projects) =>
+ this._listProject project for project in projects
+
+ resize: () ->
+ this._resizeList()
+ this._resizeItems()
+
+ select: (project) ->
+ @list.find('.project').removeClass('selected')
+ @list.find(ScoutUtils.projectSelector(project)).addClass 'selected'
+
+ _resizeList: () ->
+ height = this._listHeight()
+ width = this._listWidth()
+ max_width = this._maxWidth()
+ min_width = this._minWidth()
+ wnd_width = $(window).width()
+
+ width = max_width if width > max_width
+ width = min_width if width < min_width
+
+ @list.css
+ height: height
+ width: width
+
+ _resizeItems: () ->
+ item_width = $(".project .item").width()
+ commands_width = $(".project .commands").outerWidth()
+ width = item_width - commands_width
+ width = 0 if width < 0
+ $(".project .source").width width
+
+ _maxWidth: () ->
+ parseInt @list.css("max-width")
+
+ _minWidth: () ->
+ parseInt @list.css("min-width")
+
+ _listWidth: () ->
+ @list.outerWidth()
+
+ _listHeight: () ->
+ $(window).height() - @list.position().top
+
+ _listProject: (project) ->
+ if project
+ $.tmpl($("#project_template"), project).appendTo(".projects")
+
+ if($('.project_details[data-key='+project.key+']').length == 0)
+ $.tmpl($("#project_details_template"), project).appendTo("#main")
+ $('.project_details[data-key='+project.key+']').find("option[data-environment=" + project.environment + "]").attr("selected", "selected")
+ $('.project_details[data-key='+project.key+']').find("option[data-output_style=" + project.outputStyle + "]").attr("selected", "selected")
+
+ _makeResizable: () ->
+ resize_handles =
+ e: $('.pane.project_list .footer .splitter')
+
+ $(".project_list.pane").resizable
+ handles: resize_handles
+ minWidth: parseInt $(".project").css("min-width")
+ maxWidth: parseInt $(".project").css("max-width")
View
14 src/javascripts/src/views/project_main_view.coffee
@@ -0,0 +1,14 @@
+class ProjectMainView
+ constructor: () ->
+ @main = $("#main")
+
+ resize: () ->
+ @main.css
+ width: $(window).width() - $(".project_list").width(),
+ left: $(".project_list").width()
+
+ select: (project) ->
+ @main.find('.project_details').removeClass 'selected'
+ @main.find(ScoutUtils.projectDetailsSelector(project)).addClass 'selected'
+
+
View
36 src/spec/spec/ScoutAppSpec.js
@@ -13,11 +13,11 @@ function wait(millis) {
describe("Compass App", function(){
beforeEach(function() {
// stubs
- app.createProjectBySelectingDirectory = function(callback){
- app.createProject({
+ ScoutUtils.createProjectBySelectingDirectory = function(callback){
+ new ProjectModel({
name: "project-a",
projectDir: "/some/path/project-a"
- });
+ }).save();
};
app.nukeAllProjects();
});
@@ -52,15 +52,15 @@ describe("Compass App", function(){
describe("adding multiple projects", function(){
beforeEach(function(){
Projects.save({name: 'project-a'});
- app.listProjects();
+ $(".projects").trigger(":changed");
});
it("lists both projects", function(){
- app.createProjectBySelectingDirectory = function(callback){
- app.createProject({
+ ScoutUtils.createProjectBySelectingDirectory = function(callback){
+ new ProjectModel({
name: "project-b",
projectDir: "/some/path/project-b"
- });
+ }).save();
};
$(".option.add").click();
expect($(".project:visible").length).toBe(2);
@@ -69,15 +69,15 @@ describe("Compass App", function(){
describe("editing a project in the project list", function(){
beforeEach(function(){
- app.createProject({
+ new ProjectModel({
name: "project-a",
projectDir: "/project-a/",
sassDir: "/project-a/sass",
cssDir: "/project-a/css",
javascriptsDir: "/project-a/js",
imagesDir: "/project-a/images"
- });
- app.listProjects();
+ }).save();
+ $(".projects").trigger(":changed");
this.project = $(".project:contains('project-a')");
});
@@ -150,23 +150,23 @@ describe("Compass App", function(){
describe("switching between projects", function(){
beforeEach(function(){
- app.createProject({
+ new ProjectModel({
name: "project-a",
projectDir: "/project-a/",
sassDir: "/project-a/sass",
cssDir: "/project-a/css",
javascriptsDir: "/project-a/js",
imagesDir: "/project-a/images"
- });
- app.createProject({
+ }).save();
+ new ProjectModel({
name: "project-b",
projectDir: "/project-b/",
sassDir: "/project-b/sass",
cssDir: "/project-b/css",
javascriptsDir: "/project-b/js",
imagesDir: "/project-b/images"
- });
- app.listProjects();
+ }).save();
+ $(".projects").trigger(":changed");
});
context("when viewing project a and the log is selected", function() {
@@ -205,15 +205,15 @@ describe("Compass App", function(){
css_dir = project_dir.resolvePath("css");
javascripts_dir = project_dir.resolvePath("js");
images_dir = project_dir.resolvePath("images");
- app.createProject({
+ new ProjectModel({
name: "project-a",
projectDir: project_dir.nativePath,
sassDir: sass_dir.nativePath,
cssDir: css_dir.nativePath,
javascriptsDir: javascripts_dir.nativePath,
imagesDir: images_dir.nativePath
- });
- app.listProjects();
+ }).save();
+ $(".projects").trigger(":changed");
this.project = $(".project:contains('project-a')");
});
View
4 src/stylesheets/partials/views/modes/_configuration.scss
@@ -31,14 +31,14 @@
.options {
min-width: 390px;
margin-top: -12px;
- padding: 52px 25px 16px;
+ padding: 25px 25px 16px;
background-color: #F8F8F8;
text-align: left;
@include border-radius(3px);
@include single-box-shadow(#BABABA, 0px, 1px, 2px, 1px, inset);
.option_group {
- margin-bottom: 36px;
+ margin-bottom: 26px;
h3 {
margin-bottom: 15px;

No commit comments for this range

Something went wrong with that request. Please try again.