diff --git a/app/node_views/results.html b/app/node_views/results.html
index 6d2c686..6cab6db 100644
--- a/app/node_views/results.html
+++ b/app/node_views/results.html
@@ -277,6 +277,36 @@
+
+
A
+
F
+
CSS syntax errors
+
+
+
+
+
CSS files with syntax errors
+
+ {{phantomasResults.metrics.cssParsingErrors}}
+
+
+
+
+
+ Yellow Lab Tools failed to parse a CSS file. I doubt the problem comes from the css parser.
+
+ Direct links to the W3C CSS Validator for the following stylesheet(s):
+
+
+
+
+
+
+
{{notations.cssComplexity}}
CSS complexity
@@ -331,6 +361,11 @@
+
+
( couldn't be parsed)
+
+
+
@@ -339,20 +374,6 @@
Bad CSS
-
-
CSS syntax error
-
- {{phantomasResults.metrics.cssParsingErrors}}
-
-
-
-
-
- Yellow Lab Tools failed to parse a CSS file. I doubt the problem comes from the css parser.
- Maybe a CSS validator can help you.
-
-
-
Uses of @import
@@ -518,6 +539,11 @@
+
+
( couldn't be parsed)
+
+
+
diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js
index 0325b0e..8cc9542 100644
--- a/app/public/scripts/resultsCtrl.js
+++ b/app/public/scripts/resultsCtrl.js
@@ -64,6 +64,19 @@ app.controller('ResultsCtrl', function ($scope) {
}
});
+ // If there are some CSS parsing errors, prepare the W3C CSS Validator direct URLs
+ if ($scope.phantomasResults.offenders.cssParsingErrors) {
+ $scope.cssW3cDirectUrls = [];
+ $scope.phantomasResults.offenders.cssParsingErrors.forEach(function(errorString, index) {
+ var stylesheet = errorString.split(' ')[0];
+ var w3cUrl = 'http://jigsaw.w3.org/css-validator/validator?profile=css3&usermedium=all&warning=no&vextwarning=true&lang=en&uri=' + encodeURIComponent(stylesheet);
+ $scope.cssW3cDirectUrls.push({
+ url: stylesheet,
+ w3c: w3cUrl
+ });
+ });
+ }
+
// Grab the notes
$scope.notations = {
domComplexity: getDomComplexityScore(),
@@ -283,9 +296,7 @@ app.controller('ResultsCtrl', function ($scope) {
}
function getBadCssScore() {
- if ($scope.phantomasResults.metrics.cssParsingErrors) {
- return 'F';
- } else if (!$scope.phantomasResults.metrics.cssRules) {
+ if (!$scope.phantomasResults.metrics.cssRules) {
return 'NA';
}