initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

95
node_modules/art/lib/Sheet.Cascade.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
var Slick = require('./slick/Source/slick').Slick;
var CSS = require('./sheet.js/Source/SheetParser.CSS').SheetParser.CSS;
function calculateSpecificity(expression){
var specificity = 0;
for (var i = 0, l = expression.length; i < l; i++){
var part = expression[i];
if (part.id) specificity += 10000;
if (part.classes) specificity += part.classes.length * 1000;
if (part.pseudos) specificity += part.pseudos.length * 1000;
if (part.attributes) specificity += part.attributes.length * 1000;
if (part.tag && part.tag != '*') specificity += 100;
}
return specificity;
};
function sortRules(rules){
rules.sort(function(a,b){
if (a.specificity < b.specificity)
return -1;
else if (a.specificity > b.specificity)
return 1;
return 0;
});
};
function nodeContent(node){
var n = node.firstChild, text = '';
while (n){
text += n.nodeValue;
n = n.nextSibling;
}
return text;
}
var SheetCascade = function(){
this.rules = [];
this.cssRules = [];
};
SheetCascade.prototype = {
addSheet: function(sheet){
var rules = sheet.cssRules || CSS.parse(sheet.innerHTML || nodeContent(sheet) || sheet);
for (var i = 0, l = rules.length; i < l; i++){
var rule = rules[i];
this.cssRules.push(rule);
this.addRule(rule.selectorText, rule.style);
}
},
addRule: function(selector, style){
var parsed = Slick.parse(selector);
if (!parsed) return;
var expressions = parsed.expressions;
for (var i = 0, l = expressions.length; i < l; i++){
var expression = expressions[i],
specificity = calculateSpecificity(expression) + this.rules.length;
this.rules.push({
specificity: specificity,
expression: expression,
style: style
});
}
this.sorted = false;
},
getStyle: function(node){
var style = {};
this.applyStyle(node, style);
return style;
},
applyStyle: function(node, targetStyle){
var rules = this.rules;
if (!this.sorted){ sortRules(rules); this.sorted = true; }
for (var i = 0, l = rules.length; i < l; i++){
var rule = rules[i];
if (Slick.match(node, { Slick: true, expressions: [rule.expression] })){
var ruleStyle = rule.style;
for (var name in ruleStyle) targetStyle[name] = ruleStyle[name];
}
}
var cssText = node.getAttribute('style');
if (cssText){
var inlineStyle = CSS.parse(cssText);
for (var name in inlineStyle) targetStyle[name] = inlineStyle[name];
}
}
};
exports.SheetCascade = SheetCascade;

22
node_modules/art/lib/ast-js/Demos/helloworld.html generated vendored Normal file
View File

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>HelloWorld.js</title>
</head>
<body>
<script>var require = function(){return module.exports;}, module={};</script>
<script src="../src/program.js"></script>
<script src="../src/statement.js"></script>
<script src="../src/expression.js"></script>
<script src="../src/block.js"></script>
<script src="../src/literal.js"></script>
<script src="../src/operator.js"></script>
<script src="../src/variable.js"></script>
<script src="../src/property.js"></script>
<script src="../src/assignment.js"></script>
<script src="../src/condition.js"></script>
<script src="../src/function.js"></script>
<script src="../src/call.js"></script>
<script src="helloworld.js"></script>
</body>
</html>

21
node_modules/art/lib/ast-js/Demos/helloworld.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
var a = new AST.Variable('astr');
var b = new AST.Variable('bstr');
var alertFn = new AST.Variable('alert');
var newFn = new AST.Function(
[a, b], null,
alertFn.call(a.add(b))
);
newFn.compile()('Hello', ' world');
var klass = new AST.Variable('Class').construct({
initialize: newFn
});
var ast = new AST(new AST.Variable('MyClass').assign(klass));
alert(ast.toString());

13
node_modules/art/lib/ast-js/README.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
AST.js
======
Provides an Abstract Syntax Tree (AST) to generate ECMAScript code.
TODO:
- Add parentheses around expressions when necessary
- Nice indented formatting with options
- Rename invalid or scope colliding variable names
- Escape dangerous characters in regular expression literals
- Statements: for, while, do, switch, with, delete, typeof, instanceof
- Comments
- Lexical parser

13
node_modules/art/lib/ast-js/ast.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
var AST = require('./src/program');
require('./src/statement');
require('./src/expression');
require('./src/block');
require('./src/literal');
require('./src/operator');
require('./src/variable');
require('./src/property');
require('./src/assignment');
require('./src/condition');
require('./src/function');
require('./src/call');
module.exports = AST;

21
node_modules/art/lib/ast-js/license.txt generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2010 Calyptus Life AB <http://calyptus.eu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

75
node_modules/art/lib/ast-js/src/assignment.js generated vendored Normal file
View File

@@ -0,0 +1,75 @@
var AST = require('./program');
var err = 'Assignment is only possible on variables or properties.',
posterr = 'Only the literal 1 is possible for post assignments.',
assignableOps = /[\+\-\*\/\%]/;
AST.Assignment = function(left, right){
if (!(left instanceof AST.Variable || left instanceof AST.Property)) throw new Error(err);
this.left = left;
this.right = AST.Expression(right);
};
AST.Assignment.prototype = new AST.Expression();
AST.Assignment.prototype.writeTo = function(writer, format){
var left = this.left, right = this.right;
left.writeTo(writer, format);
if (right instanceof AST.Operator && right.left === left && assignableOps.test(right.operator)){
if (right.right instanceof AST.Literal && right.right.value == 1){
if (right.operator == '+'){
writer('++');
return;
} else if (right.operator == '-'){
writer('--');
return;
}
}
writer(' ' + right.operator + '= ');
right = right.right;
} else {
writer(' = ');
}
right.writeTo(writer, format);
};
AST.PostAssignment = function(left, right, operator){
if (!(left instanceof AST.Variable || left instanceof AST.Property)) throw new Error(err);
this.left = left;
this.operator = operator;
this.right = AST.Expression(right);
if (!(this.right instanceof AST.Operator) || this.right.left !== left || !(this.right.right instanceof AST.Literal) || this.right.right.value != 1) throw new Error(posterr);
}
AST.PostAssignment.prototype = new AST.Expression();
AST.PostAssignment.prototype.writeTo = function(writer, format){
this.expression.writeTo(writer, format);
writer(this.operator + this.operator);
};
AST.Expression.prototype.assignTo = function(expr){
return new AST.Assignment(expr, this);
};
AST.Variable.prototype.assign = AST.Property.prototype.assign = function(expr){
return new AST.Assignment(this, expr);
};
AST.Variable.prototype.increment = AST.Property.prototype.increment = function(){
return new AST.Assignment(this, new AST.Add(this, 1));
};
AST.Variable.prototype.decrement = AST.Property.prototype.decrement = function(){
return new AST.Assignment(this, new AST.Subtract(this, 1));
};
AST.Variable.prototype.postIncrement = AST.Property.prototype.postIncrement = function(){
return new AST.PostAssignment(this, new AST.Add(this, 1));
};
AST.Variable.prototype.postDecrement = AST.Property.prototype.postDecrement = function(){
return new AST.PostAssignment(this, new AST.Subtract(this, 1));
};

46
node_modules/art/lib/ast-js/src/block.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
var AST = require('./program');
AST.Block = function(obj){
if (this instanceof AST.Block){
if (Object.prototype.toString.call(obj) == '[object Array]')
this.statements = Array.prototype.slice.call(obj);
else
this.statements = Array.prototype.slice.call(arguments);
return;
}
if (obj instanceof AST.Block) return obj;
var block = new AST.Block();
if (Object.prototype.toString.call(obj) == '[object Array]')
block.statements = Array.prototype.slice.call(obj);
else
block.statements = [obj];
return block;
};
AST.Block.prototype = {
writeTo: function(writer, format, curly){
var body = this.statements;
if (!body || !body.length) return;
for (var i = 0, l = body.length; i < l; i++){
var expr = body[i];
if (!(expr instanceof AST.Statement)) body[i] = expr = new AST.Literal(expr);
if (expr instanceof AST.Assignment && expr.left instanceof AST.Variable) writer('var '); // Temp hack - breaks sometimes
expr.writeTo(writer, format);
writer(';\n');
}
},
toString: function(format){
var output = [];
this.writeTo(function(str){
output.push(str);
}, format);
return output.join('');
}
};
AST.prototype = AST.Block.prototype;

43
node_modules/art/lib/ast-js/src/call.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
var AST = require('./program');
AST.Call = function(expr, args){
this.expression = AST.Expression(expr);
var l = args ? args.length : 0;
this.arguments = new Array(l);
for (var i = 0; i < l; i++) this.arguments[i] = AST.Expression(args[i]);
};
AST.Call.prototype = new AST.Expression();
AST.Call.prototype.writeTo = function(write, format){
this.expression.writeTo(write, format);
write('(');
var args = this.arguments;
if (args.length > 0){
args[0].writeTo(write, format);
for (var i = 1, l = args.length; i < l; i++){
write(', ');
args[i].writeTo(write, format);
}
}
write(')');
};
AST.New = function(){
AST.Call.apply(this, arguments);
};
AST.New.prototype = new AST.Call();
AST.New.prototype.writeTo = function(write, format){
write('new ');
AST.Call.prototype.writeTo.call(this, write, format);
};
AST.Expression.prototype.call = function(){
return new AST.Call(this, arguments);
};
AST.Expression.prototype.construct = function(){
return new AST.New(this, arguments);
};

36
node_modules/art/lib/ast-js/src/condition.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
var AST = require('./program');
AST.Ternary = function(condition, then, els){
this.condition = AST.Expression(condition);
this.then = AST.Expression(then);
this.els = AST.Expression(els);
};
AST.Ternary.prototype = new AST.Expression();
AST.Ternary.prototype.writeTo = function(write, format){
this.condition.writeTo(write, format);
write(' ? ');
this.then.writeTo(write, format);
write(' : ');
this.els.writeTo(write, format);
};
AST.If = function(condition, then, els){
this.condition = condition;
this.then = then;
this.els = els;
};
AST.If.prototype = new AST.Statement();
AST.If.prototype.writeTo = function(write, format){
write('if (');
this.condition.writeTo(write, format);
write(')');
this.then.writeTo(write, format);
if (this.els){
write(' else ');
this.els.writeTo(write, format);
}
};

9
node_modules/art/lib/ast-js/src/expression.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
var AST = require('./program');
AST.Expression = function(obj){
if (arguments.length == 0) return;
if (obj && typeof obj.toExpression == 'function') obj = obj.toExpression();
return obj instanceof AST.Expression ? obj : new AST.Literal(obj);
};
AST.Expression.prototype = new AST.Statement();

44
node_modules/art/lib/ast-js/src/function.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
var AST = require('./program');
AST.Function = function(name, args, variables, statements){
if (typeof name != 'string'){
statements = variables;
variables = args;
args = name;
name = null;
}
if (statements instanceof AST.Expression) statements = new AST.Return(statements);
statements = AST.Block(statements);
this.name = name;
this.arguments = args;
this.statements = statements;
this.variables = variables;
};
AST.Function.prototype = new AST.Expression();
AST.Function.prototype.writeTo = function(write, format){
write(this.name ? 'function ' + this.name + '(' : 'function(');
if (this.arguments){
for (var i = 0, l = this.arguments.length; i < l; i++){
if (i > 0) write(', ');
write(this.arguments[i].name);
}
}
write('){\n');
this.statements.writeTo(write, format);
write('}');
};
AST.Function.prototype.compile = function(){
var l = this.arguments.length,
args = new Array(l + 1),
body = [];
for (var i = 0; i < l; i++) args[i] = this.arguments[i].name;
this.statements.writeTo(function(str){ body.push(str); });
args[l] = body.join('');
return Function.apply(Function, args);
};

75
node_modules/art/lib/ast-js/src/literal.js generated vendored Normal file
View File

@@ -0,0 +1,75 @@
var AST = require('./program');
// Based on the MooTools JSON implementation
var specialChars = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'},
escapable = new RegExp('[\\\\"\\x00-\\x1f]', 'g'), // RegExp Literal doesn't work in ExtendScript
replaceChars = function(chr){
return specialChars[chr] || ('\\u00' + Math.floor(chr.charCodeAt() / 16).toString(16) + (chr.charCodeAt() % 16).toString(16));
},
encode = function(write, obj, format){
if (obj === null){
write('null');
return;
}
if (typeof obj === 'undefined'){
write('undefined');
return;
}
if (typeof obj.toExpression == 'function')
{
obj = obj.toExpression();
}
if (obj instanceof AST.Expression){
obj.writeTo(write, format);
return;
}
if (typeof obj == 'string'){
write('"' + obj.replace(escapable, replaceChars) + '"');
return;
}
if (typeof obj == 'object' && Object.prototype.toString.call(obj) != '[object RegExp]'){
var first = true;
if (Object.prototype.toString.call(obj) == '[object Array]'){
write('[');
for (var i = 0, l = obj.length; i < l; i++){
if (!Object.hasOwnProperty.call(obj, key)) continue;
if (first) first = false; else write(', ');
encode(write, obj, format);
}
write(']');
} else {
write('{');
for (var key in obj){
if (!Object.hasOwnProperty.call(obj, key)) continue;
if (first) first = false; else write(', ');
encode(write, key, format);
write(': ');
encode(write, obj[key], format);
}
write('}');
}
return;
}
write(String(obj));
};
AST.Literal = function(value){
this.value = value;
};
AST.Literal.prototype = new AST.Expression();
AST.Literal.prototype.writeTo = function(writer, format){
encode(writer, this.value, format);
};

72
node_modules/art/lib/ast-js/src/operator.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
var AST = require('./program');
AST.Operator = function(left, operator, right){
this.left = AST.Expression(left);
this.operator = operator;
this.right = AST.Expression(right);
};
AST.Operator.prototype = new AST.Expression();
AST.Operator.prototype.writeTo = function(write, format){
this.left.writeTo(write, format);
write(' ' + this.operator + ' ');
this.right.writeTo(write, format);
};
AST.Not = function(expr){
this.expression = expr;
};
AST.Not.prototype = new AST.Expression();
AST.Not.prototype.writeTo = function(write, format){
write('!');
this.expression.writeTo(write, format);
};
AST.Expression.prototype.not = function(){
return new AST.Not(this);
};
var operators = {
Equals: '==',
NotEquals: '!=',
StrictEquals: '===',
StrictNotEquals: '!==',
LessThan: '<',
MoreThan: '>',
LessThanOrEquals: '<=',
MoreThanOrEquals: '>=',
And: '&&',
Or: '||',
BitwiseAnd: '&',
BitwiseOr: '|',
BitwiseXor: '^',
LeftShift: '<<',
RightShift: '>>',
ZeroFillRightShift: '>>>',
Add: '+',
Subtract: '-',
Multiply: '*',
Divide: '/',
Mod: '%'
};
for (var key in operators) (function(name, cname, op){
AST[name] = function(left, right){
return new AST.Operator(left, op, right);
};
AST.Expression.prototype[cname] = function(expr){
return new AST[name](this, expr);
};
})(key, key.substr(0, 1).toLowerCase() + key.substr(1), operators[key]);

7
node_modules/art/lib/ast-js/src/program.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
var AST = function(){
return AST.Block.apply(this, arguments);
};
module.exports = AST;

26
node_modules/art/lib/ast-js/src/property.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
var AST = require('./program');
AST.Property = function(expr, name){
this.expression = AST.Expression(expr);
this.name = AST.Expression(name);
};
AST.Property.prototype = new AST.Expression();
AST.Property.prototype.writeTo = function(write, format){
this.expression.writeTo(write, format);
if (this.name instanceof AST.Literal && this.name.value){
write('.');
write(String(this.name.value));
return;
}
write('[');
this.name.writeTo(write, format);
write(']');
};
AST.Expression.prototype.property = function(name){
return new AST.Property(this, name);
};

41
node_modules/art/lib/ast-js/src/statement.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
var AST = require('./program');
AST.Statement = function(label){
this.label = label;
};
AST.Statement.prototype = {
writeTo: function(compressed){ },
toString: function(compressed){
var output = [];
this.writeTo(function(str){
output.push(str);
}, compressed);
return output.join('');
}
};
AST.Return = function(expr){
if (arguments.length) this.expression = AST.Expression(expr);
};
AST.Return.prototype = new AST.Statement();
AST.Return.prototype.writeTo = function(write, format){
write('return');
if (!this.expression) return;
write(' ');
this.expression.writeTo(write, format);
};
AST.Break = function(){
};
AST.Break.prototype = new AST.Statement();
AST.Break.prototype.writeTo = function(write, format){
write('break');
};

20
node_modules/art/lib/ast-js/src/variable.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
var AST = require('./program');
AST.Variable = function(name){
this.name = name;
};
AST.Variable.prototype = new AST.Expression();
AST.Variable.prototype.writeTo = function(write){
write(this.name);
};
AST.This = function(){
};
AST.This.prototype = new AST.Expression();
AST.This.prototype.writeTo = function(write){
write('this');
};

21
node_modules/art/lib/sheet.js/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2010 Thomas Aylott (SubtleGradient.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

59
node_modules/art/lib/sheet.js/README.md generated vendored Normal file
View File

@@ -0,0 +1,59 @@
Sheet.js by Thomas Aylott of MooTools
**STATE: well tested and stable**
This project uses semver.org standard version numbering.
Sheet.js
========
Parse CSS in JavaScript
* Test-first Development
* UniversalJS
* Zero dependencies
* DOM-less (no document necessary)
* CommonJS Modules 1.0+ with global fallback
* Browser support
* Implements W3C `document.styleSheets` API
* Implements WebKit CSS Animation API
Flexible Parsing
----------------
* Supports WebKit CSS Animation syntax
* Supports custom selectors, @rules, properties and values
* Supports nested rules
* Supports HTML style attribute values
i.e. CSS rules without the selectors and brackets
### Coming Soon…
* Support for custom CSS-like languages like the Sass 3.0 SCSS (Sassy CSS) and Less CSS
Basic Usage
-----------
ClientSide / Browser Usage
var myStyleSheet = new Sheet("#selector { color:blue }");
myStyleSheet.cssRules[0].style.color; // blue
// etc…
ServerSide / CommonJS Usage
require.paths.push('path/to/Sheet.js/Source'); // You might not need this
var Sheet = require('Sheet').Sheet;
var myStyleSheet = new Sheet("#selector { color:blue }");
myStyleSheet.cssRules[0].style.color; // blue
// etc…
Advanced ClientSide Namespacing
-------------------------------
If you need to move Sheet.js to its own custom namespace simply define a global `exports` object before loading Sheet.js. Sheet.js will see that object, assume that it's in a CommonJS environment and then attach itself onto that object instead of including itself globally.
You really shouldn't need to do that.
But isn't it great to know you could?

65
node_modules/art/lib/sheet.js/Source/Sheet.DOM.js generated vendored Normal file
View File

@@ -0,0 +1,65 @@
/*
---
name : Sheet.DOM
description : Sheet.DOM adds some handy stuff for working with the browser's native CSS capabilities.
authors : Thomas Aylott
copyright : © 2010 Thomas Aylott
license : MIT
provides : Sheet.DOM
...
*/
;(function(document,styleSheets){
if (typeof Sheet == 'undefined') Sheet = {}
if (Sheet.DOM == null) Sheet.DOM = {}
Sheet.DOM.createSheetNode = function(raw){
var sheet = Sheet.DOM.createSheet(raw)
var node = sheet.ownerNode
node.parentNode.removeChild(node)
return node
}
var UID = 0
Sheet.DOM.createSheet = createStyleSheetWithCSS
function createStyleSheetWithCSS(css){
var styleElement = document.createElement("style")
styleElement.appendChild(document.createTextNode(css))
styleElement.setAttribute('name', styleElement.id = "SheetRuler-" + +new Date)
document.getElementsByTagName('head')[0].appendChild(styleElement)
return styleElement.sheet || styleElement.styleSheet
}
Sheet.DOM.createStyle = function(raw){
var div = document.createElement('div')
div.innerHTML = '<p style="' + String_escapeHTML.call(raw) + '"></p>'
return div.firstChild.style
}
Sheet.DOM.createSheetStyle = function(raw){
var className = 'Sheet' + +new Date
var sheet = Sheet.DOM.createSheet("." + className + "{" + raw + "}")
return (sheet.rules || sheet.cssRules)[0].style
}
Sheet.DOM.createRule = function(selector,style){
var rule = selector + "{" + style + "}"
var sheet = Sheet.DOM.createSheet(rule)
var rules = sheet.rules || sheet.cssRules
return rules[rules.length - 1]
}
Sheet.DOM.createStyleWrapped = function(raw){
return {style:Sheet.DOM.createStyle(raw)}
}
function String_escapeHTML(){
return ('' + this).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/"/g,'&quot;')
}
}(document, document.styleSheets));

80
node_modules/art/lib/sheet.js/Source/Sheet.js generated vendored Normal file
View File

@@ -0,0 +1,80 @@
/*
---
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));

194
node_modules/art/lib/sheet.js/Source/SheetParser.CSS.js generated vendored Normal file
View File

@@ -0,0 +1,194 @@
/*
---
name : SheetParser.CSS
authors : Thomas Aylott
copyright : © 2010 Thomas Aylott
license : MIT
provides : SheetParser.CSS
requires : combineRegExp
...
*/
;(function(exports){
/*<depend>*/
var UNDEF = {undefined:1}
if (!exports.SheetParser) exports.SheetParser = {}
/*<CommonJS>*/
var combineRegExp = UNDEF[typeof require]
? exports.combineRegExp
: require('./sg-regex-tools').combineRegExp
var SheetParser = exports.SheetParser
/*</CommonJS>*/
/*<debug>*/;if (UNDEF[typeof combineRegExp]) throw new Error('Missing required function: "combineRegExp"');/*</debug>*/
/*</depend>*/
var CSS = SheetParser.CSS = {version: '1.0.2 dev'}
CSS.trim = trim
function trim(str){
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
var str = (''+str).replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
}
CSS.camelCase = function(string){
return ('' + string).replace(camelCaseSearch, camelCaseReplace)
}
var camelCaseSearch = /-\D/g
function camelCaseReplace(match){
return match.charAt(1).toUpperCase()
}
CSS.parse = function(cssText){
var found
, rule
, rules = {length:0}
, keyIndex = -1
, regex = this.parser
, names = CSS.parser.names
, i,r,l
, ruleCount
rules.cssText = cssText = trim(cssText)
// strip comments
cssText = cssText.replace(CSS.comment, '');
regex.lastIndex = 0
while ((found = regex.exec(cssText))){
// avoid an infinite loop on zero-length keys
if (regex.lastIndex == found.index) ++ regex.lastIndex
// key:value
if (found[names._key]){
rules[rules.length ++] = found[names._key]
rules[found[names._key]] = found[names._value]
rules[CSS.camelCase(found[names._key])] = found[names._value]
continue
}
rules[rules.length++] = rule = {}
for (i = 0, l = names.length; i < l; ++i){
if (!(names[i-1] && found[i])) continue
rule[names[i-1]] = trim(found[i])
}
}
var atKey, atRule, atList, atI
for (i = 0, l = rules.length; i < l; ++i){
if (!rules[i]) continue
if (rules[i]._style_cssText){
rules[i].style = CSS.parse(rules[i]._style_cssText)
delete rules[i]._style_cssText
}
// _atKey/_atValue
if (atKey = rules[i]._atKey){
atKey = CSS.camelCase(atKey)
atRule = {length:0}
rules[i][atKey] = atRule
atRule["_source"] =
atRule[atKey + "Text"] = rules[i]._atValue
atList = ('' + rules[i]._atValue).split(/,\s*/)
for (atI = 0; atI < atList.length; ++atI){
atRule[atRule.length ++] = atList[atI]
}
rules[i].length = 1
rules[i][0] = atKey
delete rules[i]._atKey
delete rules[i]._atValue
}
if (rules[i].style)
for (ruleCount = -1, r = -1, rule; rule = rules[i].style[++r];){
if (typeof rule == 'string') continue
rules[i][r] = (rules[i].cssRules || (rules[i].cssRules = {}))[++ ruleCount] = rule
rules[i].cssRules.length = ruleCount + 1
rules[i].rules = rules[i].cssRules
}
}
return rules
}
var x = combineRegExp
var OR = '|'
;(CSS.at = x(/\s*@([-a-zA-Z0-9]+)\s+(([\w-]+)?[^;{]*)/))
.names=[ '_atKey', '_atValue', 'name']
CSS.atRule = x([CSS.at, ';'])
;(CSS.keyValue_key = x(/([-a-zA-Z0-9]+)/))
.names=[ '_key']
;(CSS.keyValue_value_end = x(/(?:;|(?=\})|$)/))
;(CSS.notString = x(/[^"']+/))
;(CSS.stringSingle = x(/"(?:[^"]|\\")*"/))
;(CSS.stringDouble = x(/'(?:[^']|\\')*'/))
;(CSS.string = x(['(?:',CSS.stringSingle ,OR, CSS.stringDouble,')']))
;(CSS.propertyValue = x([/[^;}]+/, CSS.keyValue_value_end]))
var rRound = "(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))"
;(CSS.keyValue_value = x(
[
x(['((?:'
, CSS.stringSingle
, OR
, CSS.stringDouble
, OR
, "\\("+rRound+"*\\)"
, OR
, /[^;}()]/ // not a keyValue_value terminator
, ')*)'
])
, CSS.keyValue_value_end
])).names = ['_value']
;(CSS.keyValue = x([CSS.keyValue_key ,/\s*:\s*/, CSS.keyValue_value]))
;(CSS.comment = x(/\/\*\s*((?:[^*]|\*(?!\/))*)\s*\*\//))
.names=[ 'comment']
;(CSS.selector = x(['(',/\s*(\d+%)\s*/,OR,'(?:',/[^{}'"()]|\([^)]*\)|\[[^\]]*\]/,')+',')']))
.names=[ 'selectorText','keyText']
var rCurly = "(?:[^{}]|\\{(?:[^{}]|\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})*\\})*\\})"
var rCurlyRound = "(?:[^{}()]+|\\{(?:[^{}()]+|\\{(?:[^{}()]+|\\{(?:[^{}()]+|\\{[^{}()]*\\})*\\})*\\})*\\})"
;(CSS.block = x("\\{\\s*((?:"+"\\("+rRound+"*\\)|"+rCurly+")*)\\s*\\}"))
.names=[ '_style_cssText']
CSS.selectorBlock = x([CSS.selector, CSS.block])
CSS.atBlock = x([CSS.at, CSS.block])
CSS.parser = x
(
[ x(CSS.comment)
, OR
, x(CSS.atBlock)
, OR
, x(CSS.atRule)
, OR
, x(CSS.selectorBlock)
, OR
, x(CSS.keyValue)
]
, 'cssText'
)
})(typeof exports != 'undefined' ? exports : this);

42
node_modules/art/lib/sheet.js/Source/sg-regex-tools.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
/*
---
name : sg-regex-tools
description : A few super-handy tools for messing around with RegExp
authors : Thomas Aylott
copyright : © 2010 Thomas Aylott
license : MIT
provides : [combineRegExp]
...
*/
;(function(exports){
exports.combineRegExp = function(regex, group){
if (regex.source) regex = [regex]
var names = [], i, source = '', this_source
for (i = 0; i < regex.length; ++i){ if (!regex[i]) continue
this_source = regex[i].source || ''+regex[i]
if (this_source == '|') source += '|'
else {
source += (group?'(':'') + this_source.replace(/\s/g,'') + (group?')':'')
if (group) names.push(group)
}
if (regex[i].names) names = names.concat(regex[i].names)
}
try {
regex = new RegExp(source,'gm')
}
catch (e){
throw new SyntaxError('Invalid Syntax: ' + source +'; '+ e)
}
// [key] → 1
for (i = -1; i < names.length; ++i) names[names[i]] = i + 1
// [1] → key
regex.names = names
return regex
}
}(typeof exports != 'undefined' ? exports : this))

55
node_modules/art/lib/sheet.js/package.json generated vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"name": "Sheet",
"version": "1.0.2 dev",
"description": "100% DOM-less JavaScript implementation of the styleSheets, cssRule & style APIs \nSupports custom and browser-incompatible CSS syntax like nested rules",
"keywords": [
"CSS",
"CSSOM",
"styleSheet",
"cssRule",
"style",
"parse"
],
"authors": ["Thomas Aylott"],
"contributors": [
{
"name": "Thomas Aylott",
"email": "thomas@subtlegradient.com",
"web": "http://subtlegradient.com"
}
],
"copyright": "© 2010 Thomas Aylott",
"license": "MIT License",
"licenses": [
{
"type": "MIT",
"url": "http://creativecommons.org/licenses/MIT/"
}
],
"repositories": [{
"type": "git",
"url": "http://github.com/subtleGradient/Sheet.js/"
}],
"bugs": {
"web": "http://github.com/subtleGradient/Sheet.js/issues"
},
"directories": {
"src": "./Source",
"lib": "./Source",
"test": "./Test"
},
"sources": [
"Source/Sheet.js",
"Source/SheetParser.CSS.js"
],
"main":"./Source/Sheet"
}

6
node_modules/art/lib/slick/.gitmodules generated vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "SlickSpec/Runner"]
path = SlickSpec/Runner
url = git://github.com/mootools/mootools-runner.git
[submodule "speed/benchmarkjs"]
path = speed/benchmarkjs
url = https://github.com/mathiasbynens/Benchmark.js.git

19
node_modules/art/lib/slick/Makefile generated vendored Normal file
View File

@@ -0,0 +1,19 @@
MODULES = 'Source/Slick.Parser.js' \
'Source/Slick.Finder.js'
FILE = 'slick.js'
test: setup kill_servers
@python -m SimpleHTTPServer 7777 &> /dev/null &
@open http://localhost:7777/SlickSpec/Runner/runner.html
kill_servers:
@ps aux | grep "SimpleHTTPServer 7777" | grep -v grep | awk '{ print $$2 }' | xargs kill -9 &> /dev/null
setup:
@git submodule update --init --recursive
build:
@cat ${MODULES} > ${FILE}

127
node_modules/art/lib/slick/README.md generated vendored Normal file
View File

@@ -0,0 +1,127 @@
(Slick is an official [MooTools](http://mootools.net) project)
Slick
=====
A new standalone selector engine that is totally slick!
-------------------------------------------------------
### Create your own custom pseudo-classes!
Ever want to make your own `:my-widget(rocks)` pseudoclass? Now you can!
### Use your own custom getAttribute code!
EG: Use MooTool's Element.get method or jQuery's $.attr
### Use your own parser!
Want to support XPATH selectors? JSONPath selectors? Pre-cached JS Object selctors? Just swap out the default parser and make your own.
### Use the parser by itself!
Want to integrate a CSS3 Selector parser into your own app somehow? Use the slick selector CSS3 parser by itself and get a JS Object representation of your selector.
---
Slick Selector Engine
=====================
Usage
-----
### `search` context for selector
Search this context for any nodes that match this selector.
Expects:
* context: document or node or array of documents or nodes
* selector: String or SelectorObject
* (**optional**) append: Array or Object with a push method
Returns: append argument or Array of 0 or more nodes
Slick.search(document, "#foo > bar.baz") → [<bar>, <bar>, <bar>]
Slick.search([<ol>, <ul>], "li > a") → [<a>, <a>, <a>]
Slick.search(document, "#foo > bar.baz", { push:function(){} }) → { push:function(){}, 0:<bar>, 1:<bar>, 2:<bar> }
### `find` first in context with selector or null
Find the first node in document that matches selector or null if none are found.
Expects:
* context: document or node or array of documents or nodes
* selector: String or SelectorObject
Returns: Element or null
Slick.find(document, "#foo > bar.baz") → <bar>
Slick.find(node, "#does-not-exist") → null
### node `match` selector?
Does this node match this selector?
Expects:
* node
* node, String or SelectorObject
Returns: true or false
Slick.match(<div class=rocks>, "div.rocks") → true
Slick.match(<div class=lame>, "div.rocks") → false
Slick.match(<div class=lame>, <div class=rocks>) → false
### context `contains` node?
Does this context contain this node? Is the context a parent of this node?
Expects:
* context: document or node
* node: node
Returns: true or false
Slick.contains(<ul>, <li>) → true
Slick.contains(<body>, <html>) → false
---
Slick CSS Selector Parser
=========================
Parse a CSS selector string into a JavaScript object
----------------------------------------------------
Usage
-----
### `parse` selector into object
Parse a CSS Selector String into a Selector Object.
Expects: String
Returns: SelectorObject
Slick.parse("#foo > bar.baz") → SelectorObject
SelectorObject format
---------------------
### `#foo > bar.baz`
{
"raw":"#foo > bar.baz",
"expressions": [[
{ "combinator":" ", "tag":"*", "id":"foo" },
{ "combinator":">", "tag":"bar", "classList": ["baz"], "classes": [{"value":"baz", "regexp":RegExp }]}
]]
}
### `h1, h2, ul > li, .things`
{
"raw": "h1, h2, ul > li, .things",
"expressions": [
[{ "combinator":" ", "tag": "h1" }],
[{ "combinator":" ", "tag": "h2" }],
[{ "combinator":" ", "tag": "ul" }, { "combinator": ">", "tag": "li" }],
[{ "combinator":" ", "tag": "*", "classList": ["things"], "classes": [{"value": "things", "regexp":RegExp }] }]
]
}

1010
node_modules/art/lib/slick/Source/Slick.Finder.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

230
node_modules/art/lib/slick/Source/Slick.Parser.js generated vendored Normal file
View File

@@ -0,0 +1,230 @@
/*
---
name: Slick.Parser
description: Standalone CSS3 Selector parser
provides: Slick.Parser
...
*/
;(function(){
var parsed,
separatorIndex,
combinatorIndex,
reversed,
cache = {},
reverseCache = {},
reUnescape = /\\/g;
var parse = function(expression, isReversed){
if (expression == null) return null;
if (expression.Slick === true) return expression;
expression = ('' + expression).replace(/^\s+|\s+$/g, '');
reversed = !!isReversed;
var currentCache = (reversed) ? reverseCache : cache;
if (currentCache[expression]) return currentCache[expression];
parsed = {
Slick: true,
expressions: [],
raw: expression,
reverse: function(){
return parse(this.raw, true);
}
};
separatorIndex = -1;
while (expression != (expression = expression.replace(regexp, parser)));
parsed.length = parsed.expressions.length;
return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed;
};
var reverseCombinator = function(combinator){
if (combinator === '!') return ' ';
else if (combinator === ' ') return '!';
else if ((/^!/).test(combinator)) return combinator.replace(/^!/, '');
else return '!' + combinator;
};
var reverse = function(expression){
var expressions = expression.expressions;
for (var i = 0; i < expressions.length; i++){
var exp = expressions[i];
var last = {parts: [], tag: '*', combinator: reverseCombinator(exp[0].combinator)};
for (var j = 0; j < exp.length; j++){
var cexp = exp[j];
if (!cexp.reverseCombinator) cexp.reverseCombinator = ' ';
cexp.combinator = cexp.reverseCombinator;
delete cexp.reverseCombinator;
}
exp.reverse().push(last);
}
return expression;
};
var escapeRegExp = (function(){
// Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan <http://stevenlevithan.com/regex/xregexp/> MIT License
var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g, to = '\\';
return function(string){ return string.replace(from, to) }
}())
var regexp = new RegExp(
/*
#!/usr/bin/env ruby
puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'')
__END__
"(?x)^(?:\
\\s* ( , ) \\s* # Separator \n\
| \\s* ( <combinator>+ ) \\s* # Combinator \n\
| ( \\s+ ) # CombinatorChildren \n\
| ( <unicode>+ | \\* ) # Tag \n\
| \\# ( <unicode>+ ) # ID \n\
| \\. ( <unicode>+ ) # ClassName \n\
| # Attribute \n\
\\[ \
\\s* (<unicode1>+) (?: \
\\s* ([*^$!~|]?=) (?: \
\\s* (?:\
([\"']?)(.*?)\\9 \
)\
) \
)? \\s* \
\\](?!\\]) \n\
| :+ ( <unicode>+ )(?:\
\\( (?:\
(?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\
) \\)\
)?\
)"
*/
"^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)"
.replace(/<combinator>/, '[' + escapeRegExp(">+~`!@$%^&={}\\;</") + ']')
.replace(/<unicode>/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])')
.replace(/<unicode1>/g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])')
);
function parser(
rawMatch,
separator,
combinator,
combinatorChildren,
tagName,
id,
className,
attributeKey,
attributeOperator,
attributeQuote,
attributeValue,
pseudoMarker,
pseudoClass,
pseudoQuote,
pseudoClassQuotedValue,
pseudoClassValue
){
if (separator || separatorIndex === -1){
parsed.expressions[++separatorIndex] = [];
combinatorIndex = -1;
if (separator) return '';
}
if (combinator || combinatorChildren || combinatorIndex === -1){
combinator = combinator || ' ';
var currentSeparator = parsed.expressions[separatorIndex];
if (reversed && currentSeparator[combinatorIndex])
currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator);
currentSeparator[++combinatorIndex] = {combinator: combinator, tag: '*'};
}
var currentParsed = parsed.expressions[separatorIndex][combinatorIndex];
if (tagName){
currentParsed.tag = tagName.replace(reUnescape, '');
} else if (id){
currentParsed.id = id.replace(reUnescape, '');
} else if (className){
className = className.replace(reUnescape, '');
if (!currentParsed.classList) currentParsed.classList = [];
if (!currentParsed.classes) currentParsed.classes = [];
currentParsed.classList.push(className);
currentParsed.classes.push({
value: className,
regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
});
} else if (pseudoClass){
pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue;
pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null;
if (!currentParsed.pseudos) currentParsed.pseudos = [];
currentParsed.pseudos.push({
key: pseudoClass.replace(reUnescape, ''),
value: pseudoClassValue,
type: pseudoMarker.length == 1 ? 'class' : 'element'
});
} else if (attributeKey){
attributeKey = attributeKey.replace(reUnescape, '');
attributeValue = (attributeValue || '').replace(reUnescape, '');
var test, regexp;
switch (attributeOperator){
case '^=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) ); break;
case '$=' : regexp = new RegExp( escapeRegExp(attributeValue) +'$' ); break;
case '~=' : regexp = new RegExp( '(^|\\s)'+ escapeRegExp(attributeValue) +'(\\s|$)' ); break;
case '|=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) +'(-|$)' ); break;
case '=' : test = function(value){
return attributeValue == value;
}; break;
case '*=' : test = function(value){
return value && value.indexOf(attributeValue) > -1;
}; break;
case '!=' : test = function(value){
return attributeValue != value;
}; break;
default : test = function(value){
return !!value;
};
}
if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function(){
return false;
};
if (!test) test = function(value){
return value && regexp.test(value);
};
if (!currentParsed.attributes) currentParsed.attributes = [];
currentParsed.attributes.push({
key: attributeKey,
operator: attributeOperator,
value: attributeValue,
test: test
});
}
return '';
};
// Slick NS
var Slick = (this.Slick || {});
Slick.parse = function(expression){
return parse(expression);
};
Slick.escapeRegExp = escapeRegExp;
if (!this.Slick) this.Slick = Slick;
}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);

12
node_modules/art/lib/slick/package.json generated vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"name" : "slick",
"description" : "Standalone CSS Selector Parser and Engine.",
"url" : "http://mootools.github.com/slick",
"keywords" : ["util", "dom", "css", "selector", "parser", "mootools"],
"author" : "Thomas Aylott",
"contributors" : ["Fabio Miranda Costa", "Valerio Proietti", "Jan Kassens"],
"dependencies" : [],
"lib" : "Source",
"main" : "./Source/slick.js",
"version" : "1.0.0"
}

19
node_modules/art/lib/slick/package.yml generated vendored Normal file
View File

@@ -0,0 +1,19 @@
name: "Slick"
web: "[mootools.net](http://mootools.net)"
description: "Slick, the most awesome CSS Parser and Finder"
license: "[MIT License](http://mootools.net/license.txt)"
copyright: "&copy; [MooTools](http://mootools.net)"
authors:
- Thomas Aylott
- Valerio Proietti
- Fabio M Costa
- Jan Kassens
sources:
- "Source/Slick.Parser.js"
- "Source/Slick.Finder.js"