Skip to content

Commit

Permalink
hello use strict. and other code style changes. and gulpfile mods. an…
Browse files Browse the repository at this point in the history
…d other goodness
  • Loading branch information
designfrontier committed Apr 29, 2014
1 parent f4f6a2d commit 59add62
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var gulp = require('gulp')
, concat = require('gulp-concat')
, uglify = require('gulp-uglify')
, rename = require('gulp-rename')
, zip = require('gulp-zip')
, jshint = require('gulp-jshint')

, pkg = require('./package.json');

Expand All @@ -20,10 +22,12 @@ gulp.task('localBuild', function(){

gulp.src(['public/javascripts/app.js', './public/javascripts/components/**/*.js','!./public/javascripts/components/**/*_test.js'])
.pipe(concat('app.js'))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(gulp.dest('public/javascripts/built/'));
});

gulp.task('publish', function(){
gulp.task('generateForPublish', function(){
'use strict';

gulp.src('public/javascripts/action.js')
Expand All @@ -34,6 +38,14 @@ gulp.task('publish', function(){
.pipe(gulp.dest('packages/' + pkg.version + '/'));
});

gulp.task('publish', ['generateForPublish'], function(){
'use strict';

// gulp.src(['packages/' + pkg.version + '/*.js'])
// .pipe(zip('action.zip'))
// .pipe(gulp.dest('packages/' + pkg.version + '/'));
});

// gulp.task('default', function () {
// watch({ glob: ['public/javascripts/app.js', 'public/javascripts/components/**/*.js'], emitOnGlob: false })
// .pipe(plumber())
Expand Down
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.compress());
app.use(express.static(path.join(__dirname, 'public')));

// development only
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"gulp-uglify": "^0.2.1",
"gulp-plumber": "^0.6.0",
"gulp-watch": "^0.5.4",
"gulp-rename": "^1.2.0"
"gulp-rename": "^1.2.0",
"gulp-zip": "^0.3.4",
"gulp-jshint": "^1.5.5"
}
}
2 changes: 1 addition & 1 deletion public/javascripts/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var action = function(){
}

if(eventStack[i].once){
that.silenceLocal(eventNameIn, eventStack[i].call, true, isLocal);
that.silence(eventNameIn, eventStack[i].call, true, isLocal);
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions public/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ angLee = action.modelMe({
, role: 'Director'

, init: function(){
'use strict';

var that = this;

that.listen('cast:movie', function () {
Expand All @@ -15,10 +17,14 @@ angLee = action.modelMe({
}

, castingCall: function(){
'use strict';

this.emit('actor:cast');
}

, castingSelection: function(){
'use strict';

this.emit('actor:choose');
}
});
Expand All @@ -27,6 +33,8 @@ currentActor = action.eventMe({
actors: []

, init: function(){
'use strict';

var that = this;

that.listen('actor:me', function(actor){
Expand All @@ -51,5 +59,7 @@ currentActor = action.eventMe({
});

action.listen('actor:change', function(actor){
'use strict';

$('.currentActorName').text(actor.get('name'));
});
2 changes: 2 additions & 0 deletions public/javascripts/components/actorPicture.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$(function(){
'use strict';

action.listen('actor:change', function(actor){
$('#actorImage').attr('src', actor.get('image'));
});
Expand Down
2 changes: 2 additions & 0 deletions public/javascripts/components/actors/dustinHoffman.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 59add62

Please sign in to comment.