Skip to content

Commit

Permalink
merging + linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Irene Ros committed Nov 8, 2012
2 parents 3c49277 + 8057ada commit b716e33
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 43 deletions.
2 changes: 1 addition & 1 deletion dist/LASTBUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2012/11/08 12:18
2012/11/08 12:49
4 changes: 3 additions & 1 deletion dist/miso.storyboard.0.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@
sceneName = sceneName ? sceneName.name : '';

this.publish(name, fromScene, toScene);
this.publish(sceneName + ":" + name);
if (name !== 'start' || name !== 'end') {
this.publish(sceneName + ":" + name);
}

}, this),
bailout = _.bind(function() {
Expand Down
4 changes: 3 additions & 1 deletion dist/miso.storyboard.deps.0.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5249,7 +5249,9 @@
sceneName = sceneName ? sceneName.name : '';

this.publish(name, fromScene, toScene);
this.publish(sceneName + ":" + name);
if (name !== 'start' || name !== 'end') {
this.publish(sceneName + ":" + name);
}

}, this),
bailout = _.bind(function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/miso.storyboard.deps.min.0.0.1.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/miso.storyboard.min.0.0.1.js

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

4 changes: 3 additions & 1 deletion dist/miso.storyboard.r.0.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@
sceneName = sceneName ? sceneName.name : '';

this.publish(name, fromScene, toScene);
this.publish(sceneName + ":" + name);
if (name !== 'start' || name !== 'end') {
this.publish(sceneName + ":" + name);
}

}, this),
bailout = _.bind(function() {
Expand Down
4 changes: 3 additions & 1 deletion dist/node/miso.scene.0.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ _.mixin(require("underscore.deferred"));
sceneName = sceneName ? sceneName.name : '';

this.publish(name, fromScene, toScene);
this.publish(sceneName + ":" + name);
if (name !== 'start' || name !== 'end') {
this.publish(sceneName + ":" + name);
}

}, this),
bailout = _.bind(function() {
Expand Down
4 changes: 3 additions & 1 deletion src/storyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@
sceneName = sceneName ? sceneName.name : '';

this.publish(name, fromScene, toScene);
this.publish(sceneName + ":" + name);
if (name !== 'start' || name !== 'end') {
this.publish(sceneName + ":" + name);
}

}, this),
bailout = _.bind(function() {
Expand Down
2 changes: 0 additions & 2 deletions test/unit/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ test("Cloning deeply", function() {
a : new Miso.Storyboard({
enter : function() {
this.counter = 0;
console.log('a', this._id);
},
exit : function() {
this.helper();
Expand Down Expand Up @@ -117,7 +116,6 @@ test("Cloning deeply", function() {
},

helper : function() {
console.log('parent.helper', this._id, this.counter);
this.counter += 10;
}
});
Expand Down
74 changes: 41 additions & 33 deletions test/unit/scene_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,73 @@ module("Storyboard Event Integration");

test("Basic transition events", function() {

var baseEvents = [
var events = [
'start',
'x:unloaded:enter',
'enter',
'unloaded:enter',
'end',
'start',
'x:unloaded:exit',
'exit',
'unloaded:exit',
'x:loaded:enter',
'enter',
'loaded:enter',
'end',
'start',
'x:loaded:exit',
'exit',
'enter',
'end'
], baseEventsActual = [];

var sceneEvents = [
'unloaded:start',
'unloaded:enter',
'unloaded:end',
'loaded:start',
'unloaded:exit',
'loaded:enter',
'loaded:end',
'ending:start',
'loaded:exit',
'x:ending:enter',
'enter',
'ending:enter',
'ending:end'
], sceneEventsActual = [];
'end'
], actualEvents = [];

var app = new Miso.Storyboard({
initial : 'unloaded',
scenes : {
unloaded : {},
loaded : {},
ending : {}
unloaded : {
enter : function() {
actualEvents.push("x:unloaded:enter");
},
exit : function() {
actualEvents.push("x:unloaded:exit");
}
},
loaded : {
enter : function() {
actualEvents.push("x:loaded:enter");
},
exit : function() {
actualEvents.push("x:loaded:exit");
}
},
ending : {
enter : function() {
actualEvents.push("x:ending:enter");
}
}
}
});

var events = [
'unloaded:start', 'unloaded:enter', 'unloaded:exit', 'unloaded:end',
'loaded:start', 'loaded:enter', 'loaded:exit', 'loaded:end',
'ending:start', 'ending:enter', 'ending:exit', 'ending:end'
var eventList = [
'start','exit','enter','end',
'unloaded:enter', 'unloaded:exit',
'loaded:enter', 'loaded:exit',
'ending:enter', 'ending:exit'
];
_.each(events, function(event) {
app.subscribe(event, function() {
sceneEventsActual.push(event);
});
});

_.each(['start','exit','enter','end'], function(event) {
_.each(eventList, function(event) {
app.subscribe(event, function() {
baseEventsActual.push(event);
actualEvents.push(event);
});
});

app.start().then(function() {
app.to('loaded').then(function() {
app.to('ending').then(function() {
ok(_.isEqual(sceneEvents, sceneEventsActual), sceneEventsActual);
ok(_.isEqual(baseEvents, baseEventsActual), baseEventsActual);
ok(_.isEqual(actualEvents, events), actualEvents);
});
});
});
Expand Down

0 comments on commit b716e33

Please sign in to comment.