(dist) build 1.0.19
This commit is contained in:
parent
f272611137
commit
8e967fe8a0
102
dist/less-1.0.18.js → dist/less-1.0.19.js
vendored
102
dist/less-1.0.18.js → dist/less-1.0.19.js
vendored
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// LESS - Leaner CSS v1.0.18
|
// LESS - Leaner CSS v1.0.19
|
||||||
// http://lesscss.org
|
// http://lesscss.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2010, Alexis Sellier
|
// Copyright (c) 2010, Alexis Sellier
|
||||||
@ -365,24 +365,33 @@ less.Parser = function Parser(env) {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
lines = input.split('\n');
|
lines = input.split('\n');
|
||||||
line = (input.slice(0, e.index).match(/\n/g) || "").length + 1;
|
line = getLine(e.index);
|
||||||
|
|
||||||
for (var n = e.index, column = -1;
|
for (var n = e.index, column = -1;
|
||||||
n >= 0 && input.charAt(n) !== '\n';
|
n >= 0 && input.charAt(n) !== '\n';
|
||||||
n--) { column++ }
|
n--) { column++ }
|
||||||
|
|
||||||
throw {
|
throw {
|
||||||
name: "NameError",
|
name: "NameError",
|
||||||
message: e.message,
|
message: e.message,
|
||||||
line: line,
|
filename: env.filename,
|
||||||
|
index: e.index,
|
||||||
|
line: line + 1,
|
||||||
|
callLine: getLine(e.call) + 1,
|
||||||
|
callExtract: lines[getLine(e.call)],
|
||||||
stack: e.stack,
|
stack: e.stack,
|
||||||
column: column,
|
column: column,
|
||||||
extract: [
|
extract: [
|
||||||
lines[line - 2],
|
|
||||||
lines[line - 1],
|
lines[line - 1],
|
||||||
lines[line]
|
lines[line],
|
||||||
|
lines[line + 1]
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLine(index) {
|
||||||
|
return (input.slice(0, index).match(/\n/g) || "").length;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
})(root.toCSS);
|
})(root.toCSS);
|
||||||
|
|
||||||
@ -534,7 +543,7 @@ less.Parser = function Parser(env) {
|
|||||||
call: function () {
|
call: function () {
|
||||||
var name, args;
|
var name, args;
|
||||||
|
|
||||||
if (! (name = $(/([a-zA-Z0-9_-]+|%)\(/g))) return;
|
if (! (name = $(/([\w-]+|%)\(/g))) return;
|
||||||
|
|
||||||
if (name[1].toLowerCase() === 'alpha') { return $(this.alpha) }
|
if (name[1].toLowerCase() === 'alpha') { return $(this.alpha) }
|
||||||
|
|
||||||
@ -570,7 +579,7 @@ less.Parser = function Parser(env) {
|
|||||||
var value;
|
var value;
|
||||||
|
|
||||||
if (input.charAt(i) !== 'u' || !$(/url\(/g)) return;
|
if (input.charAt(i) !== 'u' || !$(/url\(/g)) return;
|
||||||
value = $(this.entities.quoted) || $(/[-a-zA-Z0-9_%@$\/.&=:;#+?]+/g);
|
value = $(this.entities.quoted) || $(/[-\w%@$\/.&=:;#+?]+/g);
|
||||||
if (! $(')')) throw new(Error)("missing closing ) for url()");
|
if (! $(')')) throw new(Error)("missing closing ) for url()");
|
||||||
|
|
||||||
return new(tree.URL)(value.value ? value : new(tree.Anonymous)(value));
|
return new(tree.URL)(value.value ? value : new(tree.Anonymous)(value));
|
||||||
@ -587,7 +596,7 @@ less.Parser = function Parser(env) {
|
|||||||
variable: function () {
|
variable: function () {
|
||||||
var name, index = i;
|
var name, index = i;
|
||||||
|
|
||||||
if (input.charAt(i) === '@' && (name = $(/@[a-zA-Z0-9_-]+/g))) {
|
if (input.charAt(i) === '@' && (name = $(/@[\w-]+/g))) {
|
||||||
return new(tree.Variable)(name, index);
|
return new(tree.Variable)(name, index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -616,7 +625,7 @@ less.Parser = function Parser(env) {
|
|||||||
var value, c = input.charCodeAt(i);
|
var value, c = input.charCodeAt(i);
|
||||||
if ((c > 57 || c < 45) || c === 47) return;
|
if ((c > 57 || c < 45) || c === 47) return;
|
||||||
|
|
||||||
if (value = $(/(-?[0-9]*\.?[0-9]+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g)) {
|
if (value = $(/(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g)) {
|
||||||
return new(tree.Dimension)(value[1], value[2]);
|
return new(tree.Dimension)(value[1], value[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -630,7 +639,7 @@ less.Parser = function Parser(env) {
|
|||||||
variable: function () {
|
variable: function () {
|
||||||
var name;
|
var name;
|
||||||
|
|
||||||
if (input.charAt(i) === '@' && (name = $(/(@[a-zA-Z0-9_-]+)\s*:/g))) { return name[1] }
|
if (input.charAt(i) === '@' && (name = $(/(@[\w-]+)\s*:/g))) { return name[1] }
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -668,7 +677,7 @@ less.Parser = function Parser(env) {
|
|||||||
call: function () {
|
call: function () {
|
||||||
var elements = [], e, c, args, index = i;
|
var elements = [], e, c, args, index = i;
|
||||||
|
|
||||||
while (e = $(/[#.][a-zA-Z0-9_-]+/g)) {
|
while (e = $(/[#.][\w-]+/g)) {
|
||||||
elements.push(new(tree.Element)(c, e));
|
elements.push(new(tree.Element)(c, e));
|
||||||
c = $('>');
|
c = $('>');
|
||||||
}
|
}
|
||||||
@ -703,7 +712,7 @@ less.Parser = function Parser(env) {
|
|||||||
|
|
||||||
if (input.charAt(i) !== '.' || peek(/[^{]*(;|})/g)) return;
|
if (input.charAt(i) !== '.' || peek(/[^{]*(;|})/g)) return;
|
||||||
|
|
||||||
if (match = $(/([#.][a-zA-Z0-9_-]+)\s*\(/g)) {
|
if (match = $(/([#.][\w-]+)\s*\(/g)) {
|
||||||
name = match[1];
|
name = match[1];
|
||||||
|
|
||||||
while (param = $(/@[\w-]+/g) || $(this.entities.literal)
|
while (param = $(/@[\w-]+/g) || $(this.entities.literal)
|
||||||
@ -762,7 +771,7 @@ less.Parser = function Parser(env) {
|
|||||||
var value;
|
var value;
|
||||||
|
|
||||||
if (! $(/opacity=/gi)) return;
|
if (! $(/opacity=/gi)) return;
|
||||||
if (value = $(/[0-9]+/g) || $(this.entities.variable)) {
|
if (value = $(/\d+/g) || $(this.entities.variable)) {
|
||||||
if (! $(')')) throw new(Error)("missing closing ) for alpha()");
|
if (! $(')')) throw new(Error)("missing closing ) for alpha()");
|
||||||
return new(tree.Alpha)(value);
|
return new(tree.Alpha)(value);
|
||||||
}
|
}
|
||||||
@ -784,7 +793,7 @@ less.Parser = function Parser(env) {
|
|||||||
var e, t;
|
var e, t;
|
||||||
|
|
||||||
c = $(this.combinator);
|
c = $(this.combinator);
|
||||||
e = $(/[.#:]?[a-zA-Z0-9_-]+/g) || $('*') || $(this.attribute) || $(/\([^)@]+\)/g);
|
e = $(/[.#:]?[\w-]+/g) || $('*') || $(this.attribute) || $(/\([^)@]+\)/g);
|
||||||
|
|
||||||
if (e) { return new(tree.Element)(c, e) }
|
if (e) { return new(tree.Element)(c, e) }
|
||||||
},
|
},
|
||||||
@ -860,7 +869,7 @@ less.Parser = function Parser(env) {
|
|||||||
ruleset: function () {
|
ruleset: function () {
|
||||||
var selectors = [], s, rules, match, memo = i;
|
var selectors = [], s, rules, match, memo = i;
|
||||||
|
|
||||||
if (match = peek(/([a-z.#: _-]+)[\s\n]*\{/g)) {
|
if (match = peek(/([.#: \w-]+)[\s\n]*\{/g)) {
|
||||||
i += match[0].length - 1;
|
i += match[0].length - 1;
|
||||||
selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
|
selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
|
||||||
} else {
|
} else {
|
||||||
@ -1176,7 +1185,7 @@ function clamp(val) {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Alpha = function Alpha(val) {
|
tree.Alpha = function (val) {
|
||||||
this.value = val;
|
this.value = val;
|
||||||
};
|
};
|
||||||
tree.Alpha.prototype = {
|
tree.Alpha.prototype = {
|
||||||
@ -1189,7 +1198,7 @@ tree.Alpha.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Anonymous = function Anonymous(string) {
|
tree.Anonymous = function (string) {
|
||||||
this.value = string.content || string;
|
this.value = string.content || string;
|
||||||
};
|
};
|
||||||
tree.Anonymous.prototype = {
|
tree.Anonymous.prototype = {
|
||||||
@ -1205,7 +1214,7 @@ tree.Anonymous.prototype = {
|
|||||||
//
|
//
|
||||||
// A function call node.
|
// A function call node.
|
||||||
//
|
//
|
||||||
tree.Call = function Call(name, args) {
|
tree.Call = function (name, args) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
};
|
};
|
||||||
@ -1243,7 +1252,7 @@ tree.Call.prototype = {
|
|||||||
//
|
//
|
||||||
// RGB Colors - #ff0014, #eee
|
// RGB Colors - #ff0014, #eee
|
||||||
//
|
//
|
||||||
tree.Color = function Color(rgb, a) {
|
tree.Color = function (rgb, a) {
|
||||||
//
|
//
|
||||||
// The end goal here, is to parse the arguments
|
// The end goal here, is to parse the arguments
|
||||||
// into an integer triplet, such as `128, 255, 0`
|
// into an integer triplet, such as `128, 255, 0`
|
||||||
@ -1274,7 +1283,9 @@ tree.Color.prototype = {
|
|||||||
//
|
//
|
||||||
toCSS: function () {
|
toCSS: function () {
|
||||||
if (this.alpha && this.alpha < 1.0) {
|
if (this.alpha && this.alpha < 1.0) {
|
||||||
return "rgba(" + this.rgb.concat(this.alpha).join(', ') + ")";
|
return "rgba(" + this.rgb.map(function (c) {
|
||||||
|
return Math.round(c);
|
||||||
|
}).concat(this.alpha).join(', ') + ")";
|
||||||
} else {
|
} else {
|
||||||
return '#' + this.rgb.map(function (i) {
|
return '#' + this.rgb.map(function (i) {
|
||||||
i = Math.round(i);
|
i = Math.round(i);
|
||||||
@ -1331,7 +1342,7 @@ tree.Color.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Comment = function Comment(value, silent) {
|
tree.Comment = function (value, silent) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.silent = !!silent;
|
this.silent = !!silent;
|
||||||
};
|
};
|
||||||
@ -1348,7 +1359,7 @@ tree.Comment.prototype = {
|
|||||||
//
|
//
|
||||||
// A number with a unit
|
// A number with a unit
|
||||||
//
|
//
|
||||||
tree.Dimension = function Dimension(value, unit) {
|
tree.Dimension = function (value, unit) {
|
||||||
this.value = parseFloat(value);
|
this.value = parseFloat(value);
|
||||||
this.unit = unit || null;
|
this.unit = unit || null;
|
||||||
};
|
};
|
||||||
@ -1379,7 +1390,7 @@ tree.Dimension.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Directive = function Directive(name, value) {
|
tree.Directive = function (name, value) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
this.ruleset = new(tree.Ruleset)([], value);
|
this.ruleset = new(tree.Ruleset)([], value);
|
||||||
@ -1412,7 +1423,7 @@ tree.Directive.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Element = function Element(combinator, value) {
|
tree.Element = function (combinator, value) {
|
||||||
this.combinator = combinator instanceof tree.Combinator ?
|
this.combinator = combinator instanceof tree.Combinator ?
|
||||||
combinator : new(tree.Combinator)(combinator);
|
combinator : new(tree.Combinator)(combinator);
|
||||||
this.value = value.trim();
|
this.value = value.trim();
|
||||||
@ -1421,7 +1432,7 @@ tree.Element.prototype.toCSS = function (env) {
|
|||||||
return this.combinator.toCSS(env || {}) + this.value;
|
return this.combinator.toCSS(env || {}) + this.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
tree.Combinator = function Combinator(value) {
|
tree.Combinator = function (value) {
|
||||||
if (value === ' ') {
|
if (value === ' ') {
|
||||||
this.value = ' ';
|
this.value = ' ';
|
||||||
} else {
|
} else {
|
||||||
@ -1444,7 +1455,7 @@ tree.Combinator.prototype.toCSS = function (env) {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Expression = function Expression(value) { this.value = value };
|
tree.Expression = function (value) { this.value = value };
|
||||||
tree.Expression.prototype = {
|
tree.Expression.prototype = {
|
||||||
eval: function (env) {
|
eval: function (env) {
|
||||||
if (this.value.length > 1) {
|
if (this.value.length > 1) {
|
||||||
@ -1476,7 +1487,7 @@ tree.Expression.prototype = {
|
|||||||
// `import,push`, we also pass it a callback, which it'll call once
|
// `import,push`, we also pass it a callback, which it'll call once
|
||||||
// the file has been fetched, and parsed.
|
// the file has been fetched, and parsed.
|
||||||
//
|
//
|
||||||
tree.Import = function Import(path, imports) {
|
tree.Import = function (path, imports) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
this._path = path;
|
this._path = path;
|
||||||
@ -1535,7 +1546,7 @@ tree.Import.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Keyword = function Keyword(value) { this.value = value };
|
tree.Keyword = function (value) { this.value = value };
|
||||||
tree.Keyword.prototype = {
|
tree.Keyword.prototype = {
|
||||||
eval: function () { return this },
|
eval: function () { return this },
|
||||||
toCSS: function () { return this.value }
|
toCSS: function () { return this.value }
|
||||||
@ -1545,7 +1556,7 @@ tree.Keyword.prototype = {
|
|||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.mixin = {};
|
tree.mixin = {};
|
||||||
tree.mixin.Call = function MixinCall(elements, args, index) {
|
tree.mixin.Call = function (elements, args, index) {
|
||||||
this.selector = new(tree.Selector)(elements);
|
this.selector = new(tree.Selector)(elements);
|
||||||
this.arguments = args;
|
this.arguments = args;
|
||||||
this.index = index;
|
this.index = index;
|
||||||
@ -1563,7 +1574,7 @@ tree.mixin.Call.prototype = {
|
|||||||
rules, mixins[m].eval(this.arguments, env).rules);
|
rules, mixins[m].eval(this.arguments, env).rules);
|
||||||
match = true;
|
match = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw { message: e.message, index: this.index };
|
throw { message: e.message, index: e.index, call: this.index };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1584,7 +1595,7 @@ tree.mixin.Call.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tree.mixin.Definition = function MixinDefinition(name, params, rules) {
|
tree.mixin.Definition = function (name, params, rules) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
|
this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
|
||||||
this.params = params;
|
this.params = params;
|
||||||
@ -1598,9 +1609,11 @@ tree.mixin.Definition = function MixinDefinition(name, params, rules) {
|
|||||||
};
|
};
|
||||||
tree.mixin.Definition.prototype = {
|
tree.mixin.Definition.prototype = {
|
||||||
toCSS: function () { return "" },
|
toCSS: function () { return "" },
|
||||||
variable: function (name) { return tree.Ruleset.prototype.variable.call(this, name) },
|
|
||||||
find: function () { return tree.Ruleset.prototype.find.apply(this, arguments) },
|
parent: tree.Ruleset.prototype,
|
||||||
rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this) },
|
variable: function (name) { return this.parent.variable.call(this, name) },
|
||||||
|
find: function () { return this.parent.find.apply(this, arguments) },
|
||||||
|
rulesets: function () { return this.parent.rulesets.apply(this) },
|
||||||
|
|
||||||
eval: function (args, env) {
|
eval: function (args, env) {
|
||||||
var frame = new(tree.Ruleset)(null, []), context;
|
var frame = new(tree.Ruleset)(null, []), context;
|
||||||
@ -1641,7 +1654,7 @@ tree.mixin.Definition.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Operation = function Operation(op, operands) {
|
tree.Operation = function (op, operands) {
|
||||||
this.op = op.trim();
|
this.op = op.trim();
|
||||||
this.operands = operands;
|
this.operands = operands;
|
||||||
};
|
};
|
||||||
@ -1673,14 +1686,13 @@ tree.operate = function (op, a, b) {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Quoted = function Quoted(value, content) {
|
tree.Quoted = function (value, content) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
};
|
};
|
||||||
tree.Quoted.prototype = {
|
tree.Quoted.prototype = {
|
||||||
toCSS: function () {
|
toCSS: function () {
|
||||||
var css = this.value;
|
return this.value;
|
||||||
return css;
|
|
||||||
},
|
},
|
||||||
eval: function () {
|
eval: function () {
|
||||||
return this;
|
return this;
|
||||||
@ -1690,7 +1702,7 @@ tree.Quoted.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Rule = function Rule(name, value, index) {
|
tree.Rule = function (name, value, index) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
|
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
|
||||||
this.index = index;
|
this.index = index;
|
||||||
@ -1710,7 +1722,7 @@ tree.Rule.prototype.eval = function (context) {
|
|||||||
return new(tree.Rule)(this.name, this.value.eval(context));
|
return new(tree.Rule)(this.name, this.value.eval(context));
|
||||||
};
|
};
|
||||||
|
|
||||||
tree.Shorthand = function Shorthand(a, b) {
|
tree.Shorthand = function (a, b) {
|
||||||
this.a = a;
|
this.a = a;
|
||||||
this.b = b;
|
this.b = b;
|
||||||
};
|
};
|
||||||
@ -1725,7 +1737,7 @@ tree.Shorthand.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Ruleset = function Ruleset(selectors, rules) {
|
tree.Ruleset = function (selectors, rules) {
|
||||||
this.selectors = selectors;
|
this.selectors = selectors;
|
||||||
this.rules = rules;
|
this.rules = rules;
|
||||||
this._lookups = {};
|
this._lookups = {};
|
||||||
@ -1892,7 +1904,7 @@ tree.Ruleset.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Selector = function Selector(elements) {
|
tree.Selector = function (elements) {
|
||||||
this.elements = elements;
|
this.elements = elements;
|
||||||
if (this.elements[0].combinator.value === "") {
|
if (this.elements[0].combinator.value === "") {
|
||||||
this.elements[0].combinator.value = ' ';
|
this.elements[0].combinator.value = ' ';
|
||||||
@ -1920,7 +1932,7 @@ tree.Selector.prototype.toCSS = function (env) {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.URL = function URL(val) {
|
tree.URL = function (val) {
|
||||||
this.value = val;
|
this.value = val;
|
||||||
};
|
};
|
||||||
tree.URL.prototype = {
|
tree.URL.prototype = {
|
||||||
@ -1933,7 +1945,7 @@ tree.URL.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Value = function Value(value) {
|
tree.Value = function (value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.is = 'value';
|
this.is = 'value';
|
||||||
};
|
};
|
||||||
@ -1957,7 +1969,7 @@ tree.Value.prototype = {
|
|||||||
})(require('less/tree'));
|
})(require('less/tree'));
|
||||||
(function (tree) {
|
(function (tree) {
|
||||||
|
|
||||||
tree.Variable = function Variable(name, index) { this.name = name, this.index = index };
|
tree.Variable = function (name, index) { this.name = name, this.index = index };
|
||||||
tree.Variable.prototype = {
|
tree.Variable.prototype = {
|
||||||
eval: function (env) {
|
eval: function (env) {
|
||||||
var variable, v, name = this.name;
|
var variable, v, name = this.name;
|
@ -1,33 +1,33 @@
|
|||||||
//
|
//
|
||||||
// LESS - Leaner CSS v1.0.18
|
// LESS - Leaner CSS v1.0.19
|
||||||
// http://lesscss.org
|
// http://lesscss.org
|
||||||
//
|
//
|
||||||
// Copyright (c) 2010, Alexis Sellier
|
// Copyright (c) 2010, Alexis Sellier
|
||||||
// Licensed under the Apache 2.0 License.
|
// Licensed under the Apache 2.0 License.
|
||||||
//
|
//
|
||||||
(function(u){function q(d){return u.less[d.split("/")[1]]}function N(d){if(!document.querySelectorAll&&typeof jQuery==="undefined")w("no selector method found.");else return(document.querySelectorAll||jQuery).call(document,d)}function G(d,a){for(var e=0;e<H.length;e++)I(H[e],d,a)}function I(d,a,e){var b=v&&v.getItem(d.href),g=v&&v.getItem(d.href+":timestamp"),i={css:b,timestamp:g};O(d.href,function(j,l){if(!e&&i&&(new Date(l)).valueOf()===(new Date(i.timestamp)).valueOf()){A(i.css,d);a(null,d,{local:true})}else(new p.Parser({optimization:p.optimization})).parse(j,
|
(function(u){function q(d){return u.less[d.split("/")[1]]}function O(d){if(!document.querySelectorAll&&typeof jQuery==="undefined")x("no selector method found.");else return(document.querySelectorAll||jQuery).call(document,d)}function H(d,a){for(var e=0;e<I.length;e++)J(I[e],d,a)}function J(d,a,e){var b=v&&v.getItem(d.href),g=v&&v.getItem(d.href+":timestamp"),i={css:b,timestamp:g};P(d.href,function(j,l){if(!e&&i&&(new Date(l)).valueOf()===(new Date(i.timestamp)).valueOf()){C(i.css,d);a(null,d,{local:true})}else(new p.Parser({optimization:p.optimization})).parse(j,
|
||||||
function(o,s){if(o)return J(o,d.href);try{a(s,d,{local:false,lastModified:l});P(document.getElementById("less-error-message:"+d.href.replace(/[^a-z]+/gi,"-")))}catch(r){J(r,d.href)}})},function(j){throw new Error("Couldn't load "+d.href+" ("+j+")");})}function A(d,a,e){var b,g="less:"+(a.title||a.href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]);if((b=document.getElementById(g))===null){b=document.createElement("style");b.type="text/css";b.media="screen";b.id=g;document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet)try{b.styleSheet.cssText=
|
function(o,s){if(o)return K(o,d.href);try{a(s,d,{local:false,lastModified:l});Q(document.getElementById("less-error-message:"+d.href.replace(/[^a-z]+/gi,"-")))}catch(r){K(r,d.href)}})},function(j){throw new Error("Couldn't load "+d.href+" ("+j+")");})}function C(d,a,e){var b,g="less:"+(a.title||a.href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]);if((b=document.getElementById(g))===null){b=document.createElement("style");b.type="text/css";b.media="screen";b.id=g;document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet)try{b.styleSheet.cssText=
|
||||||
d}catch(i){throw new Error("Couldn't reassign styleSheet.cssText.");}else(function(j){if(b.childNodes.length>0)b.firstChild.nodeValue!==j.nodeValue&&b.replaceChild(j,b.firstChild);else b.appendChild(j)})(document.createTextNode(d));if(e&&v){w("saving "+a.href+" to cache.");v.setItem(a.href,d);v.setItem(a.href+":timestamp",e)}}function O(d,a,e){function b(j,l,o){if(j.status>=200&&j.status<300)l(j.responseText,j.getResponseHeader("Last-Modified"));else typeof o==="function"&&o(j.status)}var g=Q(),i=
|
d}catch(i){throw new Error("Couldn't reassign styleSheet.cssText.");}else(function(j){if(b.childNodes.length>0)b.firstChild.nodeValue!==j.nodeValue&&b.replaceChild(j,b.firstChild);else b.appendChild(j)})(document.createTextNode(d));if(e&&v){x("saving "+a.href+" to cache.");v.setItem(a.href,d);v.setItem(a.href+":timestamp",e)}}function P(d,a,e){function b(j,l,o){if(j.status>=200&&j.status<300)l(j.responseText,j.getResponseHeader("Last-Modified"));else typeof o==="function"&&o(j.status)}var g=R(),i=
|
||||||
B?false:p.async;g.open("GET",d,i);g.send(null);if(B)g.status===0?a(g.responseText):e(g.status);else if(i)g.onreadystatechange=function(){g.readyState==4&&b(g,a,e)};else b(g,a,e)}function Q(){if(u.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){w("browser doesn't support AJAX.");return null}}function P(d){return d&&d.parentNode.removeChild(d)}function w(d){p.env=="development"&&typeof console!=="undefined"&&console.log("less: "+d)}function J(d,
|
D?false:p.async;g.open("GET",d,i);g.send(null);if(D)g.status===0?a(g.responseText):e(g.status);else if(i)g.onreadystatechange=function(){g.readyState==4&&b(g,a,e)};else b(g,a,e)}function R(){if(u.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){x("browser doesn't support AJAX.");return null}}function Q(d){return d&&d.parentNode.removeChild(d)}function x(d){p.env=="development"&&typeof console!=="undefined"&&console.log("less: "+d)}function K(d,
|
||||||
a){var e="less-error-message:"+a.replace(/[^a-z]+/ig,"-");if(!d.extract)throw d;var b=document.createElement("div"),g;b.id=e;b.className="less-error-message";b.innerHTML="<h3>"+(d.message||"There is an error in your .less file")+'</h3><p><a href="'+a+'">'+a+"</a> on line "+d.line+", column "+(d.column+1)+":</p>"+'<div>\n<pre class="ctx"><span>[-1]</span>{0}</pre>\n<pre><span>[0]</span>{current}</pre>\n<pre class="ctx"><span>[1]</span>{2}</pre>\n</div>'.replace(/\[(-?\d)\]/g,function(i,j){return parseInt(d.line)+
|
a){var e="less-error-message:"+a.replace(/[^a-z]+/ig,"-");if(!d.extract)throw d;var b=document.createElement("div"),g;b.id=e;b.className="less-error-message";b.innerHTML="<h3>"+(d.message||"There is an error in your .less file")+'</h3><p><a href="'+a+'">'+a+"</a> on line "+d.line+", column "+(d.column+1)+":</p>"+'<div>\n<pre class="ctx"><span>[-1]</span>{0}</pre>\n<pre><span>[0]</span>{current}</pre>\n<pre class="ctx"><span>[1]</span>{2}</pre>\n</div>'.replace(/\[(-?\d)\]/g,function(i,j){return parseInt(d.line)+
|
||||||
parseInt(j)||""}).replace(/\{(\d)\}/g,function(i,j){return d.extract[parseInt(j)]||""}).replace(/\{current\}/,d.extract[1].slice(0,d.column)+'<span class="error">'+d.extract[1].slice(d.column)+"</span>");A(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}",
|
parseInt(j)||""}).replace(/\{(\d)\}/g,function(i,j){return d.extract[parseInt(j)]||""}).replace(/\{current\}/,d.extract[1].slice(0,d.column)+'<span class="error">'+d.extract[1].slice(d.column)+"</span>");C(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}",
|
||||||
{title:"error-message"});b.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(p.env=="development")g=setInterval(function(){if(document.body){document.getElementById(e)?document.body.replaceChild(b,document.getElementById(e)):document.body.insertBefore(b,document.body.firstChild);clearInterval(g)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)===
|
{title:"error-message"});b.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(p.env=="development")g=setInterval(function(){if(document.body){document.getElementById(e)?document.body.replaceChild(b,document.getElementById(e)):document.body.insertBefore(b,document.body.firstChild);clearInterval(g)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)===
|
||||||
"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,a){for(var e=this.length>>>0,b=0;b<e;b++)b in this&&d.call(a,this[b],b,this)};if(!Array.prototype.map)Array.prototype.map=function(d,a){for(var e=this.length>>>0,b=new Array(e),g=0;g<e;g++)if(g in this)b[g]=d.call(a,this[g],g,this);return b};if(!Array.prototype.filter)Array.prototype.filter=function(d,a){for(var e=[],b=0;b<this.length;b++)d.call(a,this[b])&&e.push(this[b]);return e};if(!Array.prototype.reduce)Array.prototype.reduce=
|
"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,a){for(var e=this.length>>>0,b=0;b<e;b++)b in this&&d.call(a,this[b],b,this)};if(!Array.prototype.map)Array.prototype.map=function(d,a){for(var e=this.length>>>0,b=new Array(e),g=0;g<e;g++)if(g in this)b[g]=d.call(a,this[g],g,this);return b};if(!Array.prototype.filter)Array.prototype.filter=function(d,a){for(var e=[],b=0;b<this.length;b++)d.call(a,this[b])&&e.push(this[b]);return e};if(!Array.prototype.reduce)Array.prototype.reduce=
|
||||||
function(d){var a=this.length>>>0,e=0;if(a===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var b=arguments[1];else{do{if(e in this){b=this[e++];break}if(++e>=a)throw new TypeError;}while(1)}for(;e<a;e++)if(e in this)b=d.call(null,b,this[e],e,this);return b};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,a){var e=this.length;a=a||0;if(!e)return-1;if(a>=e)return-1;if(a<0)a+=e;for(;a<e;a++)if(Object.prototype.hasOwnProperty.call(this,a))if(d===this[a])return a;return-1};
|
function(d){var a=this.length>>>0,e=0;if(a===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var b=arguments[1];else{do{if(e in this){b=this[e++];break}if(++e>=a)throw new TypeError;}while(1)}for(;e<a;e++)if(e in this)b=d.call(null,b,this[e],e,this);return b};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,a){var e=this.length;a=a||0;if(!e)return-1;if(a>=e)return-1;if(a<0)a+=e;for(;a<e;a++)if(Object.prototype.hasOwnProperty.call(this,a))if(d===this[a])return a;return-1};
|
||||||
if(!Object.keys)Object.keys=function(d){var a=[];for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&a.push(e);return a};if(!String.prototype.trim)String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var p,m;if(typeof u==="undefined"){p=exports;m=q("less/tree")}else{p=u.less={};m=u.less.tree={}}p.Parser=function(d){function a(f){var h,k,n;if(f instanceof Function)return f.call(s.parsers);else if(typeof f==="string"){h=b.charAt(g)===f?f:null;k=1}else{if(g>=
|
if(!Object.keys)Object.keys=function(d){var a=[];for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&a.push(e);return a};if(!String.prototype.trim)String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var p,m;if(typeof u==="undefined"){p=exports;m=q("less/tree")}else{p=u.less={};m=u.less.tree={}}p.Parser=function(d){function a(f){var h,k,n;if(f instanceof Function)return f.call(s.parsers);else if(typeof f==="string"){h=b.charAt(g)===f?f:null;k=1}else{if(g>=
|
||||||
o+l[i].length&&i<l.length-1)o+=l[i++].length;f.lastIndex=n=g-o;if(h=f.exec(l[i])){k=h[0].length;if(f.lastIndex-k!==n)return}}if(h){g+=k;for(k=o+l[i].length;g<=k;){f=b.charCodeAt(g);if(!(f===32||f===10||f===9))break;g++}return typeof h==="string"?h:h.length===1?h[0]:h}}function e(f){var h;if(typeof f==="string")return b.charAt(g)===f;else{f.lastIndex=g;if((h=f.exec(b))&&f.lastIndex-h[0].length===g)return h}}var b,g,i,j,l,o,s,r=this,K=function(){},L=this.imports={paths:d&&d.paths||[],queue:[],files:{},
|
o+l[i].length&&i<l.length-1)o+=l[i++].length;f.lastIndex=n=g-o;if(h=f.exec(l[i])){k=h[0].length;if(f.lastIndex-k!==n)return}}if(h){g+=k;for(k=o+l[i].length;g<=k;){f=b.charCodeAt(g);if(!(f===32||f===10||f===9))break;g++}return typeof h==="string"?h:h.length===1?h[0]:h}}function e(f){var h;if(typeof f==="string")return b.charAt(g)===f;else{f.lastIndex=g;if((h=f.exec(b))&&f.lastIndex-h[0].length===g)return h}}var b,g,i,j,l,o,s,r=this,L=function(){},M=this.imports={paths:d&&d.paths||[],queue:[],files:{},
|
||||||
push:function(f,h){var k=this;this.queue.push(f);p.Parser.importer(f,this.paths,function(n){k.queue.splice(k.queue.indexOf(f),1);k.files[f]=n;h(n);k.queue.length===0&&K()})}};this.env=d||{};this.optimization="optimization"in this.env?this.env.optimization:1;return s={imports:L,parse:function(f,h){var k,n,x=null;g=i=o=j=0;l=[];b=f.replace(/\r\n/g,"\n");if(r.optimization>0){b=b.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g,function(E){return r.optimization>1?"":E.replace(/\n(\s*\n)+/g,"\n")});l=b.split(/^(?=\n)/mg)}else l=
|
push:function(f,h){var k=this;this.queue.push(f);p.Parser.importer(f,this.paths,function(n){k.queue.splice(k.queue.indexOf(f),1);k.files[f]=n;h(n);k.queue.length===0&&L()})}};this.env=d||{};this.optimization="optimization"in this.env?this.env.optimization:1;return s={imports:M,parse:function(f,h){var k,n,y=null;g=i=o=j=0;l=[];b=f.replace(/\r\n/g,"\n");if(r.optimization>0){b=b.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g,function(E){return r.optimization>1?"":E.replace(/\n(\s*\n)+/g,"\n")});l=b.split(/^(?=\n)/mg)}else l=
|
||||||
[b];k=new m.Ruleset([],a(this.parsers.primary));k.root=true;k.toCSS=function(E){var y,C;return function(t){t=t||{};try{var z=E.call(this,[],{frames:[],compress:t.compress||false});return t.compress?z.replace(/(\s)+/g,"$1"):z}catch(D){C=b.split("\n");y=(b.slice(0,D.index).match(/\n/g)||"").length+1;t=D.index;for(z=-1;t>=0&&b.charAt(t)!=="\n";t--)z++;throw{name:"NameError",message:D.message,line:y,stack:D.stack,column:z,extract:[C[y-2],C[y-1],C[y]]};}}}(k.toCSS);if(g<b.length-1){g=j;n=b.split("\n");
|
[b];k=new m.Ruleset([],a(this.parsers.primary));k.root=true;k.toCSS=function(E){var z,A;return function(t){function F(S){return(b.slice(0,S).match(/\n/g)||"").length}t=t||{};try{var B=E.call(this,[],{frames:[],compress:t.compress||false});return t.compress?B.replace(/(\s)+/g,"$1"):B}catch(w){A=b.split("\n");z=F(w.index);t=w.index;for(B=-1;t>=0&&b.charAt(t)!=="\n";t--)B++;throw{name:"NameError",message:w.message,filename:d.filename,index:w.index,line:z+1,callLine:F(w.call)+1,callExtract:A[F(w.call)],
|
||||||
f=(b.slice(0,g).match(/\n/g)||"").length+1;for(var F=g,M=-1;F>=0&&b.charAt(F)!=="\n";F--)M++;x={name:"ParseError",message:"Syntax Error on line "+f,filename:d.filename,line:f,column:M,extract:[n[f-2],n[f-1],n[f]]}}if(this.imports.queue.length>0)K=function(){h(x,k)};else h(x,k)},parsers:{primary:function(){for(var f,h=[];f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(/[\n\s]+/g)||a(this.directive);)h.push(f);return h},comment:function(){var f;if(b.charAt(g)===
|
stack:w.stack,column:B,extract:[A[z-1],A[z],A[z+1]]};}}}(k.toCSS);if(g<b.length-1){g=j;n=b.split("\n");f=(b.slice(0,g).match(/\n/g)||"").length+1;for(var G=g,N=-1;G>=0&&b.charAt(G)!=="\n";G--)N++;y={name:"ParseError",message:"Syntax Error on line "+f,filename:d.filename,line:f,column:N,extract:[n[f-2],n[f-1],n[f]]}}if(this.imports.queue.length>0)L=function(){h(y,k)};else h(y,k)},parsers:{primary:function(){for(var f,h=[];f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||
|
||||||
"/")if(b.charAt(g+1)==="/")return new m.Comment(a(/\/\/.*/g),true);else if(f=a(/\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/g))return new m.Comment(f)},entities:{quoted:function(){var f;if(!(b.charAt(g)!=='"'&&b.charAt(g)!=="'"))if(f=a(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/[A-Za-z-]+/g))return new m.Keyword(f)},call:function(){var f,h;if(f=a(/([a-zA-Z0-9_-]+|%)\(/g)){if(f[1].toLowerCase()==="alpha")return a(this.alpha);h=a(this.entities.arguments);
|
a(this.comment)||a(/[\n\s]+/g)||a(this.directive);)h.push(f);return h},comment:function(){var f;if(b.charAt(g)==="/")if(b.charAt(g+1)==="/")return new m.Comment(a(/\/\/.*/g),true);else if(f=a(/\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/g))return new m.Comment(f)},entities:{quoted:function(){var f;if(!(b.charAt(g)!=='"'&&b.charAt(g)!=="'"))if(f=a(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/[A-Za-z-]+/g))return new m.Keyword(f)},call:function(){var f,
|
||||||
if(a(")"))if(f)return new m.Call(f[1],h)}},arguments:function(){for(var f=[],h;h=a(this.expression);){f.push(h);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(b.charAt(g)!=="u"||!a(/url\(/g))){f=a(this.entities.quoted)||a(/[-a-zA-Z0-9_%@$\/.&=:;#+?]+/g);if(!a(")"))throw new Error("missing closing ) for url()");return new m.URL(f.value?f:new m.Anonymous(f))}},variable:function(){var f,h=g;if(b.charAt(g)===
|
h;if(f=a(/([\w-]+|%)\(/g)){if(f[1].toLowerCase()==="alpha")return a(this.alpha);h=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f[1],h)}},arguments:function(){for(var f=[],h;h=a(this.expression);){f.push(h);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(b.charAt(g)!=="u"||!a(/url\(/g))){f=a(this.entities.quoted)||a(/[-\w%@$\/.&=:;#+?]+/g);if(!a(")"))throw new Error("missing closing ) for url()");
|
||||||
"@"&&(f=a(/@[a-zA-Z0-9_-]+/g)))return new m.Variable(f,h)},color:function(){var f;if(b.charAt(g)==="#"&&(f=a(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g)))return new m.Color(f[1])},dimension:function(){var f;f=b.charCodeAt(g);if(!(f>57||f<45||f===47))if(f=a(/(-?[0-9]*\.?[0-9]+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g))return new m.Dimension(f[1],f[2])}},variable:function(){var f;if(b.charAt(g)==="@"&&(f=a(/(@[a-zA-Z0-9_-]+)\s*:/g)))return f[1]},shorthand:function(){var f,h;if(e(/[@\w.-]+\/[@\w.-]+/g))if((f=
|
return new m.URL(f.value?f:new m.Anonymous(f))}},variable:function(){var f,h=g;if(b.charAt(g)==="@"&&(f=a(/@[\w-]+/g)))return new m.Variable(f,h)},color:function(){var f;if(b.charAt(g)==="#"&&(f=a(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g)))return new m.Color(f[1])},dimension:function(){var f;f=b.charCodeAt(g);if(!(f>57||f<45||f===47))if(f=a(/(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g))return new m.Dimension(f[1],f[2])}},variable:function(){var f;if(b.charAt(g)==="@"&&(f=a(/(@[\w-]+)\s*:/g)))return f[1]},
|
||||||
a(this.entity))&&a("/")&&(h=a(this.entity)))return new m.Shorthand(f,h)},mixin:{call:function(){for(var f=[],h,k,n,x=g;h=a(/[#.][a-zA-Z0-9_-]+/g);){f.push(new m.Element(k,h));k=a(">")}a("(")&&(n=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||e("}")))return new m.mixin.Call(f,n,x)},definition:function(){var f,h=[],k,n;if(!(b.charAt(g)!=="."||e(/[^{]*(;|})/g)))if(f=a(/([#.][a-zA-Z0-9_-]+)\s*\(/g)){for(f=f[1];k=a(/@[\w-]+/g)||a(this.entities.literal)||a(this.entities.keyword);){if(k[0]===
|
shorthand:function(){var f,h;if(e(/[@\w.-]+\/[@\w.-]+/g))if((f=a(this.entity))&&a("/")&&(h=a(this.entity)))return new m.Shorthand(f,h)},mixin:{call:function(){for(var f=[],h,k,n,y=g;h=a(/[#.][\w-]+/g);){f.push(new m.Element(k,h));k=a(">")}a("(")&&(n=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||e("}")))return new m.mixin.Call(f,n,y)},definition:function(){var f,h=[],k,n;if(!(b.charAt(g)!=="."||e(/[^{]*(;|})/g)))if(f=a(/([#.][\w-]+)\s*\(/g)){for(f=f[1];k=a(/@[\w-]+/g)||a(this.entities.literal)||
|
||||||
"@")if(a(":"))if(n=a(this.expression))h.push({name:k,value:n});else throw new Error("Expected value");else h.push({name:k});else h.push({value:k});if(!a(","))break}if(!a(")"))throw new Error("Expected )");if(k=a(this.block))return new m.mixin.Definition(f,h,k)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)},end:function(){return a(";")||e("}")},alpha:function(){var f;if(a(/opacity=/gi))if(f=a(/[0-9]+/g)||
|
a(this.entities.keyword);){if(k[0]==="@")if(a(":"))if(n=a(this.expression))h.push({name:k,value:n});else throw new Error("Expected value");else h.push({name:k});else h.push({value:k});if(!a(","))break}if(!a(")"))throw new Error("Expected )");if(k=a(this.block))return new m.mixin.Definition(f,h,k)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)},end:function(){return a(";")||e("}")},alpha:function(){var f;
|
||||||
a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()");return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/[.#:]?[a-zA-Z0-9_-]+/g)||a("*")||a(this.attribute)||a(/\([^)@]+\)/g))return new m.Element(c,f)},combinator:function(){var f;return(f=a(/[+>~]/g)||a("&")||a(/::/g))?new m.Combinator(f):new m.Combinator(b.charAt(g-1)===" "?" ":null)},selector:function(){for(var f,h=[];f=a(this.element);)h.push(f);if(h.length>0)return new m.Selector(h)},
|
if(a(/opacity=/gi))if(f=a(/\d+/g)||a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()");return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/[.#:]?[\w-]+/g)||a("*")||a(this.attribute)||a(/\([^)@]+\)/g))return new m.Element(c,f)},combinator:function(){var f;return(f=a(/[+>~]/g)||a("&")||a(/::/g))?new m.Combinator(f):new m.Combinator(b.charAt(g-1)===" "?" ":null)},selector:function(){for(var f,h=[];f=a(this.element);)h.push(f);if(h.length>0)return new m.Selector(h)},
|
||||||
tag:function(){return a(/[a-zA-Z][a-zA-Z-]*[0-9]?/g)||a("*")},attribute:function(){var f="",h,k,n;if(a("[")){if(h=a(/[a-z-]+/g)||a(this.entities.quoted))f=(n=a(/[|~*$^]?=/g))&&(k=a(this.entities.quoted)||a(/[\w-]+/g))?[h,n,k.toCSS?k.toCSS():k].join(""):h;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],h,k,n=g;if(h=e(/([a-z.#: _-]+)[\s\n]*\{/g)){g+=h[0].length-1;f=[new m.Selector([new m.Element(null,h[1])])]}else{for(;h=
|
tag:function(){return a(/[a-zA-Z][a-zA-Z-]*[0-9]?/g)||a("*")},attribute:function(){var f="",h,k,n;if(a("[")){if(h=a(/[a-z-]+/g)||a(this.entities.quoted))f=(n=a(/[|~*$^]?=/g))&&(k=a(this.entities.quoted)||a(/[\w-]+/g))?[h,n,k.toCSS?k.toCSS():k].join(""):h;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],h,k,n=g;if(h=e(/([.#: \w-]+)[\s\n]*\{/g)){g+=h[0].length-1;f=[new m.Selector([new m.Element(null,h[1])])]}else{for(;h=
|
||||||
a(this.selector);){f.push(h);if(!a(","))break}h&&a(this.comment)}if(f.length>0&&(k=a(this.block)))return new m.Ruleset(f,k);else{j=g;g=n}},rule:function(){var f,h=g;if(name=a(this.property)||a(this.variable)){if(name.charAt(0)!="@"&&(match=e(/([^@+\/*(;{}-]*);/g))){g+=match[0].length-1;f=new m.Anonymous(match[1])}else f=name==="font"?a(this.font):a(this.value);if(a(this.end))return new m.Rule(name,f,h);else{j=g;g=h}}},"import":function(){var f;if(a(/@import\s+/g)&&(f=a(this.entities.quoted)||a(this.entities.url))&&
|
a(this.selector);){f.push(h);if(!a(","))break}h&&a(this.comment)}if(f.length>0&&(k=a(this.block)))return new m.Ruleset(f,k);else{j=g;g=n}},rule:function(){var f,h=g;if(name=a(this.property)||a(this.variable)){if(name.charAt(0)!="@"&&(match=e(/([^@+\/*(;{}-]*);/g))){g+=match[0].length-1;f=new m.Anonymous(match[1])}else f=name==="font"?a(this.font):a(this.value);if(a(this.end))return new m.Rule(name,f,h);else{j=g;g=h}}},"import":function(){var f;if(a(/@import\s+/g)&&(f=a(this.entities.quoted)||a(this.entities.url))&&
|
||||||
a(";"))return new m.Import(f,L)},directive:function(){var f,h,k;if(b.charAt(g)==="@")if(h=a(this["import"]))return h;else if(f=a(/@media|@page/g)){k=a(/[^{]+/g).trim();if(h=a(this.block))return new m.Directive(f+" "+k,h)}else if(f=a(/@[-a-z]+/g))if(f==="@font-face"){if(h=a(this.block))return new m.Directive(f,h)}else if((h=a(this.entity))&&a(";"))return new m.Directive(f,h)},font:function(){for(var f=[],h=[],k;k=a(this.shorthand)||a(this.entity);)h.push(k);f.push(new m.Expression(h));if(a(","))for(;k=
|
a(";"))return new m.Import(f,M)},directive:function(){var f,h,k;if(b.charAt(g)==="@")if(h=a(this["import"]))return h;else if(f=a(/@media|@page/g)){k=a(/[^{]+/g).trim();if(h=a(this.block))return new m.Directive(f+" "+k,h)}else if(f=a(/@[-a-z]+/g))if(f==="@font-face"){if(h=a(this.block))return new m.Directive(f,h)}else if((h=a(this.entity))&&a(";"))return new m.Directive(f,h)},font:function(){for(var f=[],h=[],k;k=a(this.shorthand)||a(this.entity);)h.push(k);f.push(new m.Expression(h));if(a(","))for(;k=
|
||||||
a(this.expression);){f.push(k);if(!a(","))break}return new m.Value(f,a(this.important))},value:function(){for(var f,h=[];f=a(this.expression);){h.push(f);if(!a(","))break}f=a(this.important);if(h.length>0)return new m.Value(h,f)},important:function(){return a(/!\s*important/g)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,h,k,n;if(f=a(this.operand)){for(;(k=a(/[\/*]/g))&&(h=a(this.operand));)n=new m.Operation(k,[n||f,h]);return n||f}},addition:function(){var f,
|
a(this.expression);){f.push(k);if(!a(","))break}return new m.Value(f,a(this.important))},value:function(){for(var f,h=[];f=a(this.expression);){h.push(f);if(!a(","))break}f=a(this.important);if(h.length>0)return new m.Value(h,f)},important:function(){return a(/!\s*important/g)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,h,k,n;if(f=a(this.operand)){for(;(k=a(/[\/*]/g))&&(h=a(this.operand));)n=new m.Operation(k,[n||f,h]);return n||f}},addition:function(){var f,
|
||||||
h,k,n;if(f=a(this.multiplication)){for(;(k=a(/[-+]\s+/g)||b.charAt(g-1)!=" "&&a(/[-+]/g))&&(h=a(this.multiplication));)n=new m.Operation(k,[n||f,h]);return n||f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)},expression:function(){for(var f,h=[];f=a(this.addition)||a(this.entity);)h.push(f);if(h.length>0)return new m.Expression(h)},property:function(){var f;if(f=a(/(\*?-?[-a-z_0-9]+)\s*:/g))return f[1]}}}};p.Parser.importer=null;
|
h,k,n;if(f=a(this.multiplication)){for(;(k=a(/[-+]\s+/g)||b.charAt(g-1)!=" "&&a(/[-+]/g))&&(h=a(this.multiplication));)n=new m.Operation(k,[n||f,h]);return n||f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)},expression:function(){for(var f,h=[];f=a(this.addition)||a(this.entity);)h.push(f);if(h.length>0)return new m.Expression(h)},property:function(){var f;if(f=a(/(\*?-?[-a-z_0-9]+)\s*:/g))return f[1]}}}};p.Parser.importer=null;
|
||||||
(function(d){function a(b){if(b instanceof d.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);else if(typeof b==="number")return b;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function e(b){return Math.min(1,Math.max(0,b))}d.functions={rgb:function(b,g,i){return this.rgba(b,g,i,1)},rgba:function(b,g,i,j){b=[b,g,i].map(function(l){return a(l)});j=a(j);return new d.Color(b,j)},hsl:function(b,g,i){return this.hsla(b,g,i,1)},hsla:function(b,g,i,j){function l(r){r=
|
(function(d){function a(b){if(b instanceof d.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);else if(typeof b==="number")return b;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function e(b){return Math.min(1,Math.max(0,b))}d.functions={rgb:function(b,g,i){return this.rgba(b,g,i,1)},rgba:function(b,g,i,j){b=[b,g,i].map(function(l){return a(l)});j=a(j);return new d.Color(b,j)},hsl:function(b,g,i){return this.hsla(b,g,i,1)},hsla:function(b,g,i,j){function l(r){r=
|
||||||
@ -35,16 +35,16 @@ r<0?r+1:r>1?r-1:r;return r*6<1?s+(o-s)*r*6:r*2<1?o:r*3<2?s+(o-s)*(2/3-r)*6:s}b=a
|
|||||||
g){b=b.toHSL();b.s+=g.value/100;b.s=e(b.s);return this.hsl(b.h,b.s,b.l)},desaturate:function(b,g){b=b.toHSL();b.s-=g.value/100;b.s=e(b.s);return this.hsl(b.h,b.s,b.l)},lighten:function(b,g){b=b.toHSL();b.l+=g.value/100;b.l=e(b.l);return this.hsl(b.h,b.s,b.l)},darken:function(b,g){b=b.toHSL();b.l-=g.value/100;b.l=e(b.l);return this.hsl(b.h,b.s,b.l)},spin:function(b,g){b=b.toHSL();g=(b.h+g.value)%360;b.h=g<0?360+g:g;return this.hsl(b.h,b.s,b.l)},greyscale:function(b){return this.desaturate(b,new d.Dimension(100))},
|
g){b=b.toHSL();b.s+=g.value/100;b.s=e(b.s);return this.hsl(b.h,b.s,b.l)},desaturate:function(b,g){b=b.toHSL();b.s-=g.value/100;b.s=e(b.s);return this.hsl(b.h,b.s,b.l)},lighten:function(b,g){b=b.toHSL();b.l+=g.value/100;b.l=e(b.l);return this.hsl(b.h,b.s,b.l)},darken:function(b,g){b=b.toHSL();b.l-=g.value/100;b.l=e(b.l);return this.hsl(b.h,b.s,b.l)},spin:function(b,g){b=b.toHSL();g=(b.h+g.value)%360;b.h=g<0?360+g:g;return this.hsl(b.h,b.s,b.l)},greyscale:function(b){return this.desaturate(b,new d.Dimension(100))},
|
||||||
e:function(b){return new d.Anonymous(b)},"%":function(b){for(var g=Array.prototype.slice.call(arguments,1),i=b.content,j=0;j<g.length;j++)i=i.replace(/%s/,g[j].content).replace(/%[da]/,g[j].toCSS());i=i.replace(/%%/g,"%");return new d.Quoted('"'+i+'"',i)}}})(q("less/tree"));(function(d){d.Alpha=function(a){this.value=a};d.Alpha.prototype={toCSS:function(){return"alpha(opacity="+this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Anonymous=function(a){this.value=
|
e:function(b){return new d.Anonymous(b)},"%":function(b){for(var g=Array.prototype.slice.call(arguments,1),i=b.content,j=0;j<g.length;j++)i=i.replace(/%s/,g[j].content).replace(/%[da]/,g[j].toCSS());i=i.replace(/%%/g,"%");return new d.Quoted('"'+i+'"',i)}}})(q("less/tree"));(function(d){d.Alpha=function(a){this.value=a};d.Alpha.prototype={toCSS:function(){return"alpha(opacity="+this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Anonymous=function(a){this.value=
|
||||||
a.content||a};d.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Call=function(a,e){this.name=a;this.args=e};d.Call.prototype={eval:function(a){var e=this.args.map(function(b){return b.eval(a)});return this.name in d.functions?d.functions[this.name].apply(d.functions,e):new d.Anonymous(this.name+"("+e.map(function(b){return b.toCSS()}).join(", ")+")")},toCSS:function(a){return this.eval(a).toCSS()}}})(q("less/tree"));(function(d){d.Color=
|
a.content||a};d.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Call=function(a,e){this.name=a;this.args=e};d.Call.prototype={eval:function(a){var e=this.args.map(function(b){return b.eval(a)});return this.name in d.functions?d.functions[this.name].apply(d.functions,e):new d.Anonymous(this.name+"("+e.map(function(b){return b.toCSS()}).join(", ")+")")},toCSS:function(a){return this.eval(a).toCSS()}}})(q("less/tree"));(function(d){d.Color=
|
||||||
function(a,e){if(Array.isArray(a)){this.rgb=a;this.alpha=e}else this.rgb=a.length==6?a.match(/.{2}/g).map(function(b){return parseInt(b,16)}):a.split("").map(function(b){return parseInt(b+b,16)})};d.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha&&this.alpha<1?"rgba("+this.rgb.concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(a){a=Math.round(a);a=(a>255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(a,e){var b=[];e instanceof
|
function(a,e){if(Array.isArray(a)){this.rgb=a;this.alpha=e}else this.rgb=a.length==6?a.match(/.{2}/g).map(function(b){return parseInt(b,16)}):a.split("").map(function(b){return parseInt(b+b,16)})};d.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha&&this.alpha<1?"rgba("+this.rgb.map(function(a){return Math.round(a)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(a){a=Math.round(a);a=(a>255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},
|
||||||
d.Color||(e=e.toColor());for(var g=0;g<3;g++)b[g]=d.operate(a,this.rgb[g],e.rgb[g]);return new d.Color(b)},toHSL:function(){var a=this.rgb[0]/255,e=this.rgb[1]/255,b=this.rgb[2]/255,g=Math.max(a,e,b),i=Math.min(a,e,b),j,l=(g+i)/2,o=g-i;if(g===i)j=i=0;else{i=l>0.5?o/(2-g-i):o/(g+i);switch(g){case a:j=(e-b)/o+(e<b?6:0);break;case e:j=(b-a)/o+2;break;case b:j=(a-e)/o+4;break}j/=6}return{h:j*360,s:i,l:l}}}})(q("less/tree"));(function(d){d.Comment=function(a,e){this.value=a;this.silent=!!e};d.Comment.prototype=
|
operate:function(a,e){var b=[];e instanceof d.Color||(e=e.toColor());for(var g=0;g<3;g++)b[g]=d.operate(a,this.rgb[g],e.rgb[g]);return new d.Color(b)},toHSL:function(){var a=this.rgb[0]/255,e=this.rgb[1]/255,b=this.rgb[2]/255,g=Math.max(a,e,b),i=Math.min(a,e,b),j,l=(g+i)/2,o=g-i;if(g===i)j=i=0;else{i=l>0.5?o/(2-g-i):o/(g+i);switch(g){case a:j=(e-b)/o+(e<b?6:0);break;case e:j=(b-a)/o+2;break;case b:j=(a-e)/o+4;break}j/=6}return{h:j*360,s:i,l:l}}}})(q("less/tree"));(function(d){d.Comment=function(a,
|
||||||
{toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Dimension=function(a,e){this.value=parseFloat(a);this.unit=e||null};d.Dimension.prototype={eval:function(){return this},toColor:function(){return new d.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+this.unit},operate:function(a,e){return new d.Dimension(d.operate(a,this.value,e.value),this.unit||e.unit)}}})(q("less/tree"));(function(d){d.Directive=function(a,
|
e){this.value=a;this.silent=!!e};d.Comment.prototype={toCSS:function(a){return a.compress?"":this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Dimension=function(a,e){this.value=parseFloat(a);this.unit=e||null};d.Dimension.prototype={eval:function(){return this},toColor:function(){return new d.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+this.unit},operate:function(a,e){return new d.Dimension(d.operate(a,this.value,e.value),this.unit||e.unit)}}})(q("less/tree"));
|
||||||
e){this.name=a;if(Array.isArray(e))this.ruleset=new d.Ruleset([],e);else this.value=e};d.Directive.prototype={toCSS:function(a,e){if(this.ruleset){this.ruleset.root=true;return this.name+(e.compress?"{":" {\n ")+this.ruleset.toCSS(a,e).trim().replace(/\n/g,"\n ")+(e.compress?"}":"\n}\n")}else return this.name+" "+this.value.toCSS()+";\n"},eval:function(a){a.frames.unshift(this);this.ruleset&&this.ruleset.evalRules(a);a.frames.shift();return this},variable:function(a){return d.Ruleset.prototype.variable.call(this.ruleset,
|
(function(d){d.Directive=function(a,e){this.name=a;if(Array.isArray(e))this.ruleset=new d.Ruleset([],e);else this.value=e};d.Directive.prototype={toCSS:function(a,e){if(this.ruleset){this.ruleset.root=true;return this.name+(e.compress?"{":" {\n ")+this.ruleset.toCSS(a,e).trim().replace(/\n/g,"\n ")+(e.compress?"}":"\n}\n")}else return this.name+" "+this.value.toCSS()+";\n"},eval:function(a){a.frames.unshift(this);this.ruleset&&this.ruleset.evalRules(a);a.frames.shift();return this},variable:function(a){return d.Ruleset.prototype.variable.call(this.ruleset,
|
||||||
a)},find:function(){return d.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(q("less/tree"));(function(d){d.Element=function(a,e){this.combinator=a instanceof d.Combinator?a:new d.Combinator(a);this.value=e.trim()};d.Element.prototype.toCSS=function(a){return this.combinator.toCSS(a||{})+this.value};d.Combinator=function(a){this.value=a===" "?" ":a?a.trim():""};d.Combinator.prototype.toCSS=function(a){return{"":"",
|
a)},find:function(){return d.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(q("less/tree"));(function(d){d.Element=function(a,e){this.combinator=a instanceof d.Combinator?a:new d.Combinator(a);this.value=e.trim()};d.Element.prototype.toCSS=function(a){return this.combinator.toCSS(a||{})+this.value};d.Combinator=function(a){this.value=a===" "?" ":a?a.trim():""};d.Combinator.prototype.toCSS=function(a){return{"":"",
|
||||||
" ":" ","&":"",":":" :","::":"::","+":a.compress?"+":" + ","~":a.compress?"~":" ~ ",">":a.compress?">":" > "}[this.value]}})(q("less/tree"));(function(d){d.Expression=function(a){this.value=a};d.Expression.prototype={eval:function(a){return this.value.length>1?new d.Expression(this.value.map(function(e){return e.eval(a)})):this.value[0].eval(a)},toCSS:function(){return this.value.map(function(a){return a.toCSS()}).join(" ")}}})(q("less/tree"));(function(d){d.Import=function(a,e){var b=this;this._path=
|
" ":" ","&":"",":":" :","::":"::","+":a.compress?"+":" + ","~":a.compress?"~":" ~ ",">":a.compress?">":" > "}[this.value]}})(q("less/tree"));(function(d){d.Expression=function(a){this.value=a};d.Expression.prototype={eval:function(a){return this.value.length>1?new d.Expression(this.value.map(function(e){return e.eval(a)})):this.value[0].eval(a)},toCSS:function(){return this.value.map(function(a){return a.toCSS()}).join(" ")}}})(q("less/tree"));(function(d){d.Import=function(a,e){var b=this;this._path=
|
||||||
a;this.path=a instanceof d.Quoted?/\.(le?|c)ss$/.test(a.content)?a.content:a.content+".less":a.value.content||a.value;(this.css=/css$/.test(this.path))||e.push(this.path,function(g){b.root=g})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(){if(this.css)return this;else{for(var a=0;a<this.root.rules.length;a++)this.root.rules[a]instanceof d.Import&&Array.prototype.splice.apply(this.root.rules,[a,1].concat(this.root.rules[a].eval()));return this.root.rules}}}})(q("less/tree"));
|
a;this.path=a instanceof d.Quoted?/\.(le?|c)ss$/.test(a.content)?a.content:a.content+".less":a.value.content||a.value;(this.css=/css$/.test(this.path))||e.push(this.path,function(g){b.root=g})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(){if(this.css)return this;else{for(var a=0;a<this.root.rules.length;a++)this.root.rules[a]instanceof d.Import&&Array.prototype.splice.apply(this.root.rules,[a,1].concat(this.root.rules[a].eval()));return this.root.rules}}}})(q("less/tree"));
|
||||||
(function(d){d.Keyword=function(a){this.value=a};d.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}})(q("less/tree"));(function(d){d.mixin={};d.mixin.Call=function(a,e,b){this.selector=new d.Selector(a);this.arguments=e;this.index=b};d.mixin.Call.prototype={eval:function(a){for(var e,b=[],g=false,i=0;i<a.frames.length;i++)if((e=a.frames[i].find(this.selector)).length>0){for(i=0;i<e.length;i++)if(e[i].match(this.arguments,a))try{Array.prototype.push.apply(b,e[i].eval(this.arguments,
|
(function(d){d.Keyword=function(a){this.value=a};d.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}})(q("less/tree"));(function(d){d.mixin={};d.mixin.Call=function(a,e,b){this.selector=new d.Selector(a);this.arguments=e;this.index=b};d.mixin.Call.prototype={eval:function(a){for(var e,b=[],g=false,i=0;i<a.frames.length;i++)if((e=a.frames[i].find(this.selector)).length>0){for(i=0;i<e.length;i++)if(e[i].match(this.arguments,a))try{Array.prototype.push.apply(b,e[i].eval(this.arguments,
|
||||||
a).rules);g=true}catch(j){throw{message:j.message,index:this.index};}if(g)return b;else throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(l){return l.toCSS()}).join(", ")+")`",index:this.index};}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index};}};d.mixin.Definition=function(a,e,b){this.name=a;this.selectors=[new d.Selector([new d.Element(null,a)])];this.params=e;this.arity=e.length;this.rules=b;this._lookups=
|
a).rules);g=true}catch(j){throw{message:j.message,index:j.index,call:this.index};}if(g)return b;else throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(l){return l.toCSS()}).join(", ")+")`",index:this.index};}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index};}};d.mixin.Definition=function(a,e,b){this.name=a;this.selectors=[new d.Selector([new d.Element(null,a)])];this.params=e;this.arity=e.length;this.rules=
|
||||||
{};this.required=e.reduce(function(g,i){return i.name&&!i.value?g+1:g},0)};d.mixin.Definition.prototype={toCSS:function(){return""},variable:function(a){return d.Ruleset.prototype.variable.call(this,a)},find:function(){return d.Ruleset.prototype.find.apply(this,arguments)},rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this)},eval:function(a,e){for(var b=new d.Ruleset(null,[]),g=0,i;g<this.params.length;g++)if(this.params[g].name)if(i=a&&a[g]||this.params[g].value)b.rules.unshift(new d.Rule(this.params[g].name,
|
b;this._lookups={};this.required=e.reduce(function(g,i){return i.name&&!i.value?g+1:g},0)};d.mixin.Definition.prototype={toCSS:function(){return""},parent:d.Ruleset.prototype,variable:function(a){return this.parent.variable.call(this,a)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},eval:function(a,e){for(var b=new d.Ruleset(null,[]),g=0,i;g<this.params.length;g++)if(this.params[g].name)if(i=a&&a[g]||this.params[g].value)b.rules.unshift(new d.Rule(this.params[g].name,
|
||||||
i.eval(e)));else throw{message:"wrong number of arguments for "+this.name+" ("+a.length+" for "+this.arity+")"};return(new d.Ruleset(null,this.rules)).evalRules({frames:[this,b].concat(e.frames)})},match:function(a,e){var b=a&&a.length||0;if(b<this.required)return false;for(var g=0;g<Math.min(b,this.arity);g++)if(!this.params[g].name)if(!a[g].wildcard)if(a[g].eval(e).toCSS()!=this.params[g].value.eval(e).toCSS())return false;return true}}})(q("less/tree"));(function(d){d.Operation=function(a,e){this.op=
|
i.eval(e)));else throw{message:"wrong number of arguments for "+this.name+" ("+a.length+" for "+this.arity+")"};return(new d.Ruleset(null,this.rules)).evalRules({frames:[this,b].concat(e.frames)})},match:function(a,e){var b=a&&a.length||0;if(b<this.required)return false;for(var g=0;g<Math.min(b,this.arity);g++)if(!this.params[g].name)if(!a[g].wildcard)if(a[g].eval(e).toCSS()!=this.params[g].value.eval(e).toCSS())return false;return true}}})(q("less/tree"));(function(d){d.Operation=function(a,e){this.op=
|
||||||
a.trim();this.operands=e};d.Operation.prototype.eval=function(a){var e=this.operands[0].eval(a);a=this.operands[1].eval(a);var b;if(e instanceof d.Dimension&&a instanceof d.Color)if(this.op==="*"||this.op==="+"){b=a;a=e;e=b}else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};return e.operate(this.op,a)};d.operate=function(a,e,b){switch(a){case "+":return e+b;case "-":return e-b;case "*":return e*b;case "/":return e/b}}})(q("less/tree"));(function(d){d.Quoted=
|
a.trim();this.operands=e};d.Operation.prototype.eval=function(a){var e=this.operands[0].eval(a);a=this.operands[1].eval(a);var b;if(e instanceof d.Dimension&&a instanceof d.Color)if(this.op==="*"||this.op==="+"){b=a;a=e;e=b}else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};return e.operate(this.op,a)};d.operate=function(a,e,b){switch(a){case "+":return e+b;case "-":return e-b;case "*":return e*b;case "/":return e/b}}})(q("less/tree"));(function(d){d.Quoted=
|
||||||
function(a,e){this.value=a;this.content=e};d.Quoted.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Rule=function(a,e,b){this.name=a;this.value=e instanceof d.Value?e:new d.Value([e]);this.index=b;this.variable=a.charAt(0)==="@"?true:false};d.Rule.prototype.toCSS=function(a){return this.variable?"":this.name+(a.compress?":":": ")+this.value.toCSS(a)+";"};d.Rule.prototype.eval=function(a){return new d.Rule(this.name,this.value.eval(a))};
|
function(a,e){this.value=a;this.content=e};d.Quoted.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Rule=function(a,e,b){this.name=a;this.value=e instanceof d.Value?e:new d.Value([e]);this.index=b;this.variable=a.charAt(0)==="@"?true:false};d.Rule.prototype.toCSS=function(a){return this.variable?"":this.name+(a.compress?":":": ")+this.value.toCSS(a)+";"};d.Rule.prototype.eval=function(a){return new d.Rule(this.name,this.value.eval(a))};
|
||||||
@ -55,6 +55,6 @@ else for(l=0;l<this.selectors.length;l++)for(var o=0;o<a.length;o++)j.push(a[o].
|
|||||||
else if(a.toCSS&&!a.variable)g.push(a.eval(e).toCSS(e));else a.value&&!a.variable&&g.push(a.value.toString())}i=i.join("");if(this.root)b.push(g.join(e.compress?"":"\n"));else if(g.length>0){j=j.map(function(s){return s.map(function(r){return r.toCSS(e)}).join("").trim()}).join(e.compress?",":j.length>3?",\n":", ");b.push(j,(e.compress?"{":" {\n ")+g.join(e.compress?"":"\n ")+(e.compress?"}":"\n}\n"))}b.push(i);e.frames.shift();return b.join("")+(e.compress?"\n":"")}}})(q("less/tree"));(function(d){d.Selector=
|
else if(a.toCSS&&!a.variable)g.push(a.eval(e).toCSS(e));else a.value&&!a.variable&&g.push(a.value.toString())}i=i.join("");if(this.root)b.push(g.join(e.compress?"":"\n"));else if(g.length>0){j=j.map(function(s){return s.map(function(r){return r.toCSS(e)}).join("").trim()}).join(e.compress?",":j.length>3?",\n":", ");b.push(j,(e.compress?"{":" {\n ")+g.join(e.compress?"":"\n ")+(e.compress?"}":"\n}\n"))}b.push(i);e.frames.shift();return b.join("")+(e.compress?"\n":"")}}})(q("less/tree"));(function(d){d.Selector=
|
||||||
function(a){this.elements=a;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?true:false};d.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(e){return typeof e==="string"?" "+e.trim():e.toCSS(a)}).join("")}})(q("less/tree"));(function(d){d.URL=function(a){this.value=a};d.URL.prototype={toCSS:function(){return"url("+
|
function(a){this.elements=a;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?true:false};d.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(e){return typeof e==="string"?" "+e.trim():e.toCSS(a)}).join("")}})(q("less/tree"));(function(d){d.URL=function(a){this.value=a};d.URL.prototype={toCSS:function(){return"url("+
|
||||||
this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Value=function(a){this.value=a;this.is="value"};d.Value.prototype={eval:function(a){return this.value.length===1?this.value[0].eval(a):new d.Value(this.value.map(function(e){return e.eval(a)}))},toCSS:function(a){return this.value.map(function(e){return e.toCSS(a)}).join(a.compress?",":", ")}}})(q("less/tree"));(function(d){d.Variable=function(a,e){this.name=a;this.index=e};d.Variable.prototype={eval:function(a){var e,
|
this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Value=function(a){this.value=a;this.is="value"};d.Value.prototype={eval:function(a){return this.value.length===1?this.value[0].eval(a):new d.Value(this.value.map(function(e){return e.eval(a)}))},toCSS:function(a){return this.value.map(function(e){return e.toCSS(a)}).join(a.compress?",":", ")}}})(q("less/tree"));(function(d){d.Variable=function(a,e){this.name=a;this.index=e};d.Variable.prototype={eval:function(a){var e,
|
||||||
b,g=this.name;if(e=d.find(a.frames,function(i){if(b=i.variable(g))return b.value.eval(a)}))return e;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));q("less/tree").find=function(d,a){for(var e=0,b;e<d.length;e++)if(b=a.call(d,d[e]))return b;return null};var B=location.protocol==="file:";p.env=location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||B?"development":"production";p.async=false;
|
b,g=this.name;if(e=d.find(a.frames,function(i){if(b=i.variable(g))return b.value.eval(a)}))return e;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));q("less/tree").find=function(d,a){for(var e=0,b;e<d.length;e++)if(b=a.call(d,d[e]))return b;return null};var D=location.protocol==="file:";p.env=location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||D?"development":"production";p.async=false;
|
||||||
p.poll=B?1E3:1500;p.watch=function(){return this.watchMode=true};p.unwatch=function(){return this.watchMode=false};if(p.env==="development"){p.optimization=0;/!watch/.test(location.hash)&&p.watch();p.watchTimer=setInterval(function(){p.watchMode&&G(function(d,a,e){d&&A(d.toCSS(),a,e.lastModified)})},p.poll)}else p.optimization=3;var v=typeof u.localStorage==="undefined"?null:u.localStorage,H=N('link[rel="stylesheet/less"]');p.refresh=function(d){G(function(a,e,b){if(b.local)w("loading "+e.href+" from cache.");
|
p.poll=D?1E3:1500;p.watch=function(){return this.watchMode=true};p.unwatch=function(){return this.watchMode=false};if(p.env==="development"){p.optimization=0;/!watch/.test(location.hash)&&p.watch();p.watchTimer=setInterval(function(){p.watchMode&&H(function(d,a,e){d&&C(d.toCSS(),a,e.lastModified)})},p.poll)}else p.optimization=3;var v=typeof u.localStorage==="undefined"?null:u.localStorage,I=O('link[rel="stylesheet/less"]');p.refresh=function(d){H(function(a,e,b){if(b.local)x("loading "+e.href+" from cache.");
|
||||||
else{w("parsed "+e.href+" successfully.");A(a.toCSS(),e,b.lastModified)}},d)};p.refresh();p.Parser.importer=function(d,a,e){I({href:d,title:d},function(b){e(b)})}})(window);
|
else{x("parsed "+e.href+" successfully.");C(a.toCSS(),e,b.lastModified)}},d)};p.refresh();p.Parser.importer=function(d,a,e){J({href:d,title:d},function(b){e(b)})}})(window);
|
Loading…
Reference in New Issue
Block a user