Skip to content

Commit

Permalink
Integrates Code Painter. Automated cleanup of source files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Jun 29, 2014
1 parent fa891ba commit d18af26
Show file tree
Hide file tree
Showing 14 changed files with 140 additions and 113 deletions.
12 changes: 12 additions & 0 deletions .codepainterrc
@@ -0,0 +1,12 @@
{
"indent_style": "space",
"indent_size": 2,
"insert_final_newline": true,
"quote_type": "single",
"space_after_anonymous_functions": true,
"space_after_control_statements": true,
"spaces_around_operators": true,
"trim_trailing_whitespace": true,
"spaces_in_brackets": false,
"end_of_line": "lf"
}
14 changes: 14 additions & 0 deletions Gruntfile.js
Expand Up @@ -8,6 +8,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-codepainter');
grunt.loadNpmTasks('grunt-dox');

var banner = [
Expand Down Expand Up @@ -172,6 +173,19 @@ module.exports = function(grunt) {
tagMessage: 'Version %VERSION%',
push: false
}
},
codepainter: {
source: {
options: {
json: '.codepainterrc'
},
files: [{
expand: true,
cwd: 'src/',
src: ['rekapi.!(intro|outro|const)*.js'],
dest: 'src/'
}]
}
}
});

Expand Down
22 changes: 11 additions & 11 deletions dist/doc/src/rekapi.actor.js.html
Expand Up @@ -300,15 +300,15 @@ <h2>Keyframe inheritance</h2>
</pre></div>

<p>Keyframe <code>1000</code> will have a <code>y</code> of <code>50</code>, and an <code>x</code> of <code>100</code>, because <code>x</code> was inherited from keyframe <code>0</code>.</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.keyframe = function keyframe (
millisecond, properties, opt_easing) {
millisecond, properties, opt_easing) {

opt_easing = opt_easing || DEFAULT_EASING;
var easing = Tweenable.composeEasingObject(properties, opt_easing);

// Create and add all of the KeyframeProperties
_.each(properties, function (value, name) {
var newKeyframeProperty = new Rekapi.KeyframeProperty(
millisecond, name, value, easing[name]);
millisecond, name, value, easing[name]);

this._addKeyframeProperty(newKeyframeProperty);
}, this);
Expand All @@ -321,7 +321,7 @@ <h2>Keyframe inheritance</h2>
fireRekapiEventForActor(this, 'timelineModified');

return this;
};</code></pre></div></div></div></article><article class="comment"><header><h1 id="hasKeyframeAt">hasKeyframeAt</h1><h5 class="subheader"><div class="label radius ctx-type">method</div>Actor.prototype.hasKeyframeAt()</h5></header><ul class="no-bullet tags"><li class="tag"><span class="type">@param: </span><span class="types">{number}</span><span class="name">millisecond</span><span class="description">Point on the timeline to query.</span></li><li class="tag"><span class="type">@param: </span><span class="types">{string=}</span><span class="name">opt_trackName</span><span class="description">Optional name of a property track.</span></li><li class="tag"><span class="type">@return: </span><span class="types">{boolean}</span><span class="description"></span></li></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>Determines if an actor has any properties of a keyframe set at a given millisecond. You can scope this and determine if a property exists on a particular track with <code>opt_trackName</code>.</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.hasKeyframeAt = function(millisecond, opt_trackName) {
};</code></pre></div></div></div></article><article class="comment"><header><h1 id="hasKeyframeAt">hasKeyframeAt</h1><h5 class="subheader"><div class="label radius ctx-type">method</div>Actor.prototype.hasKeyframeAt()</h5></header><ul class="no-bullet tags"><li class="tag"><span class="type">@param: </span><span class="types">{number}</span><span class="name">millisecond</span><span class="description">Point on the timeline to query.</span></li><li class="tag"><span class="type">@param: </span><span class="types">{string=}</span><span class="name">opt_trackName</span><span class="description">Optional name of a property track.</span></li><li class="tag"><span class="type">@return: </span><span class="types">{boolean}</span><span class="description"></span></li></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>Determines if an actor has any properties of a keyframe set at a given millisecond. You can scope this and determine if a property exists on a particular track with <code>opt_trackName</code>.</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.hasKeyframeAt = function (millisecond, opt_trackName) {
var tracks = this._propertyTracks;

if (opt_trackName) {
Expand All @@ -335,7 +335,7 @@ <h2>Keyframe inheritance</h2>
var track;
for (track in tracks) {
if (tracks.hasOwnProperty(track)
&amp;&amp; findPropertyAtMillisecondInTrack(this, track, millisecond)) {
&amp;&amp; findPropertyAtMillisecondInTrack(this, track, millisecond)) {
return true;
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ <h2>Keyframe inheritance</h2>

_.each(this._propertyTracks, function (propertyTrack, trackName) {
var keyframeProperty =
findPropertyAtMillisecondInTrack(this, trackName, copyFrom);
findPropertyAtMillisecondInTrack(this, trackName, copyFrom);

if (keyframeProperty) {
sourcePositions[trackName] = keyframeProperty.value;
Expand Down Expand Up @@ -416,12 +416,12 @@ <h2>Keyframe inheritance</h2>
</pre></div>

<p><strong><a href="../../../../docs/examples/actor_modify_keyframe.html">Example</a></strong></p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.modifyKeyframe = function (
millisecond, stateModification, opt_easingModification) {
millisecond, stateModification, opt_easingModification) {
opt_easingModification = opt_easingModification || {};

_.each(this._propertyTracks, function (propertyTrack, trackName) {
var property = findPropertyAtMillisecondInTrack(
this, trackName, millisecond);
this, trackName, millisecond);

if (property) {
property.modifyWith({
Expand All @@ -440,7 +440,7 @@ <h2>Keyframe inheritance</h2>
var propertyTracks = this._propertyTracks;

_.each(this._propertyTracks, function (propertyTrack, propertyName) {
var keyframeProperty = _.findWhere(propertyTrack, { millisecond: millisecond });
var keyframeProperty = _.findWhere(propertyTrack, {millisecond: millisecond});

if (keyframeProperty) {
propertyTracks[propertyName] = _.without(propertyTrack, keyframeProperty);
Expand Down Expand Up @@ -476,12 +476,12 @@ <h2>Keyframe inheritance</h2>
};</code></pre></div></div></div></article><article class="comment"><header><h1 id="getKeyframeProperty">getKeyframeProperty</h1><h5 class="subheader"><div class="label radius ctx-type">method</div>Actor.prototype.getKeyframeProperty()</h5></header><ul class="no-bullet tags"><li class="tag"><span class="type">@param: </span><span class="types">{string}</span><span class="name">property</span><span class="description">The name of the property.</span></li><li class="tag"><span class="type">@param: </span><span class="types">{number}</span><span class="name">index</span><span class="description">The millisecond of the property in the timeline.</span></li><li class="tag"><span class="type">@return: </span><span class="types">{Rekapi.KeyframeProperty,undefined}</span><span class="description"></span></li></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>Get the <a href="rekapi.keyframe-property.js.html"><code>Rekapi.KeyframeProperty</code></a> from an actor's property track. Returns <code>undefined</code> if no properties were found.</p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.getKeyframeProperty = function (property, millisecond) {
var propertyTrack = this._propertyTracks[property];
if (propertyTrack) {
return _.findWhere(propertyTrack, { millisecond: millisecond });
return _.findWhere(propertyTrack, {millisecond: millisecond});
}
};</code></pre></div></div></div></article><article class="comment"><header><h1 id="modifyKeyframeProperty">modifyKeyframeProperty</h1><h5 class="subheader"><div class="label radius ctx-type">method</div>Actor.prototype.modifyKeyframeProperty()</h5></header><ul class="no-bullet tags"><li class="tag"><span class="type">@param: </span><span class="types">{string}</span><span class="name">property</span><span class="description">The name of the property to modify.</span></li><li class="tag"><span class="type">@param: </span><span class="types">{number}</span><span class="name">millisecond</span><span class="description">The timeline millisecond of the KeyframeProperty to modify.</span></li><li class="tag"><span class="type">@param: </span><span class="types">{Object}</span><span class="name">newProperties</span><span class="description">The properties to augment the KeyframeProperty with.</span></li><li class="tag"><span class="type">@return: </span><span class="types">{Rekapi.Actor}</span><span class="description"></span></li></ul><div data-section="accordian" data-options="one_up: false;" class="section-container code auto"><div class="section"><p data-section-title class="title"><a href="#">Description</a></p><div data-section-content class="content description"><p>Modify a <a href="rekapi.keyframe-property.js.html"><code>Rekapi.KeyframeProperty</code></a> stored on an actor. This calls <a href="rekapi.keyframe-property.js.html#modifyWith"><code>KeyframeProperty#modifyWith</code></a> (passing along <code>newProperties</code>) and then performs some cleanup.</p>

<p><strong><a href="../../../../docs/examples/actor_modify_keyframe_property.html">Example</a></strong></p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">Actor.prototype.modifyKeyframeProperty = function (
property, millisecond, newProperties) {
property, millisecond, newProperties) {

var keyframeProperty = this.getKeyframeProperty(property, millisecond);
if (keyframeProperty) {
Expand All @@ -496,7 +496,7 @@ <h2>Keyframe inheritance</h2>
if (typeof propertyTracks[property] !== 'undefined') {
var keyframeProperty = this.getKeyframeProperty(property, millisecond);
propertyTracks[property] =
_.without(propertyTracks[property], keyframeProperty);
_.without(propertyTracks[property], keyframeProperty);
keyframeProperty.detach();

cleanupAfterKeyframeModification(this);
Expand Down
2 changes: 1 addition & 1 deletion dist/doc/src/rekapi.core.js.html
Expand Up @@ -461,7 +461,7 @@
} else {
// Remove just the handler specified
this._events[eventName] = _.without(
this._events[eventName], opt_handler);
this._events[eventName], opt_handler);
}

return this;
Expand Down
12 changes: 6 additions & 6 deletions dist/doc/src/rekapi.keyframe-property.js.html
Expand Up @@ -255,14 +255,14 @@

if (nextProperty) {
correctedMillisecond =
Math.min(correctedMillisecond, nextProperty.millisecond);
Math.min(correctedMillisecond, nextProperty.millisecond);

fromObj[this.name] = this.value;
toObj[this.name] = nextProperty.value;

var delta = nextProperty.millisecond - this.millisecond;
var interpolatedPosition =
(correctedMillisecond - this.millisecond) / delta;
(correctedMillisecond - this.millisecond) / delta;

value = interpolate(fromObj, toObj, interpolatedPosition,
nextProperty.easing)[this.name];
Expand All @@ -288,10 +288,10 @@

<p><strong><a href="../../../../docs/examples/keyprop_export_property_data.html">Example</a></strong></p></div></div><div class="section"><p data-section-title class="title"><a href="#">Source</a></p><div data-section-content class="content"><pre><code class="language-javascript">KeyframeProperty.prototype.exportPropertyData = function () {
return {
'millisecond': this.millisecond
,'name': this.name
,'value': this.value
,'easing': this.easing
'millisecond': this.millisecond
,'name': this.name
,'value': this.value
,'easing': this.easing
};
};

Expand Down
2 changes: 1 addition & 1 deletion dist/rekapi-underscore-shifty.min.js

Large diffs are not rendered by default.

0 comments on commit d18af26

Please sign in to comment.