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.
81 lines
1.6 KiB
81 lines
1.6 KiB
6 years ago
|
/*
|
||
|
---
|
||
|
name : Sheet
|
||
|
|
||
|
authors : Thomas Aylott
|
||
|
copyright : © 2010 Thomas Aylott
|
||
|
license : MIT
|
||
|
|
||
|
provides : Sheet
|
||
|
requires : SheetParser.CSS
|
||
|
...
|
||
|
*/
|
||
|
;(function(exports){
|
||
|
|
||
|
|
||
|
/*<depend>*/
|
||
|
var UNDEF = {undefined:1}
|
||
|
|
||
|
/*<CommonJS>*/
|
||
|
var SheetParser = UNDEF[typeof require]
|
||
|
? exports.SheetParser
|
||
|
: require('./SheetParser.CSS').SheetParser
|
||
|
|
||
|
exports.Sheet = Sheet
|
||
|
/*</CommonJS>*/
|
||
|
|
||
|
/*<debug>*/;if (!(!UNDEF[typeof SheetParser] && SheetParser.CSS)) throw new Error('Missing required function: "SheetParser.CSS"');/*</debug>*/
|
||
|
/*</depend>*/
|
||
|
|
||
|
|
||
|
Sheet.version = '1.0.2 dev'
|
||
|
|
||
|
function Sheet(cssText){
|
||
|
if (this instanceof Sheet) this.initialize(cssText)
|
||
|
else return Sheet.from(cssText)
|
||
|
}
|
||
|
|
||
|
Sheet.from = function(cssText){
|
||
|
return new Sheet(cssText)
|
||
|
}
|
||
|
|
||
|
Sheet.prototype = {
|
||
|
|
||
|
parser: SheetParser.CSS,
|
||
|
|
||
|
initialize: function(cssText){
|
||
|
this.cssText = cssText || ''
|
||
|
this.style = this.rules = this.cssRules = this.parser.parse(this.cssText)
|
||
|
var self = this
|
||
|
},
|
||
|
|
||
|
update: function(){
|
||
|
var cssText = '',
|
||
|
i = -1,
|
||
|
rule,
|
||
|
rules = this.style || this.rules || this.cssRules
|
||
|
|
||
|
while ((rule = rules[++i])){
|
||
|
if (typeof rule == 'object'){
|
||
|
// cssRule
|
||
|
if (this.update) rule.cssText = this.update.call(rule)
|
||
|
cssText += rule.cssText = rule.selectorText + '{' + rule.cssText + '}'
|
||
|
} else {
|
||
|
// style key/value
|
||
|
cssText += rule + ':'
|
||
|
cssText += rules[rule] + ';'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (rules.selectorText)
|
||
|
return rules.cssText = rules.selectorText + '{' + cssText + '}'
|
||
|
return rules.cssText = cssText
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
Sheet.prototype.toString = Sheet.prototype.update
|
||
|
|
||
|
|
||
|
}(typeof exports != 'undefined' ? exports : this));
|