From 40f4b4f9e6b74bb3408e3304cd47339295e07efb Mon Sep 17 00:00:00 2001
From: Seth Meranda <smeranda2@unl.edu>
Date: Wed, 19 May 2010 20:09:56 +0000
Subject: [PATCH] scroll to the first invalid page when scan of invalids begins

---
 www/index.php      |  4 ++--
 www/js/batchval.js | 12 ++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/www/index.php b/www/index.php
index b6b8948..f324871 100644
--- a/www/index.php
+++ b/www/index.php
@@ -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);
                     }
                 }
diff --git a/www/js/batchval.js b/www/js/batchval.js
index c067338..08b8fdf 100644
--- a/www/js/batchval.js
+++ b/www/js/batchval.js
@@ -1,3 +1,8 @@
+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();
-- 
GitLab