Skip to content

Commit

Permalink
Removes MinPubSub.
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 15b594b
Author: Jeremy Kahn <[email protected]>
Date:   Mon Jun 16 20:51:12 2014 -0500

    Bumps to 0.4.13.

commit 09a1734
Author: Jeremy Kahn <[email protected]>
Date:   Sun Jun 15 19:02:59 2014 -0500

    Completely removes MinPubSub and rebuilds.

commit a94d289
Author: Jeremy Kahn <[email protected]>
Date:   Sat Jun 14 13:30:51 2014 -0500

    Replaces MinPubSub calls with Backbone trigger/on.
  • Loading branch information
jeremyckahn committed Jun 17, 2014
1 parent 3c7789a commit effa572
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 70 deletions.
2 changes: 1 addition & 1 deletion bin/app.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stylie",
"version": "0.4.12",
"version": "0.4.13",
"homepage": "https://github.com/jeremyckahn/stylie",
"authors": [
"Jeremy Kahn <[email protected]>"
Expand All @@ -20,7 +20,6 @@
"jquery-cubelet": "~0.0.1",
"bezierizer": "~0.0.4",
"mustache": "~0.7.2",
"minpubsub": "",
"jck-library-extensions": "0.0.3"
},
"resolutions": {
Expand Down
1 change: 0 additions & 1 deletion dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ <h3>How it's made</h3>
<li><a href="http://underscorejs.org/" target="_blank">Underscore</a></li>
<li><a href="http://requirejs.org/" target="_blank">RequireJS</a></li>
<li><a href="https://github.com/janl/mustache.js/" target="_blank">mustache.js</a></li>
<li><a href="https://github.com/daniellmb/MinPubSub" target="_blank">MinPubSub</a></li>
<li><a href="http://rekapi.com/" target="_blank">Rekapi</a></li>
<li><a href="http://jeremyckahn.github.io/shifty/" target="_blank">Shifty</a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stylie",
"version": "0.4.12",
"version": "0.4.13",
"homepage": "https://github.com/jeremyckahn/stylie",
"author": "Jeremy Kahn <[email protected]>",
"description": "A CSS3 keyframe generator",
Expand Down
21 changes: 10 additions & 11 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,16 @@ require.config({
,'rekapi-scrubber': 'bower_components/rekapi-controls/src/rekapi-scrubber'
,mustache: 'bower_components/mustache/mustache'
,bezierizer: 'bower_components/bezierizer/dist/bezierizer'
,minpubsub: 'bower_components/minpubsub/minpubsub.src'
}
});

require([
// Libraries
'jquery'
,'underscore'
,'backbone'
,'shifty'
,'rekapi'
,'minpubsub'

// Extensions
,'bower_components/jck-library-extensions/src/backbone/tabs'
Expand Down Expand Up @@ -101,9 +100,9 @@ require([

$
,_
,Backbone
,Tweenable
,Rekapi
,MinPubSub

,TabsView

Expand Down Expand Up @@ -238,55 +237,55 @@ require([
'$el': $('.quality-slider.fps .slider')
});

MinPubSub.subscribe(constant.UPDATE_CSS_OUTPUT, function () {
Backbone.on(constant.UPDATE_CSS_OUTPUT, function () {
app.view.cssOutput.renderCSS();
});

app.view.cssNameField = new AutoUpdateTextFieldView({
'$el': $('#css-name')
,'onKeyup': function (val) {
app.config.className = val;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

app.view.mozCheckbox = new CheckboxView({
'$el': $('#moz-toggle')
,'onChange': function (evt, checked) {
app.config.activeClasses.moz = checked;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

app.view.msCheckbox = new CheckboxView({
'$el': $('#ms-toggle')
,'onChange': function (evt, checked) {
app.config.activeClasses.ms = checked;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

app.view.oCheckbox = new CheckboxView({
'$el': $('#o-toggle')
,'onChange': function (evt, checked) {
app.config.activeClasses.o = checked;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

app.view.webkitCheckbox = new CheckboxView({
'$el': $('#webkit-toggle')
,'onChange': function (evt, checked) {
app.config.activeClasses.webkit = checked;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

app.view.w3Checkbox = new CheckboxView({
'$el': $('#w3-toggle')
,'onChange': function (evt, checked) {
app.config.activeClasses.w3 = checked;
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}
});

Expand All @@ -304,7 +303,7 @@ require([
: '';
app.view.htmlInput.$renderTarget.css(
'transform-origin', tranformOrigin);
MinPubSub.publish(constant.ACTOR_ORIGIN_CHANGED, [true]);
Backbone.trigger(constant.ACTOR_ORIGIN_CHANGED, true);
app.rekapi.update();
}
});
Expand Down
10 changes: 4 additions & 6 deletions src/model/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'jquery'
,'underscore'
,'backbone'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -16,7 +15,6 @@ define([
$
,_
,Backbone
,MinPubSub

,app
,constant
Expand Down Expand Up @@ -78,7 +76,7 @@ define([
this.keyframeCollection.sort();
this.trigger('change');
app.rekapi.update();
MinPubSub.publish(constant.KEYFRAME_ORDER_CHANGED);
Backbone.trigger(constant.KEYFRAME_ORDER_CHANGED);
}

,'appendNewKeyframeWithDefaultProperties': function () {
Expand Down Expand Up @@ -130,7 +128,7 @@ define([
this.keyframeCollection.add(modelProperties, {'owner': this});
var keyframeProperties = this.keyframeCollection.last().getCSS();
this.get('actor').keyframe(millisecond, keyframeProperties, opt_easing);
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}

,'modifyKeyframe': function (
Expand All @@ -152,7 +150,7 @@ define([
,'removeKeyframe': function (millisecond) {
this.keyframeCollection.removeKeyframe(millisecond);
this.get('actor').removeKeyframe(millisecond);
MinPubSub.publish(constant.PATH_CHANGED);
Backbone.trigger(constant.PATH_CHANGED);
}

,'importTimeline': function (actorData) {
Expand All @@ -165,7 +163,7 @@ define([
}, this);

app.rekapi.update();
MinPubSub.publish(constant.PATH_CHANGED);
Backbone.trigger(constant.PATH_CHANGED);
}

,'parseTranformString': function (transformString) {
Expand Down
8 changes: 3 additions & 5 deletions src/model/keyframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([

'underscore'
,'backbone'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -11,7 +10,6 @@ define([

_
,Backbone
,MinPubSub

,app
,constant
Expand All @@ -25,7 +23,7 @@ define([
// TODO: This message subscription and event binding should be
// consolidated into one operation.
this._boundModifyKeyframeHandler = _.bind(this.modifyKeyframe, this);
MinPubSub.subscribe(
Backbone.on(
constant.ACTOR_ORIGIN_CHANGED, this._boundModifyKeyframeHandler);
this.on('change', this._boundModifyKeyframeHandler);
}
Expand Down Expand Up @@ -60,11 +58,11 @@ define([

// TODO: Maybe check to see if this is the last keyframe in the
// collection before publishing?
MinPubSub.publish(constant.ANIMATION_LENGTH_CHANGED);
Backbone.trigger(constant.ANIMATION_LENGTH_CHANGED);
}

,'destroy': function () {
MinPubSub.unsubscribe(
Backbone.off(
constant.ACTOR_ORIGIN_CHANGED, this._boundModifyKeyframeHandler);
this.off('change', this._boundModifyKeyframeHandler);
this.trigger('destroy');
Expand Down
4 changes: 1 addition & 3 deletions src/ui/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([

'underscore'
,'backbone'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -11,7 +10,6 @@ define([

_
,Backbone
,MinPubSub

,app
,constant
Expand All @@ -30,7 +28,7 @@ define([
_.extend(this, opts);
this.fadeOutTimeout_ = 0;
this.$contentEl_ = this.$el.find('p');
MinPubSub.subscribe(constant.ALERT_ERROR, _.bind(this.show, this));
Backbone.on(constant.ALERT_ERROR, _.bind(this.show, this));
}

,'show': function (alertMessage) {
Expand Down
6 changes: 2 additions & 4 deletions src/ui/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'underscore'
,'backbone'
,'shifty'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -13,7 +12,6 @@ define([
_
,Backbone
,Tweenable
,MinPubSub

,app
,constant
Expand All @@ -30,8 +28,8 @@ define([
});

var boundUpdate = _.bind(this.update, this);
MinPubSub.subscribe(constant.PATH_CHANGED, boundUpdate);
MinPubSub.subscribe(constant.KEYFRAME_ORDER_CHANGED, boundUpdate);
Backbone.on(constant.PATH_CHANGED, boundUpdate);
Backbone.on(constant.KEYFRAME_ORDER_CHANGED, boundUpdate);
}

,'resize': function (dims) {
Expand Down
16 changes: 7 additions & 9 deletions src/ui/crosshair.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'jquery'
,'underscore'
,'backbone'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -14,7 +13,6 @@ define([
$
,_
,Backbone
,MinPubSub

,app
,constant
Expand Down Expand Up @@ -47,9 +45,9 @@ define([

this._$cubelet.on('change', _.bind(this.onCubeletChange, this));

this._rotationModeStartHandle = MinPubSub.subscribe(
this._rotationModeStartHandle = Backbone.on(
constant.ROTATION_MODE_START, _.bind(this.onRotationModeStart, this));
this._rotationModeStopHandle = MinPubSub.subscribe(
this._rotationModeStopHandle = Backbone.on(
constant.ROTATION_MODE_STOP, _.bind(this.onRotationModeStop, this));

this.model.on('change', _.bind(this.render, this));
Expand All @@ -67,7 +65,7 @@ define([

,'onRotationModeStop': function () {
this._$cubelet.hide();
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}

,'onCubeletChange': function () {
Expand All @@ -81,7 +79,7 @@ define([

,'dragEnd': function (evt, ui) {
this.updateModel();
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}

,'render': function () {
Expand All @@ -108,7 +106,7 @@ define([
,'rY': rotationCoords.y
,'rZ': rotationCoords.z
});
MinPubSub.publish(constant.PATH_CHANGED);
Backbone.trigger(constant.PATH_CHANGED);
this.model.trigger('change');
app.rekapi.update();
}
Expand All @@ -121,8 +119,8 @@ define([
this._$crosshairContainer.remove();
this._$cubelet.remove();
this.remove();
MinPubSub.unsubscribe(this._rotationModeStartHandle);
MinPubSub.unsubscribe(this._rotationModeStopHandle);
Backbone.off(this._rotationModeStartHandle);
Backbone.off(this._rotationModeStopHandle);
util.deleteAllProperties(this);
}

Expand Down
4 changes: 1 addition & 3 deletions src/ui/custom-ease.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
,'backbone'
,'shifty'
,'bezierizer'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -18,7 +17,6 @@ define([
,Backbone
,Tweenable
,Bezierizer
,MinPubSub

,app
,constant
Expand Down Expand Up @@ -154,7 +152,7 @@ define([
rekapi.update();
}

MinPubSub.publish(constant.PATH_CHANGED);
Backbone.trigger(constant.PATH_CHANGED);
app.collection.actors.getCurrent().updateKeyframes();
}

Expand Down
4 changes: 1 addition & 3 deletions src/ui/fps-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([

'underscore'
,'backbone'
,'minpubsub'

,'src/app'
,'src/constants'
Expand All @@ -11,7 +10,6 @@ define([

_
,Backbone
,MinPubSub

,app
,constant
Expand All @@ -38,7 +36,7 @@ define([
}

,'onSliderDrag': function (val) {
MinPubSub.publish(constant.UPDATE_CSS_OUTPUT);
Backbone.trigger(constant.UPDATE_CSS_OUTPUT);
}

,'getFPS': function () {
Expand Down
Loading

0 comments on commit effa572

Please sign in to comment.