Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added tests, fixed some errors.
- Loading branch information
|
|
@@ -1,7 +1,7 @@ |
|
|
// Framer 2.0-31-gf367c76 (c) 2013 Koen Bok |
|
|
// Framer 2.0-32-g6eefeb0 (c) 2013 Koen Bok |
|
|
// https://github.com/koenbok/Framer |
|
|
|
|
|
window.FramerVersion = "2.0-31-gf367c76"; |
|
|
window.FramerVersion = "2.0-32-g6eefeb0"; |
|
|
|
|
|
|
|
|
(function(){var require = function (file, cwd) { |
|
@@ -2727,6 +2727,9 @@ require.define("/src/views/view.coffee",function(require,module,exports,__dirnam |
|
|
View.prototype._parseFilterCSS = function(css) { |
|
|
var k, name, part, results, v, value, _i, _len, _ref; |
|
|
results = {}; |
|
|
if (!css) { |
|
|
return results; |
|
|
} |
|
|
_ref = css.split(" "); |
|
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
|
|
part = _ref[_i]; |
|
@@ -4272,7 +4275,6 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname |
|
|
cssString.push("}\n"); |
|
|
} |
|
|
cssString.push("}\n"); |
|
|
console.log(cssString.join("")); |
|
|
return cssString.join(""); |
|
|
}; |
|
|
|
|
|
|
@@ -380,9 +380,6 @@ class Animation extends EventEmitter |
|
|
cssString.push "}\n" |
|
|
|
|
|
cssString.push "}\n" |
|
|
|
|
|
console.log cssString.join "" |
|
|
|
|
|
cssString.join "" |
|
|
|
|
|
_deltas: -> |
|
|
|
@@ -285,8 +285,6 @@ class View extends Frame |
|
|
############################################################################# |
|
|
## Visual Filters |
|
|
|
|
|
|
|
|
|
|
|
_getFilterValue: (name) -> |
|
|
values = @_parseFilterCSS @style.webkitFilter |
|
|
values[name] or FilterProperties[name].default |
|
@@ -306,7 +304,10 @@ class View extends Frame |
|
|
css.join " " |
|
|
|
|
|
_parseFilterCSS: (css) -> |
|
|
results = {} |
|
|
results = {} |
|
|
|
|
|
return results if not css |
|
|
|
|
|
for part in css.split " " |
|
|
if part |
|
|
name = part.split("(")[0] |
|
|
|
|
@@ -1,7 +1,7 @@ |
|
|
// Framer 2.0-31-gf367c76 (c) 2013 Koen Bok |
|
|
// Framer 2.0-32-g6eefeb0 (c) 2013 Koen Bok |
|
|
// https://github.com/koenbok/Framer |
|
|
|
|
|
window.FramerVersion = "2.0-31-gf367c76"; |
|
|
window.FramerVersion = "2.0-32-g6eefeb0"; |
|
|
|
|
|
|
|
|
(function(){var require = function (file, cwd) { |
|
@@ -2727,6 +2727,9 @@ require.define("/src/views/view.coffee",function(require,module,exports,__dirnam |
|
|
View.prototype._parseFilterCSS = function(css) { |
|
|
var k, name, part, results, v, value, _i, _len, _ref; |
|
|
results = {}; |
|
|
if (!css) { |
|
|
return results; |
|
|
} |
|
|
_ref = css.split(" "); |
|
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
|
|
part = _ref[_i]; |
|
@@ -4272,7 +4275,6 @@ require.define("/src/animation.coffee",function(require,module,exports,__dirname |
|
|
cssString.push("}\n"); |
|
|
} |
|
|
cssString.push("}\n"); |
|
|
console.log(cssString.join("")); |
|
|
return cssString.join(""); |
|
|
}; |
|
|
|
|
|
|
|
@@ -1,6 +1,8 @@ |
|
|
describe "Animation", -> |
|
|
|
|
|
AnimatableMatrixProperties = (new Animation view:null).AnimatableMatrixProperties |
|
|
AnimatableCSSProperties = (new Animation view:null).AnimatableCSSProperties |
|
|
AnimatableFilterProperties = (new Animation view:null).AnimatableFilterProperties |
|
|
AnimationTime = 200 |
|
|
|
|
|
halfway = (a, b) -> |
|
@@ -45,8 +47,14 @@ describe "Animation", -> |
|
|
animation.curveValues.length.should.equal \ |
|
|
(animation.time / 1000) * animation.precision |
|
|
|
|
|
testProperties = [] |
|
|
testProperties = _.union testProperties, AnimatableMatrixProperties |
|
|
# testProperties = _.union testProperties, _.keys AnimatableCSSProperties |
|
|
# testProperties = _.union testProperties, _.keys AnimatableFilterProperties |
|
|
|
|
|
AnimatableMatrixProperties.map (p) -> |
|
|
console.log "testProperties", testProperties |
|
|
|
|
|
testProperties.map (p) -> |
|
|
|
|
|
# Todo: Z is weird. I'll have to figure this out later |
|
|
if p in ["z"] |
|
|
|
@@ -188,5 +188,13 @@ describe "View", -> |
|
|
view.addClass('bar') |
|
|
view.removeClass('bar') |
|
|
view.class.should.equal "#{classA} foo" |
|
|
|
|
|
describe "Filters", -> |
|
|
|
|
|
for filterName in ["blur", "brightness", "saturate", "hueRotate", "contrast", |
|
|
"invert", "grayscale", "sepia"] |
|
|
view = createView() |
|
|
view[filterName] = 10 |
|
|
view[filterName].should.equal 10 |
|
|
|
|
|
|