Skip to content
Snippets Groups Projects
Commit 70ab15fa authored by Seth Meranda's avatar Seth Meranda
Browse files

let the user know the number of errors and warnings.

parent 40f4b4f9
Branches
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
.validating.false span {
background:url('images/loadingFalse.gif') no-repeat 0 0;
}
.validating.true span {
.validating.true span, .validating.unknown span {
background:url('images/loadingTrue.gif') no-repeat 0 0;
}
.false {
......@@ -63,6 +63,16 @@ div[class^="depth"] span {
display:block;
padding:5px 5px 5px 27px;
}
div[class^="depth"] span a {
margin-left:15px;
}
a.errors, a.warnings {
background: url('images/errorWarning.png') no-repeat 0 0;
padding: 1px 0 2px 19px;
}
a.errors {
background-position: 0 -17px;
}
div[class^="depth"]:hover {
outline:1px solid #65d0d7;
}
......
www/css/images/errorWarning.png

1.58 KiB

......@@ -36,10 +36,7 @@ function validateInvalid() {
function checkValidity(uri, uriDiv)
{
// uriDiv.removeClass('true false');
uriDiv.addClass('validating');
// Tell the user we're loading the result
// uriDiv.append('<img class="loading" src="/wdn/templates_3.0/css/header/images/colorbox/loading.gif" />');
// Fetch the validator results in JSON format.
WDN.get('validator.php?base='+baseURI+'&u='+escape(uri), null, function(result) {
handleJSONResult(result, uriDiv);
......@@ -56,10 +53,14 @@ function handleJSONResult(result, uriDiv)
if (result.validity) {
// It is valid, say no more!
uriDiv.removeClass('unknown false');
uriDiv.addClass('true');
return;
}
uriDiv.removeClass('unknown true');
uriDiv.addClass('false');
uriDiv.children('span').append("<a href='#' class='errors'>"+result.errors.length+" Error(s)</a> <a href='#' class='warnings'>"+result.warnings.length+" Warning(s)</a>");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment