Skip to content

Commit 79e9338

Browse files
committed
Fix spacing in ValidationTypes.js
1 parent f0de85f commit 79e9338

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

src/css/ValidationTypes.js

+73-73
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,62 @@ var ValidationTypes = {
66
var text = part.text.toString().toLowerCase(),
77
args = literals.split(" | "),
88
i, len, found = false;
9-
9+
1010
for (i=0,len=args.length; i < len && !found; i++){
1111
if (text == args[i].toLowerCase()){
1212
found = true;
1313
}
1414
}
15-
16-
return found;
15+
16+
return found;
1717
},
18-
18+
1919
isSimple: function(type) {
2020
return !!this.simple[type];
2121
},
22-
22+
2323
isComplex: function(type) {
2424
return !!this.complex[type];
2525
},
26-
26+
2727
/**
2828
* Determines if the next part(s) of the given expression
2929
* are any of the given types.
3030
*/
3131
isAny: function (expression, types) {
3232
var args = types.split(" | "),
3333
i, len, found = false;
34-
34+
3535
for (i=0,len=args.length; i < len && !found && expression.hasNext(); i++){
3636
found = this.isType(expression, args[i]);
3737
}
38-
39-
return found;
38+
39+
return found;
4040
},
41-
41+
4242
/**
4343
* Determines if the next part(s) of the given expression
4444
* are one of a group.
4545
*/
4646
isAnyOfGroup: function(expression, types) {
4747
var args = types.split(" || "),
4848
i, len, found = false;
49-
49+
5050
for (i=0,len=args.length; i < len && !found; i++){
5151
found = this.isType(expression, args[i]);
5252
}
53-
53+
5454
return found ? args[i-1] : false;
5555
},
56-
56+
5757
/**
5858
* Determines if the next part(s) of the given expression
5959
* are of a given type.
6060
*/
6161
isType: function (expression, type) {
6262
var part = expression.peek(),
6363
result = false;
64-
64+
6565
if (type.charAt(0) != "<") {
6666
result = this.isLiteral(part, type);
6767
if (result) {
@@ -75,116 +75,116 @@ var ValidationTypes = {
7575
} else {
7676
result = this.complex[type](expression);
7777
}
78-
78+
7979
return result;
8080
},
81-
82-
83-
81+
82+
83+
8484
simple: {
8585

8686
"<absolute-size>": function(part){
8787
return ValidationTypes.isLiteral(part, "xx-small | x-small | small | medium | large | x-large | xx-large");
8888
},
89-
89+
9090
"<attachment>": function(part){
9191
return ValidationTypes.isLiteral(part, "scroll | fixed | local");
9292
},
93-
93+
9494
"<attr>": function(part){
9595
return part.type == "function" && part.name == "attr";
9696
},
97-
97+
9898
"<bg-image>": function(part){
9999
return this["<image>"](part) || this["<gradient>"](part) || part == "none";
100-
},
101-
100+
},
101+
102102
"<gradient>": function(part) {
103103
return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
104104
},
105-
105+
106106
"<box>": function(part){
107107
return ValidationTypes.isLiteral(part, "padding-box | border-box | content-box");
108108
},
109-
109+
110110
"<content>": function(part){
111111
return part.type == "function" && part.name == "content";
112-
},
113-
112+
},
113+
114114
"<relative-size>": function(part){
115115
return ValidationTypes.isLiteral(part, "smaller | larger");
116116
},
117-
117+
118118
//any identifier
119119
"<ident>": function(part){
120120
return part.type == "identifier";
121121
},
122-
122+
123123
"<length>": function(part){
124124
if (part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)){
125125
return true;
126126
}else{
127127
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
128128
}
129129
},
130-
130+
131131
"<color>": function(part){
132132
return part.type == "color" || part == "transparent";
133133
},
134-
134+
135135
"<number>": function(part){
136136
return part.type == "number" || this["<integer>"](part);
137137
},
138-
138+
139139
"<integer>": function(part){
140140
return part.type == "integer";
141141
},
142-
142+
143143
"<line>": function(part){
144144
return part.type == "integer";
145145
},
146-
146+
147147
"<angle>": function(part){
148148
return part.type == "angle";
149-
},
150-
149+
},
150+
151151
"<uri>": function(part){
152152
return part.type == "uri";
153153
},
154-
154+
155155
"<image>": function(part){
156156
return this["<uri>"](part);
157157
},
158-
158+
159159
"<percentage>": function(part){
160160
return part.type == "percentage" || part == "0";
161161
},
162162

163163
"<border-width>": function(part){
164164
return this["<length>"](part) || ValidationTypes.isLiteral(part, "thin | medium | thick");
165165
},
166-
166+
167167
"<border-style>": function(part){
168168
return ValidationTypes.isLiteral(part, "none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset");
169169
},
170-
170+
171171
"<margin-width>": function(part){
172172
return this["<length>"](part) || this["<percentage>"](part) || ValidationTypes.isLiteral(part, "auto");
173173
},
174-
174+
175175
"<padding-width>": function(part){
176176
return this["<length>"](part) || this["<percentage>"](part);
177177
},
178-
178+
179179
"<shape>": function(part){
180180
return part.type == "function" && (part.name == "rect" || part.name == "inset-rect");
181181
},
182-
182+
183183
"<time>": function(part) {
184184
return part.type == "time";
185185
}
186186
},
187-
187+
188188
complex: {
189189

190190
"<bg-position>": function(expression){
@@ -201,7 +201,7 @@ var ValidationTypes = {
201201
while (expression.peek(count) && expression.peek(count) != ",") {
202202
count++;
203203
}
204-
204+
205205
/*
206206
<position> = [
207207
[ left | center | right | top | bottom | <percentage> | <length> ]
@@ -254,7 +254,7 @@ var ValidationTypes = {
254254
}
255255
}
256256
}
257-
257+
258258
return result;
259259
},
260260

@@ -264,29 +264,29 @@ var ValidationTypes = {
264264
result = false,
265265
numeric = "<percentage> | <length> | auto",
266266
part,
267-
i, len;
268-
267+
i, len;
268+
269269
if (ValidationTypes.isAny(expression, "cover | contain")) {
270270
result = true;
271271
} else if (ValidationTypes.isAny(expression, numeric)) {
272-
result = true;
272+
result = true;
273273
ValidationTypes.isAny(expression, numeric);
274274
}
275-
275+
276276
return result;
277277
},
278-
278+
279279
"<repeat-style>": function(expression){
280280
//repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
281281
var result = false,
282282
values = "repeat | space | round | no-repeat",
283283
part;
284-
284+
285285
if (expression.hasNext()){
286286
part = expression.next();
287-
287+
288288
if (ValidationTypes.isLiteral(part, "repeat-x | repeat-y")) {
289-
result = true;
289+
result = true;
290290
} else if (ValidationTypes.isLiteral(part, values)) {
291291
result = true;
292292

@@ -295,62 +295,62 @@ var ValidationTypes = {
295295
}
296296
}
297297
}
298-
298+
299299
return result;
300-
300+
301301
},
302-
302+
303303
"<shadow>": function(expression) {
304304
//inset? && [ <length>{2,4} && <color>? ]
305305
var result = false,
306306
count = 0,
307307
inset = false,
308308
color = false,
309309
part;
310-
311-
if (expression.hasNext()) {
312-
310+
311+
if (expression.hasNext()) {
312+
313313
if (ValidationTypes.isAny(expression, "inset")){
314314
inset = true;
315315
}
316-
316+
317317
if (ValidationTypes.isAny(expression, "<color>")) {
318318
color = true;
319-
}
320-
319+
}
320+
321321
while (ValidationTypes.isAny(expression, "<length>") && count < 4) {
322322
count++;
323323
}
324-
325-
324+
325+
326326
if (expression.hasNext()) {
327327
if (!color) {
328328
ValidationTypes.isAny(expression, "<color>");
329329
}
330-
330+
331331
if (!inset) {
332332
ValidationTypes.isAny(expression, "inset");
333333
}
334334

335335
}
336-
336+
337337
result = (count >= 2 && count <= 4);
338-
338+
339339
}
340-
340+
341341
return result;
342342
},
343-
343+
344344
"<x-one-radius>": function(expression) {
345345
//[ <length> | <percentage> ] [ <length> | <percentage> ]?
346346
var result = false,
347347
simple = "<length> | <percentage> | inherit";
348-
348+
349349
if (ValidationTypes.isAny(expression, simple)){
350350
result = true;
351351
ValidationTypes.isAny(expression, simple);
352-
}
353-
352+
}
353+
354354
return result;
355355
}
356356
}

0 commit comments

Comments
 (0)