new expressions support
diff --git a/player/index.html b/player/index.html
index cb85320..b25ba44 100644
--- a/player/index.html
+++ b/player/index.html
@@ -121,7 +121,7 @@
container: elem,
renderer: 'svg',
loop: true,
- autoplay: true,
+ autoplay: false,
rendererSettings: {
progressiveLoad:false
},
diff --git a/player/js/utils/expressions/EffectInterface.js b/player/js/utils/expressions/EffectInterface.js
index eae83be..304540c 100644
--- a/player/js/utils/expressions/EffectInterface.js
+++ b/player/js/utils/expressions/EffectInterface.js
@@ -56,6 +56,11 @@
}
});
}
+ Object.defineProperty(groupInterface, 'numProperties', {
+ get: function(){
+ return data.np;
+ }
+ });
groupInterface.active = data.en !== 0;
return groupInterface
}
diff --git a/player/js/utils/expressions/ExpressionManager.js b/player/js/utils/expressions/ExpressionManager.js
index 41ea8ec..ceee536 100644
--- a/player/js/utils/expressions/ExpressionManager.js
+++ b/player/js/utils/expressions/ExpressionManager.js
@@ -90,6 +90,12 @@
var tOfA = typeof a;
var tOfB = typeof b;
if((tOfA === 'number' || tOfA === 'boolean' || tOfA === 'string' || a instanceof Number ) && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )) {
+ if(tOfA === 'string') {
+ a = parseInt(a);
+ }
+ if(tOfB === 'string') {
+ b = parseInt(b);
+ }
return a - b;
}
if( a.constructor === Array && (tOfB === 'number' || tOfB === 'boolean' || tOfB === 'string' || b instanceof Number )){
@@ -170,6 +176,15 @@
}
return 0;
}
+ function mod(a,b) {
+ if(typeof a === 'string') {
+ a = parseInt(a);
+ }
+ if(typeof b === 'string') {
+ b = parseInt(b);
+ }
+ return a % b;
+ }
function clamp(num, min, max) {
if(min > max){
@@ -193,7 +208,7 @@
var helperLengthArray = [0,0,0,0,0,0];
function length(arr1,arr2){
- if(typeof arr1 === "number"){
+ if(typeof arr1 === 'number' || arr1 instanceof Number){
arr2 = arr2 || 0;
return Math.abs(arr1 - arr2);
}
@@ -590,7 +605,7 @@
};
function timeToFrames(t,fps){
- if(!t){
+ if(!t && t !== 0){
t = time;
}
if(!fps){
@@ -672,7 +687,6 @@
}
}
}
-
if(this.v.length === 1){
this.v = this.v[0];
}
diff --git a/player/js/utils/expressions/ShapeInterface.js b/player/js/utils/expressions/ShapeInterface.js
index ceaf41f..ec4bf86 100644
--- a/player/js/utils/expressions/ShapeInterface.js
+++ b/player/js/utils/expressions/ShapeInterface.js
@@ -740,7 +740,7 @@
prop.setGroupProperty(_propertyGroup);
function interfaceFunction(val){
- if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path'){
+ if(val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 2){
return interfaceFunction.path;
}
}
diff --git a/player/js/utils/filters.js b/player/js/utils/filters.js
index 26df309..328361c 100644
--- a/player/js/utils/filters.js
+++ b/player/js/utils/filters.js
@@ -18,7 +18,7 @@
var feColorMatrix = document.createElementNS(svgNS,'feColorMatrix');
feColorMatrix.setAttribute('type','matrix');
feColorMatrix.setAttribute('color-interpolation-filters','sRGB');
- feColorMatrix.setAttribute('values','0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1');
+ feColorMatrix.setAttribute('values','0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1');
return feColorMatrix;
}