Permalink
Browse files

Lint cleanup

  • Loading branch information...
Koen Bok
Koen Bok committed Mar 14, 2013
1 parent 0dc7c7f commit 6e29b465d821e81337d0475952a7a93dd50721d5
View
@@ -1,6 +1,7 @@
all: build
build:
make lint
make clean
mkdir -p build
./node_modules/browserify/bin/cmd.js src/init.coffee -o build/framer.js
View
@@ -3018,7 +3018,7 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
__extends(Animation, _super);
Animation.prototype.AnimationProperties = ["view", "properties", "curve", "time", "origin", "tolerance", "precision"];
Animation.prototype.AnimationProperties = ["view", "properties", "curve", "time", "origin", "tolerance", "precision", "graph"];
Animation.prototype.AnimatableCSSProperties = {
opacity: "",
@@ -3050,7 +3050,7 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
this.curve = "linear";
}
if ((_ref3 = this.precision) == null) {
this.precision = 30;
this.precision = 40;
}
this.curveValues = this._parseCurve(this.curve);
this.count = 0;
@@ -3094,6 +3094,9 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
}
this.keyFrameAnimationCSS = this._css();
css.addStyle(" " + this.keyFrameAnimationCSS + " ." + this.animationName + " { -webkit-animation-duration: " + (this.time / 1000) + "s; -webkit-animation-name: " + this.animationName + "; -webkit-animation-timing-function: linear; -webkit-animation-fill-mode: both; }");
if (this.graph) {
this._graphView = this.graphView(this, 10, 20, 20, this.time);
}
this.view.addClass(this.animationName);
finalize = function() {
var calculatedStyles, _ref2;
@@ -3147,9 +3150,11 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
};
Animation.prototype._cleanup = function() {
var _ref;
this.view._currentAnimations = _.without(this.view._currentAnimations, this);
this.view.removeClass(this.animationName);
return this.emit("end");
this.emit("end");
return (_ref = this._graphView) != null ? _ref.visible = false : void 0;
};
Animation.prototype._css = function() {
@@ -3221,6 +3226,57 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname
}
};
Animation.prototype.graphView = function(animation, x, y, h, time) {
var background, color, dot, graph, i, player, value, values, width, _i, _len;
color = "rgba(50,150,200,.35)";
values = animation.curveValues;
width = 300;
graph = new View({
y: y,
x: x,
width: 100,
height: h
});
graph.clip = false;
background = new View({
y: 0 - h,
height: h * 2 + 3,
superView: graph
});
background.style.backgroundColor = "rgba(255,255,255,.85)";
for (i = _i = 0, _len = values.length; _i < _len; i = ++_i) {
value = values[i];
dot = new View({
width: 3,
height: 3,
x: i * widthFactor,
y: (100 - value) * (h / 100),
superView: graph
});
dot.style.borderRadius = "5px";
dot.style.backgroundColor = color;
}
graph.width = dot.x;
background.width = dot.x;
if (time) {
player = new View({
x: 0,
y: -h,
width: 2,
height: h * 2,
superView: graph
});
player.style.backgroundColor = color;
player.animate({
properties: {
x: graph.width
},
time: time
});
}
return graph;
};
return Animation;
})(EventEmitter);
@@ -3240,7 +3296,7 @@ require.define("/src/curves/spring.coffee",function(require,module,exports,__dir
friction: 8,
velocity: 0,
speed: 1 / 60.0,
tolerance: 0.01
tolerance: .1
};
springAccelerationForState = function(state) {
View
@@ -78,15 +78,15 @@ BezierCurve = (a, b, c, d, time, fps) ->
defaults = {}
defaults.Linear = (time, fps) ->
defaults.Linear = (time, fps) ->
BezierCurve 0, 0, 1, 1, time, fps
defaults.Ease = (time, fps) ->
defaults.Ease = (time, fps) ->
BezierCurve .25, .1, .25, 1, time, fps
defaults.EaseIn = (time, fps) ->
defaults.EaseIn = (time, fps) ->
BezierCurve .42, 0, 1, 1, time, fps
defaults.EaseOut = (time, fps) ->
defaults.EaseOut = (time, fps) ->
BezierCurve 0, 0, .58, 1, time, fps
defaults.EaseInOut = (time, fps) ->
defaults.EaseInOut = (time, fps) ->
BezierCurve .42, 0, .58, 1, time, fps
exports.defaults = defaults
View
@@ -3,7 +3,7 @@ defaults =
friction: 8
velocity: 0
speed: 1/60.0
tolerance: 0.01
tolerance: .1
springAccelerationForState = (state) ->
@@ -103,7 +103,7 @@ class Spring
return @currentValue
all: ->
all: ->
@reset()
count = 0
while @moving
@@ -117,7 +117,11 @@ class Spring
SpringCurve = (tension, friction, velocity, fps) ->
# console.log "spring.SpringCurve", tension, friction, velocity, fps
spring = new Spring(tension:tension, friction:friction, velocity:velocity, speed:1/fps)
spring = new Spring
tension:tension
friction:friction
velocity:velocity
speed:1/fps
spring.all()
exports.SpringCurve = SpringCurve
View
@@ -24,7 +24,11 @@ exports.debug = ->
node = document.createElement "div"
node.innerHTML = "#{view.name or view.id}"
node.innerHTML += " <span style='opacity:.5'>in #{view.superView.name or view.superView.id}</span>" if view.superView
if view.superView
node.innerHTML += " <span style='opacity:.5'>
in #{view.superView.name or view.superView.id}
</span>"
node.style.position = "absolute"
node.style.padding = "3px"
@@ -57,7 +61,8 @@ window.document.onkeydown = (event) ->
window.onerror = (e) ->
errorView = new View x:20, y:20, width:350, height:60
errorView.html = "<b>Javascript Error</b><br>Inspect the error console for more info."
errorView.html = "<b>Javascript Error</b>
<br>Inspect the error console for more info."
errorView.style =
font: "13px/1.3em Menlo, Monaco"
backgroundColor: "rgba(255,0,0,0.5)"
View

This file was deleted.

Oops, something went wrong.
@@ -38,7 +38,7 @@ class Frame extends EventEmitter
@define "maxX"
get: -> @x + @width
set: (value) ->
set: (value) ->
throw Error "Width is zero" if @width is 0
@x = value - @width
@@ -54,13 +54,13 @@ class Frame extends EventEmitter
@define "maxY"
get: -> @y + @height
set: (value) ->
set: (value) ->
throw Error "Width is zero" if @height is 0
@y = value - @height
merge: (r2) ->
r1 = @
frame =
frame =
x: Math.min(r1.x, r2.x)
y: Math.min(r1.y, r2.y)
width: Math.max(r1.width, r2.width)
@@ -8,9 +8,9 @@ WebKitCSSMatrix::cssValues = ->
values = "
matrix3d(
#{r @m11}, #{r @m12}, #{r @m13}, #{r @m14},
#{r @m21}, #{r @m22}, #{r @m23}, #{r @m24},
#{r @m31}, #{r @m32}, #{r @m33}, #{r @m34},
#{r @m11}, #{r @m12}, #{r @m13}, #{r @m14},
#{r @m21}, #{r @m22}, #{r @m23}, #{r @m24},
#{r @m31}, #{r @m32}, #{r @m33}, #{r @m34},
#{r @m41}, #{r @m42}, #{r @m43}, #{r @m44})"
class Matrix
@@ -46,7 +46,7 @@ class Matrix
@define "scale",
get: -> (@_scaleX + @_scaleY) / 2.0
set: (value) ->
set: (value) ->
@_scaleX = value
@_scaleY = value
@@ -77,7 +77,7 @@ class Matrix
y: m.m42
z: m.m43
result.scale =
result.scale =
x: Math.sqrt(m.m11*m.m11 + m.m12*m.m12 + m.m13*m.m13)
y: Math.sqrt(m.m21*m.m21 + m.m22*m.m22 + m.m23*m.m23)
z: Math.sqrt(m.m31*m.m31 + m.m32*m.m32 + m.m33*m.m33)
View
@@ -37,7 +37,7 @@ exports.filter = (a, f) ->
exports.union = ->
Array.prototype.concat.apply Array.prototype, arguments
exports.remove = (a, e) ->
exports.remove = (a, e) ->
a.splice(t,1)[0] if (t = a.indexOf(e)) > -1
a
@@ -173,8 +173,10 @@ exports.uuid = ->
exports.isWebKit = ->
isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)
isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor)
isChrome = /Chrome/.test(navigator.userAgent) and \
/Google Inc/.test(navigator.vendor)
isSafari = /Safari/.test(navigator.userAgent) and \
/Apple Computer/.test(navigator.vendor)
return true in [isChrome, isSafari]
@@ -17,7 +17,7 @@ class exports.ImageView extends View
@define "image"
get: ->
get: ->
return @_image
set: (value) ->
@@ -12,7 +12,7 @@ class exports.ScrollView extends View
# # Hack to disable rubber banding on ios devices
# startY = startTopScroll = deltaY = undefined
#
#
# @on "touchstart", =>
# el = @_element
# startY = event.touches[0].pageY
@@ -30,7 +30,9 @@ class exports.TextView extends View
view.frame = frame
view.insert()
size = {width:view.layer.element_.clientWidth, height:view.layer.element_.clientHeight}
size =
width: view.layer.element_.clientWidth
height: view.layer.element_.clientHeight
return size
Oops, something went wrong.

0 comments on commit 6e29b46

Please sign in to comment.