[ros-diffs] [cfinck] 432: - Rearrange the testman interface: Use one search interface instead of two and put all controls into it. - Add a checkbox "Open in new window": This was the previous default setting to open all results in a new browser window. If you uncheck it, the results will now be shown below the search interface. Note for IE users: If you want to make use of this feature, you have to update to IE8. - Spin off GetCookieValue() into a shared JavaScript file and fix that function for multiple cookies. - Use <label> tags where appropriate - Add general support for descending order and individual perpage values to the AJAX backend script. Currently, these are only used internally and can't be manually set. Thanks to Timo for the suggestions on the mailing list!

cfinck at svn.reactos.org cfinck at svn.reactos.org
Sat Jun 13 03:47:11 CEST 2009


Author: cfinck
Date: Sat Jun 13 05:47:10 2009
New Revision: 432

URL: http://svn.reactos.org/svn/reactos?rev=432&view=rev
Log:
- Rearrange the testman interface: Use one search interface instead of two and put all controls into it.
- Add a checkbox "Open in new window": This was the previous default setting to open all results in a new browser window.
  If you uncheck it, the results will now be shown below the search interface.
  Note for IE users: If you want to make use of this feature, you have to update to IE8.
- Spin off GetCookieValue() into a shared JavaScript file and fix that function for multiple cookies.
- Use <label> tags where appropriate
- Add general support for descending order and individual perpage values to the AJAX backend script. Currently, these are only used internally and can't be manually set.

Thanks to Timo for the suggestions on the mailing list!

Added:
    branches/danny-web/www/www.reactos.org/testman/js/shared.js   (with props)
Modified:
    branches/danny-web/www/www.reactos.org/testman/ajax-search.php
    branches/danny-web/www/www.reactos.org/testman/compare.php
    branches/danny-web/www/www.reactos.org/testman/config.inc.php
    branches/danny-web/www/www.reactos.org/testman/css/index.css
    branches/danny-web/www/www.reactos.org/testman/index.php
    branches/danny-web/www/www.reactos.org/testman/js/compare.js.php
    branches/danny-web/www/www.reactos.org/testman/js/index.js.php
    branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php
    branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php
    branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php

Modified: branches/danny-web/www/www.reactos.org/testman/ajax-search.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/ajax-search.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/ajax-search.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/ajax-search.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -8,13 +8,14 @@
 
 	header("Content-type: text/xml");
 	
-	if(!isset($_GET["startrev"]) || !isset($_GET["endrev"]) || !isset($_GET["user"]) || !isset($_GET["platform"]))
-		die("<error>Necessary information not specified!</error>");
-
-
 	require_once("config.inc.php");
 	require_once("connect.db.php");
 	require_once("utils.inc.php");
+	
+	// We may supply any "perpage" value as long as it doesn't exceed RESULTS_PER_PAGE
+	// This is currently only used for the default search
+	if(!isset($_GET["user"]) || !isset($_GET["perpage"]) || !is_numeric($_GET["perpage"]) || $_GET["perpage"] < 0 || $_GET["perpage"] > RESULTS_PER_PAGE)
+		die("<error>Necessary information not specified!</error>");
 	
 	try
 	{
@@ -49,7 +50,11 @@
 	
 	// Prepare some clauses
 	$tables = "FROM " . DB_TESTMAN . ".winetest_runs r JOIN " . DB_ROSCMS . ".roscms_accounts a ON r.user_id = a.id ";
-	$order = "ORDER BY revision ASC, r.id ASC ";
+	
+	if($_GET["desc"])
+		$order = "ORDER BY revision DESC, r.id DESC ";
+	else
+		$order = "ORDER BY revision ASC, r.id ASC ";
 	
 	echo "<results>";
 	
@@ -58,11 +63,11 @@
 	
 	$result_count = $stmt->fetchColumn();
 	
-	if($result_count > RESULTS_PER_PAGE)
+	if($result_count > $_GET["perpage"])
 	{
 		// The number of results exceeds the number of results per page.
 		// Therefore we will only output all results up to the maximum number of results per page with this call.
-		$result_count = RESULTS_PER_PAGE;
+		$result_count = $_GET["perpage"];
 		echo "<moreresults>1</moreresults>";
 	}
 	else
@@ -84,7 +89,7 @@
 			$stmt = $dbh->query(
 				"SELECT r.id, UNIX_TIMESTAMP(r.timestamp) timestamp, a.name, r.revision, r.platform, r.comment " .
 				$tables .	$where . $order .
-				"LIMIT " . RESULTS_PER_PAGE
+				"LIMIT " . $_GET["perpage"]
 			) or die("<error>Query failed #2</error>");
 			
 			$first = true;

Modified: branches/danny-web/www/www.reactos.org/testman/compare.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/compare.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/compare.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/compare.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -59,6 +59,7 @@
 	<link rel="stylesheet" type="text/css" href="../shared/css/basic.css" />
 	<link rel="stylesheet" type="text/css" href="../shared/css/reactos.css" />
 	<link rel="stylesheet" type="text/css" href="css/compare.css" />
+	<script type="text/javascript" src="js/shared.js"></script>
 	<script type="text/javascript">
 	//<![CDATA[
 		<?php require_once("js/compare.js.php"); ?>
@@ -89,7 +90,7 @@
 	if(count($id_array) > 1)
 	{
 		echo '<div>';
-		printf('<input type="checkbox" id="showchanged" onclick="ShowChangedCheckbox_OnClick(this)" /> %s', $testman_langres["showchanged"]);
+		printf('<input type="checkbox" id="showchanged" onclick="ShowChangedCheckbox_OnClick(this)" /> <label for="showchanged">%s</label>', $testman_langres["showchanged"]);
 		echo '</div><br />';
 	}
 ?>

Modified: branches/danny-web/www/www.reactos.org/testman/config.inc.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/config.inc.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/config.inc.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/config.inc.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -10,7 +10,9 @@
 	define("SHARED_PATH", "../shared/");
 	define("TESTMAN_PATH", "");
 	
+	define("DEFAULT_SEARCH_RESULTS_PER_PAGE", 10);
+	define("DEFAULT_SEARCH_USER", "Admin");
+	define("MAX_COMPARE_RESULTS", 5);
 	define("RESULTS_PER_PAGE", 100);
-	define("MAX_COMPARE_RESULTS", 5);
 	define("VIEWVC_TRUNK", "http://svn.reactos.org/svn/reactos/trunk");
 ?>

Modified: branches/danny-web/www/www.reactos.org/testman/css/index.css
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/css/index.css?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/css/index.css [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/css/index.css [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -39,9 +39,20 @@
 	vertical-align: top;
 }
 
+.controlgroup {
+	padding-right: 40px;
+	vertical-align: top;
+}
+
+.controlgroup input[type=checkbox] {
+	margin-left: 10px;
+}
+
+.controlgroup input[type=checkbox], label {
+	vertical-align: top;
+}
+
 #ajax_loading_search {
-	font-weight: bold;
-	margin-left: 20px;
 	visibility: hidden;
 }
 
@@ -57,3 +68,12 @@
 	font-weight: bold;
 	text-align: right;
 }
+
+#resultcount, #selectedresultcount {
+	font-weight: bold;
+}
+
+#comparepage_frame {
+	display: none;
+	width: 100%;
+}

Modified: branches/danny-web/www/www.reactos.org/testman/index.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/index.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/index.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/index.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -37,13 +37,14 @@
 	//]]>
 	</script>
 	<script type="text/javascript" src="../shared/js/ajax.js"></script>
+	<script type="text/javascript" src="js/shared.js"></script>
 	<script type="text/javascript">
 	//<![CDATA[
 		<?php require_once("js/index.js.php"); ?>
 	//]]>
 	</script>
 </head>
-<body>
+<body onload="Load()">
 
 <?php
 	BasicLayout($lang);
@@ -76,177 +77,70 @@
 </noscript>
 
 <div id="js_stuff">
-	<table width="100%" cellspacing="0" cellpadding="0">
-		<tr>
-			<td id="mainbox_td">
-				<div class="bubble_bg">
-					<div class="rounded_ll">
-					<div class="rounded_lr">
-					<div class="rounded_ul">
-					<div class="rounded_ur">
-					
-					<div class="bubble">
-						<h1><?php echo $testman_langres["lastresults_header"]; ?></h1>
+	<div class="bubble_bg">
+		<div class="rounded_ll">
+		<div class="rounded_lr">
+		<div class="rounded_ul">
+		<div class="rounded_ur">
+		
+		<div class="bubble">
+			<h1><?php echo $testman_langres["search_header"]; ?></h1>
+			
+			<table id="searchform">
+				<tr>
+					<td><label for="search_revision"><?php echo $testman_langres["revision"]; ?>:</label></td>
+					<td>
+						<input type="text" id="search_revision" value="" size="24" onkeypress="SearchInputs_OnKeyPress(event)" onkeyup="SearchRevisionInput_OnKeyUp(this)" /><br />
 						
-						<button onclick="CompareLastTwoButton_OnClick()"><?php echo $testman_langres["comparelasttwo_button"]; ?></button>
-						<br /><br />
-						
-						<table id="lastresults" class="datatable" cellspacing="0" cellpadding="0">
-							<thead>
-								<tr class="head">
-									<th class="TestCheckbox"></th>
-									<th><?php echo $testman_langres["revision"]; ?></th>
-									<th><?php echo $testman_langres["date"]; ?></th>
-									<th><?php echo $testman_langres["user"]; ?></th>
-									<th><?php echo $testman_langres["platform"]; ?></th>
-									<th><?php echo $testman_langres["comment"]; ?></th>
-								</tr>
-							</thead>
-							<tbody>
-								<?php
-									try
-									{
-										$dbh = new PDO("mysql:host=" . DB_HOST, DB_USER, DB_PASS);
-									}
-									catch(PDOException $e)
-									{
-										// Give no exact error message here, so no server internals are exposed
-										die("<error>Could not establish the DB connection</error>");
-									}
-									
-									$stmt = $dbh->query(
-										"SELECT r.id, UNIX_TIMESTAMP(r.timestamp) timestamp, a.name, r.revision, r.platform, r.comment " .
-										"FROM " . DB_TESTMAN . ".winetest_runs r " .
-										"JOIN " . DB_ROSCMS . ".roscms_accounts a ON r.user_id = a.id " .
-										"ORDER BY revision DESC, r.id DESC " .
-										"LIMIT 10"
-									) or die("Query failed #1");
-									
-									$oddeven = false;
-									$ids = array();
-									
-									while($row = $stmt->fetch(PDO::FETCH_ASSOC))
-									{
-										$ids[] = $row["id"];
-										
-										printf('<tr class="%s" onmouseover="Result_OnMouseOver(this)" onmouseout="Result_OnMouseOut(this)">', ($oddeven ? "odd" : "even"));
-										printf('<td><input onclick="Result_OnCheckboxClick(this)" type="checkbox" name="test_%s" /></td>', $row["id"]);
-										printf('<td onclick="Result_OnCellClick(this)">%s</td>', $row["revision"]);
-										printf('<td onclick="Result_OnCellClick(this)">%s</td>', GetDateString($row["timestamp"]));
-										printf('<td onclick="Result_OnCellClick(this)">%s</td>', htmlspecialchars($row["name"]));
-										printf('<td onclick="Result_OnCellClick(this)">%s</td>', GetPlatformString($row["platform"]));
-										printf('<td onclick="Result_OnCellClick(this)">%s</td>', htmlspecialchars($row["comment"]));
-										echo "</tr>";
-										
-										$oddeven = !$oddeven;
-									}
-								?>
-							</tbody>
-						</table>
-						
-						<?php
-							// Ensure that all checkboxes are unchecked with a JavaScript (some browsers keep them checked after a reload)
-							echo "<script type=\"text/javascript\">\n";
-							echo "//<![CDATA[\n";
-							
-							foreach($ids as $id)
-								printf('document.getElementsByName("test_%s")[0].checked = false;', $id);
-							
-							echo "\n//]]>\n";
-							echo "</script>";
-						?>
-					</div>
-					
-					</div>
-					</div>
-					</div>
-					</div>
-				</div>
-				
-				<div class="bubble_bg">
-					<div class="rounded_ll">
-					<div class="rounded_lr">
-					<div class="rounded_ul">
-					<div class="rounded_ur">
-					
-					<div class="bubble">
-						<h1><?php echo $testman_langres["search_header"]; ?></h1>
-						
-						<table id="searchform">
-							<tr>
-								<td><?php echo $testman_langres["revision"]; ?>:</td>
-								<td>
-									<input type="text" id="search_revision" value="" size="12" onkeypress="SearchInputs_OnKeyPress(event)" onkeyup="SearchRevisionInput_OnKeyUp(this)" /><br />
-									
-									<img src="../shared/images/info.gif" alt="" /> <?php printf($shared_langres["rangeinfo"], $rev, ($rev - 50), $rev); ?>
-								</td>
-							</tr>
-							<tr>
-								<td><?php echo $testman_langres["user"]; ?>:</td>
-								<td>
-									<input type="text" id="search_user" value="" size="24" onkeypress="SearchInputs_OnKeyPress(event)" />
-								</td>
-							</tr>
-							<tr>
-								<td><?php echo $testman_langres["platform"]; ?>:</td>
-								<td>
-									<select id="search_platform" size="1" onkeypress="SearchInputs_OnKeyPress(event)">
-										<option></option>
-										<option value="reactos">ReactOS</option>
-										<option value="5.0">Windows 2000</option>
-										<option value="5.1">Windows XP</option>
-										<option value="5.2">Windows XP x64/Server 2003</option>
-										<option value="6.0">Windows Vista/Server 2008</option>
-										<option value="6.1">Windows 7</option>
-									</select>
-								</td>
-							</tr>
-						</table><br />
-						
-						<button onclick="SearchButton_OnClick()"><?php echo $testman_langres["search_button"]; ?></button>
-						
-						<span id="ajax_loading_search">
-							<img src="../shared/images/ajax_loading.gif" alt="" /> <?php echo $testman_langres["searching"]; ?>...
-						</span>
-						
-						<div id="searchtable">
-							<!-- Filled by the JavaScript -->
-						</div>
-					</div>
-					
-					</div>
-					</div>
-					</div>
-					</div>
-				</div>
-			</td>
+						<img src="../shared/images/info.gif" alt="" /> <?php printf($shared_langres["rangeinfo"], $rev, ($rev - 50), $rev); ?>
+					</td>
+				</tr>
+				<tr>
+					<td><label for="search_user"><?php echo $testman_langres["user"]; ?>:</label></td>
+					<td>
+						<input type="text" id="search_user" value="" size="24" onkeypress="SearchInputs_OnKeyPress(event)" />
+					</td>
+				</tr>
+				<tr>
+					<td><label for="search_platform"><?php echo $testman_langres["platform"]; ?>:</label></td>
+					<td>
+						<select id="search_platform" size="1" onkeypress="SearchInputs_OnKeyPress(event)">
+							<option></option>
+							<option value="reactos">ReactOS</option>
+							<option value="5.0">Windows 2000</option>
+							<option value="5.1">Windows XP</option>
+							<option value="5.2">Windows XP x64/Server 2003</option>
+							<option value="6.0">Windows Vista/Server 2008</option>
+							<option value="6.1">Windows 7</option>
+						</select>
+					</td>
+				</tr>
+			</table><br />
 			
-			<td id="rightbox_td">
-				<div class="bubble_bg">
-					<div class="rounded_ll">
-					<div class="rounded_lr">
-					<div class="rounded_ul">
-					<div class="rounded_ur">
-					
-					<div class="bubble">
-						<div id="status"><?php printf($testman_langres["status"], "<b>0</b>"); ?></div><br />
-						
-						<button onclick="CompareButton_OnClick()"><?php echo $testman_langres["compare_button"]; ?></button>
-					</div>
-					
-					</div>
-					</div>
-					</div>
-					</div>
-				</div>
-			</td>
-		</tr>
-	</table>
+			<span class="controlgroup">
+				<button onclick="SearchButton_OnClick()"><?php echo $testman_langres["search_button"]; ?></button>
+				<img id="ajax_loading_search" src="../shared/images/ajax_loading.gif" alt="" />
+			</span>
+			
+			<span class="controlgroup">
+				<button onclick="CompareFirstTwoButton_OnClick()"><?php echo $testman_langres["comparefirsttwo_button"]; ?></button>
+				<button onclick="CompareSelectedButton_OnClick()"><?php echo $testman_langres["compareselected_button"]; ?></button>
+				<input type="checkbox" id="opennewwindow" onclick="OpenNewWindowCheckbox_OnClick(this)" /> <label for="opennewwindow"><?php echo $testman_langres["opennewwindow_checkbox"]; ?></label>
+			</span>
+			
+			<div id="searchtable">
+				<!-- Filled by the JavaScript -->
+			</div>
+		</div>
+		
+		</div>
+		</div>
+		</div>
+		</div>
+	</div><br />
+	
+	<iframe id="comparepage_frame" frameborder="0" onload="ResizeIFrame()" scrolling="no"></iframe>
 </div>
-
-</td>
-</tr>
-</table>
 
 </body>
 </html>

Modified: branches/danny-web/www/www.reactos.org/testman/js/compare.js.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/js/compare.js.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/js/compare.js.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/js/compare.js.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -54,6 +54,10 @@
 		document.getElementById("suite_" + UnchangedRows[i]).style.display = value;
 	
 	document.cookie = "showchanged=" + (checkbox.checked ? "1" : "0");
+	
+	// Report the size change to the parent window if "Open in new window" was disabled
+	if(parent.ResizeIFrame)
+		parent.ResizeIFrame();
 }
 
 function GetValueForResult(td)
@@ -300,21 +304,6 @@
 		CurrentRightDragBorder = MaxRightDragBorder;
 }
 
-function GetCookieValue(cookie)
-{
-	var cookies = document.cookie.split(";");
-	
-	for(var i = 0; i < cookies.length; i++)
-	{
-		var data = cookies[i].split("=");
-		
-		if(data[0] == cookie)
-			return data[1];
-	}
-	
-	return null;
-}
-
 function Load()
 {
 	// Prepare the Drag & Drop feature

Modified: branches/danny-web/www/www.reactos.org/testman/js/index.js.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/js/index.js.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/js/index.js.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/js/index.js.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -76,7 +76,7 @@
 	}
 	
 	// Update the status message
-	document.getElementById("status").innerHTML = "<?php printf($testman_langres["status"], '<b>" + SelectedResultCount + "<\/b>'); ?>";
+	document.getElementById("status").innerHTML = '<?php printf($testman_langres["status"], '<span id="selectedresultcount">\' + SelectedResultCount + \'<\/span>'); ?>';
 }
 
 /**
@@ -187,6 +187,7 @@
 	data["endrev"] = inputbox_endrev;
 	data["user"] = document.getElementById("search_user").value;
 	data["platform"] = document.getElementById("search_platform").value;
+	data["perpage"] = <?php echo RESULTS_PER_PAGE; ?>;
 	
 	data["resultlist"] = 1;
 	data["requesttype"] = REQUESTTYPE_FULLLOAD;
@@ -194,6 +195,57 @@
 	SearchCall();
 }
 
+function DetectObsoleteIE()
+{
+	var position = navigator.userAgent.indexOf("MSIE");
+	
+	if(position >= 0)
+	{
+		var version = navigator.userAgent.substr(position + 5, 1);
+		return (version < 8);
+	}
+	
+	return false;
+}
+
+function ResizeIFrame()
+{
+	if(DetectObsoleteIE())
+		return;
+	
+	var iframe = document.getElementById("comparepage_frame");
+	iframe.height = iframe.contentDocument.body.offsetHeight + 16;
+}
+
+function Load()
+{
+	// General settings
+	var iframe = document.getElementById("comparepage_frame");
+	
+	if(DetectObsoleteIE())
+	{
+		document.getElementById("opennewwindow").checked = true;
+		document.getElementById("opennewwindow").disabled = true;
+	}
+	else
+	{
+		document.getElementById("opennewwindow").checked = parseInt(GetCookieValue("opennewwindow"));
+	}
+	
+	// Show the last revisions
+	data = new Array();
+	
+	CurrentPage = 1;
+	
+	data["perpage"] = <?php echo DEFAULT_SEARCH_RESULTS_PER_PAGE; ?>;
+	data["user"] = "<?php echo DEFAULT_SEARCH_USER; ?>";
+	
+	data["resultlist"] = 1;
+	data["requesttype"] = REQUESTTYPE_FULLLOAD;
+	
+	SearchCall();
+}
+
 function GetTagData(RootElement, TagName)
 {
 	var Child = RootElement.getElementsByTagName(TagName)[0].firstChild;
@@ -230,6 +282,10 @@
 			html += document.getElementById("infobox").innerHTML;
 		}
 		
+		html += '<\/td>';
+		
+		html += '<td id="status">';
+		html += '<?php printf(addslashes($testman_langres["status"]), '<span id="selectedresultcount">0<\/span>'); ?>';
 		html += '<\/td>';
 		
 		// Page number boxes
@@ -278,7 +334,7 @@
 		html += '<\/td><\/tr><\/table>';
 
 		// File table
-		html += '<table class="datatable" cellspacing="0" cellpadding="0">';
+		html += '<table id="resulttable" class="datatable" cellspacing="0" cellpadding="0">';
 		
 		html += '<thead><tr class="head">';
 		html += '<th class="TestCheckbox"><\/th>';
@@ -367,19 +423,36 @@
 	document.getElementById("ajax_loading_search").style.visibility = "hidden";
 }
 
-function CompareLastTwoButton_OnClick()
+function OpenComparePage(parameters)
+{
+	if(document.getElementById("opennewwindow").checked || DetectObsoleteIE())
+	{
+		window.open("compare.php?" + parameters);
+	}
+	else
+	{
+		var iframe = document.getElementById("comparepage_frame");
+		
+		iframe.src = "compare.php?" + parameters;
+		iframe.style.display = "block";
+	}
+}
+
+function CompareFirstTwoButton_OnClick()
 {
 	var parameters = "ids=";
-	var trs = document.getElementById("lastresults").getElementsByTagName("tbody")[0].getElementsByTagName("tr");
-	
-	if(trs.length < 2)
-		return;
-	
-	// Get the IDs through the "name" attribute of the checkboxes	
-	parameters += trs[1].firstChild.firstChild.name.substr(5) + ",";
+	var trs = document.getElementById("resulttable").getElementsByTagName("tbody")[0].getElementsByTagName("tr");
+	
+	if(trs[0].firstChild.firstChild.nodeName != "INPUT")
+		return;
+	
+	// Get the IDs through the "name" attribute of the checkboxes
 	parameters += trs[0].firstChild.firstChild.name.substr(5);
 	
-	window.open("compare.php?" + parameters);
+	if(trs[1])
+		parameters += "," + trs[1].firstChild.firstChild.name.substr(5);
+	
+	OpenComparePage(parameters);
 }
 
 function PageSwitch(NewPage, StartID)
@@ -427,7 +500,7 @@
 	return a - b;
 }
 
-function CompareButton_OnClick()
+function CompareSelectedButton_OnClick()
 {
 	var parameters = "ids=";
 	var IDArray = new Array();
@@ -456,5 +529,11 @@
 		parameters += "," + IDArray[i];
 	}
 	
-	window.open("compare.php?" + parameters);
-}
+	OpenComparePage(parameters);
+}
+
+function OpenNewWindowCheckbox_OnClick(checkbox)
+{
+	document.cookie = "opennewwindow=" + (checkbox.checked ? "1" : "0");
+	document.getElementById("comparepage_frame").style.display = "none";
+}

Added: branches/danny-web/www/www.reactos.org/testman/js/shared.js
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/js/shared.js?rev=432&view=auto
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/js/shared.js (added)
+++ branches/danny-web/www/www.reactos.org/testman/js/shared.js [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -1,0 +1,23 @@
+/*
+  PROJECT:    ReactOS Web Test Manager
+  LICENSE:    GNU GPLv2 or any later version as published by the Free Software Foundation
+  PURPOSE:    Shared JavaScript functions
+  COPYRIGHT:  Copyright 2009 Colin Finck <colin at reactos.org>
+
+  charset=utf-8
+*/
+
+function GetCookieValue(cookie)
+{
+	var cookies = document.cookie.split("; ");
+	
+	for(var i = 0; i < cookies.length; i++)
+	{
+		var data = cookies[i].split("=");
+		
+		if(data[0] == cookie)
+			return data[1];
+	}
+	
+	return null;
+}

Propchange: branches/danny-web/www/www.reactos.org/testman/js/shared.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -16,8 +16,6 @@
 		"index_intro" => "Mit dieser Oberfläche können Sie die Ergebnisse automatisch ausgeführter Regression-Tests suchen, anzeigen und vergleichen.",
 		"js_disclaimer" => "Sie müssen JavaScript aktivieren, um die Oberfläche zu benutzen!",
 		
-		"lastresults_header" => "Letzte 10 Testergebnisse",
-		"comparelasttwo_button" => "Letzte zwei Ergebnisse vergleichen",
 		"date" => "Datum",
 		"revision" => "Revision",
 		"user" => "Benutzer",
@@ -26,13 +24,13 @@
 		
 		"search_header" => "Nach Testergebnissen suchen",
 		"search_button" => "Suchen",
-		"searching" => "Testergebnisse werden gesucht",
+		"comparefirsttwo_button" => "Erste zwei Ergebnisse vergleichen",
+		"compareselected_button" => "Gewählte Ergebnisse vergleichen",
+		"opennewwindow_checkbox" => "In neuem Fenster öffnen",
 		
 		"foundresults" => "%s Ergebnisse gefunden!",
 		"noresults" => "Keine Suchergebnisse!",
-		
-		"status" => "<b>%s</b> Tests zum Vergleich ausgewählt",
-		"compare_button" => "Jetzt vergleichen",
+		"status" => "%s Tests zum Vergleich ausgewählt",
 		
 		"noselection" => "Sie haben keine Ergebnisse ausgewählt!",
 		"maxselection" => "Sie dürfen nur bis zu %d Ergebnisse zum Vergleich auswählen!",

Modified: branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -16,8 +16,6 @@
 		"index_intro" => "This interface enables you to find, view and compare Results of automatically performed Regression Tests.",
 		"js_disclaimer" => "You have to activate JavaScript to use the interface!",
 		
-		"lastresults_header" => "Last 10 Test Results",
-		"comparelasttwo_button" => "Compare last two Results",
 		"date" => "Date",
 		"revision" => "Revision",
 		"user" => "User",
@@ -26,13 +24,13 @@
 		
 		"search_header" => "Search for Test Results",
 		"search_button" => "Search",
-		"searching" => "Searching for Test Results",
+		"comparefirsttwo_button" => "Compare first two Results",
+		"compareselected_button" => "Compare selected Results",
+		"opennewwindow_checkbox" => "Open in new Window",
 		
 		"foundresults" => "Found %s Results!",
 		"noresults" => "No Search Results!",
-		
-		"status" => "<b>%s</b> Tests selected for comparison",
-		"compare_button" => "Compare Now",
+		"status" => "%s Tests selected for comparison",
 		
 		"noselection" => "You did not select any results!",
 		"maxselection" => "You may only select up to %d results for comparison!",

Modified: branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php?rev=432&r1=431&r2=432&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php [iso-8859-1] Sat Jun 13 05:47:10 2009
@@ -17,8 +17,6 @@
 		"index_intro" => "Ten interfejs pozwala Tobie znaleźć, zobaczyć i porównać wyniki przeprowadzanych automatycznie testów regresji.",
 		"js_disclaimer" => "Musisz wÅ‚Ä
czyć obsługę JavaScriptu, aby używać tego interfejsu!",
 		
-		"lastresults_header" => "10 ostatnich wyników testów",
-		"comparelasttwo_button" => "Porównaj dwa ostatnie wyniki testów",
 		"date" => "Data",
 		"revision" => "Rewizja",
 		"user" => "Użytkownik",
@@ -27,13 +25,13 @@
 		
 		"search_header" => "Szukaj wyników testów",
 		"search_button" => "Szukaj",
-		"searching" => "Trwa szukanie w wynikach testów",
+		"comparefirsttwo_button" => "Porównaj dwa ostatnie wyniki testów",
+		"compareselected_button" => "Porównaj dwa pierwsze wyniki testów",
+		"opennewwindow_checkbox" => "Otwórz w nowym oknie",
 		
 		"foundresults" => "Znaleziono %s wyników!",
-		"noresults" => "Brak wyników wyszukiwania!",
-		
-		"status" => "<b>%s</b> testów wybranych do porównania",
-		"compare_button" => "Porównaj",
+		"noresults" => "Brak wyników wyszukiwania!",		
+		"status" => "%s testów wybranych do porównania",
 		
 		"noselection" => "Nie wybrałeś/aś żadnych wyników!",
 		"maxselection" => "Możesz zaznaczyć do porównania maksymalnie %d wyników!",



More information about the Ros-diffs mailing list