Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
-
Property svn:executable set to
*
|
File size:
1014 bytes
|
Line | |
---|
1 | (function (tree) { |
---|
2 | |
---|
3 | tree.Rule = function (name, value, important, index) { |
---|
4 | this.name = name; |
---|
5 | this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]); |
---|
6 | this.important = important ? ' ' + important.trim() : ''; |
---|
7 | this.index = index; |
---|
8 | |
---|
9 | if (name.charAt(0) === '@') { |
---|
10 | this.variable = true; |
---|
11 | } else { this.variable = false } |
---|
12 | }; |
---|
13 | tree.Rule.prototype.toCSS = function (env) { |
---|
14 | if (this.variable) { return "" } |
---|
15 | else { |
---|
16 | return this.name + (env.compress ? ':' : ': ') + |
---|
17 | this.value.toCSS(env) + |
---|
18 | this.important + ";"; |
---|
19 | } |
---|
20 | }; |
---|
21 | |
---|
22 | tree.Rule.prototype.eval = function (context) { |
---|
23 | return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index); |
---|
24 | }; |
---|
25 | |
---|
26 | tree.Shorthand = function (a, b) { |
---|
27 | this.a = a; |
---|
28 | this.b = b; |
---|
29 | }; |
---|
30 | |
---|
31 | tree.Shorthand.prototype = { |
---|
32 | toCSS: function (env) { |
---|
33 | return this.a.toCSS(env) + "/" + this.b.toCSS(env); |
---|
34 | }, |
---|
35 | eval: function () { return this } |
---|
36 | }; |
---|
37 | |
---|
38 | })(require('less/tree')); |
---|
Note: See
TracBrowser
for help on using the repository browser.