Lines 23-62
define("webtools/cssValidator", [
Link Here
|
23 |
// Define the default values for the rules |
23 |
// Define the default values for the rules |
24 |
// 0:off, 1:warning, 2:error 3:info |
24 |
// 0:off, 1:warning, 2:error 3:info |
25 |
rules: { |
25 |
rules: { |
26 |
"adjoining-classes" : 3, //$NON-NLS-0$ |
26 |
"adjoining-classes" : 3, |
27 |
"box-model" : 3, //$NON-NLS-0$ |
27 |
"box-model" : 3, |
28 |
"box-sizing" : 3, //$NON-NLS-0$ |
28 |
"box-sizing" : 3, |
29 |
"bulletproof-font-face" : 3, //$NON-NLS-0$ |
29 |
"bulletproof-font-face" : 3, |
30 |
"compatible-vendor-prefixes" : 3, //$NON-NLS-0$ |
30 |
"compatible-vendor-prefixes" : 3, |
31 |
"display-property-grouping" : 3, //$NON-NLS-0$ |
31 |
"display-property-grouping" : 3, |
32 |
"duplicate-background-images" : 3, //$NON-NLS-0$ |
32 |
"duplicate-background-images" : 3, |
33 |
"duplicate-properties" : 3, //$NON-NLS-0$ |
33 |
"duplicate-properties" : 3, |
34 |
"empty-rules" : 3, //$NON-NLS-0$ |
34 |
"empty-rules" : 3, |
35 |
"fallback-colors" : 3, //$NON-NLS-0$ |
35 |
"fallback-colors" : 3, |
36 |
"floats" : 3, //$NON-NLS-0$ |
36 |
"floats" : 3, |
37 |
"font-faces" : 3, //$NON-NLS-0$ |
37 |
"font-faces" : 3, |
38 |
"font-sizes" : 3, //$NON-NLS-0$ |
38 |
"font-sizes" : 3, |
39 |
"gradients" : 3, //$NON-NLS-0$ |
39 |
"gradients" : 3, |
40 |
"ids" : 3, //$NON-NLS-0$ |
40 |
"ids" : 3, |
41 |
"import" : 3, //$NON-NLS-0$ |
41 |
"import" : 3, |
42 |
"important" : 3, //$NON-NLS-0$ |
42 |
"important" : 3, |
43 |
"known-properties" : 3, //$NON-NLS-0$ |
43 |
"known-properties" : 3, |
44 |
"outline-none" : 3, //$NON-NLS-0$ |
44 |
"outline-none" : 3, |
45 |
"overqualified-elements" : 3, //$NON-NLS-0$ |
45 |
"overqualified-elements" : 3, |
46 |
"qualified-headings" : 3, //$NON-NLS-0$ |
46 |
"qualified-headings" : 3, |
47 |
"regex-selectors" : 3, //$NON-NLS-0$ |
47 |
"regex-selectors" : 3, |
48 |
"rules-count" : 3, //$NON-NLS-0$ |
48 |
"rules-count" : 3, |
49 |
"selector-max-approaching" : 3, //$NON-NLS-0$ |
49 |
"selector-max-approaching" : 3, |
50 |
"selector-max" : 3, //$NON-NLS-0$ |
50 |
"selector-max" : 3, |
51 |
"shorthand" : 3, //$NON-NLS-0$ |
51 |
"shorthand" : 3, |
52 |
"star-property-hack" : 3, //$NON-NLS-0$ |
52 |
"star-property-hack" : 3, |
53 |
"text-indent" : 3, //$NON-NLS-0$ |
53 |
"text-indent" : 3, |
54 |
"underscore-property-hack" : 3, //$NON-NLS-0$ |
54 |
"underscore-property-hack" : 3, |
55 |
"unique-headings" : 3, //$NON-NLS-0$ |
55 |
"unique-headings" : 3, |
56 |
"universal-selector" : 3, //$NON-NLS-0$ |
56 |
"universal-selector" : 3, |
57 |
"unqualified-attributes" : 3, //$NON-NLS-0$ |
57 |
"unqualified-attributes" : 3, |
58 |
"vendor-prefix" : 3, //$NON-NLS-0$ |
58 |
"vendor-prefix" : 3, |
59 |
"zero-units" : 3 //$NON-NLS-0$ |
59 |
"zero-units" : 3 |
60 |
}, |
60 |
}, |
61 |
|
61 |
|
62 |
/** |
62 |
/** |
Lines 79-85
define("webtools/cssValidator", [
Link Here
|
79 |
* @param {Object} [key] Optional key to use for complex rule configuration. |
79 |
* @param {Object} [key] Optional key to use for complex rule configuration. |
80 |
*/ |
80 |
*/ |
81 |
setOption: function(ruleId, value, key) { |
81 |
setOption: function(ruleId, value, key) { |
82 |
if (typeof value === "number") { //$NON-NLS-0$ |
82 |
if (typeof value === "number") { |
83 |
if(Array.isArray(this.rules[ruleId])) { |
83 |
if(Array.isArray(this.rules[ruleId])) { |
84 |
var ruleConfig = this.rules[ruleId]; |
84 |
var ruleConfig = this.rules[ruleId]; |
85 |
if (key) { |
85 |
if (key) { |
Lines 178-184
define("webtools/cssValidator", [
Link Here
|
178 |
line: message.line, |
178 |
line: message.line, |
179 |
start: range[0], |
179 |
start: range[0], |
180 |
end: range[1], |
180 |
end: range[1], |
181 |
severity: message.type |
181 |
severity: message.type, |
|
|
182 |
data: { |
183 |
ruleSource: 'css' //$NON-NLS-1$ |
184 |
} |
182 |
}); |
185 |
}); |
183 |
} |
186 |
} |
184 |
} |
187 |
} |
Lines 231-237
define("webtools/cssValidator", [
Link Here
|
231 |
* @since 8.0 |
234 |
* @since 8.0 |
232 |
*/ |
235 |
*/ |
233 |
_getProblemRange: function(message) { |
236 |
_getProblemRange: function(message) { |
234 |
if (!message.rule || !message.rule.id || message.rule.id === "errors"){ //$NON-NLS-0$ |
237 |
if (!message.rule || !message.rule.id || message.rule.id === "errors"){ |
235 |
// Parsing errors often don't have a token to select, so instead select the line |
238 |
// Parsing errors often don't have a token to select, so instead select the line |
236 |
return [1, message.evidence.length + 1]; |
239 |
return [1, message.evidence.length + 1]; |
237 |
} |
240 |
} |