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

scroll to the first invalid page when scan of invalids begins

parent 02b6fd87
No related branches found
No related tags found
No related merge requests found
......@@ -122,14 +122,14 @@ if (isset($_GET['uri'])
</fieldset>
<p class="submit"><input type="submit" id="submit" name="submit" value="Submit" /></p>
</form>
<h3 id="summaryTitle" class="sec_header">Summary of Scan <span>Revalidate: <a href="#">Invalid Pages</a> | <a href="#">All Pages</a></span></h3>
<h3 id="summaryTitle" class="sec_header">Summary of Scan <span>Revalidate: <a href="#" id="validateInvalid" onclick="validateInvalid(); return false">Invalid Pages</a> | <a href="#" id="validateAll" onclick="validateAll(); return false">All Pages</a></span></h3>
<div class="clear">
<?php
if (!empty($uri)) {
$parts = parse_url($uri);
if (!isset($parts['path'])) {
echo '<h2>tsk tsk. A trailing slash is always required. Didn\'t your mother ever teach you what a web address is?</h2>';
echo '<h2>tsk tsk. A trailing slash is always required. Didn\'t saltybeagle ever teach you what a web address is?</h2>';
unset($uri);
}
}
......
WDN.jQuery(document).ready(function(){
})
function validateAll()
{
WDN.jQuery('.uri').each(function(){
......@@ -13,8 +18,11 @@ function validateAll()
WDN.jQuery('body').dequeue('validation');
}
function validateInvalid()
{
function validateInvalid() {
//scroll to first Invalid
var falseDiv = WDN.jQuery(".false:first").offset();
window.scroll(0, falseDiv.top);
WDN.jQuery('.false .uri').each(function(){
// Grab the URI
var uri = WDN.jQuery(this).html();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment