This app provides monitoring and information features for the common freifunk user and the technical stuff of a freifunk community. Code base is taken from a TUM Practical Course project and added here to see if Freifunk Altdorf can use it. https://www.freifunk-altdorf.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

60 lines
1.4 KiB

var Class = require('../../core/class');
var Transform = require('../../core/transform');
var Modulizer = require('./modulizer');
var Element = require('../../dom/dummy');
module.exports = Class(Modulizer, Transform, Element, {
initialize: function(){
this._calls = [];
},
_addCall: function(property, args){
this._calls.push({ prop: property, args: Array.prototype.slice.call(args) });
return this;
},
toExpression: function(expr){
var calls = this._calls, propExpr;
for (var i = 0, l = calls.length; i < l; i++){
var call = calls[i];
propExpr = expr.property(call.prop);
expr = propExpr.call.apply(propExpr, call.args);
}
if (this.xx != 1 || this.xy != 0 || this.yx != 0 || this.yy != 1){
propExpr = expr.property('transform');
expr = propExpr.call.apply(propExpr, (this.x != 0 || this.y != 0) ? [
this.xx, this.xy,
this.yx, this.yy,
this.x, this.y
] : [
this.xx, this.xy,
this.yx, this.yy
]);
} else if (this.x != 0 || this.y != 0){
expr = expr.property('move').call(this.x, this.y);
}
return expr;
},
// transforms
blend: function(opacity){ return this._addCall('blend', arguments); },
// visibility
hide: function(){ return this._addCall('hide', arguments); },
show: function(){ return this._addCall('show', arguments); },
// interaction
indicate: function(){ return this._addCall('indicate', arguments); },
// ignore
subscribe: function(){
return this;
}
});