{
text-align:left;
}
-tr.alt
- {
- background: #F5FAFA;
- color: #797268;
- }
-
/* Poor old Internet Explorer 6 has a bug that means we can't use background images for the table rows
as it trys to download the image each and every time that it is used (which means a 1000 row table
will produce 1000 http requests for the image in question) */
+/* $Id */
+
/* Pagination list styles */
ul.fdtablePaginater
{
+/* $Id$ */
table.plc_table
{
width: auto;
color:#000;
text-decoration:none;
}
+/* rows with odd index */
+tr.alt
+ {
+ background: #F5FAFA;
+ color: #797268;
+ }
+
--- /dev/null
+/* $Id$ */
+
+/* set or clear the ' invisibleRow' in the tr's classname, according to visible */
+function plc_row_set_classname (row,visible) {
+ var cn=row.className;
+ /* clear */
+ cn=cn.replace(" invisibleRow","");
+ if (! visible) cn += " invisibleRow";
+ row.className=cn;
+}
+
+/* scan the table, and mark as visible the rows that have at least one cell that contains the pattern */
+function plc_filter_table(table_id,pattern_id) {
+ var
+ rows=document.getElementById(table_id).getElementsByTagName("tbody")[0].rows,
+ patterns=document.getElementById(pattern_id).value.split(" "),
+ row_index, row, cells,cell_index,cell,visible;
+
+ for (row_index = 0; row=rows[row_index]; row_index++) {
+
+ /* xxx deal with empty patterns and whitespaces */
+ if (patterns.length == 0) {
+ visible=true;
+ } else {
+ visible=false;
+ cells=row.cells;
+ for (cell_index = 0; cell=cells[cell_index]; cell_index++) {
+ for (var i in patterns) {
+ pattern=patterns[i];
+ if (cell.innerHTML.match(pattern)) visible=true;
+ }
+ }
+ }
+ plc_row_set_classname(row,visible);
+ }
+ tablePaginater.init(table_id);
+}
+/* $Id$ */
function addLoadEvent(func) {
if (!document.getElementById | !document.getElementsByTagName) return;
+/* $Id$ */
+
function displayTextInfo (opts,tablename) {
if(!("currentPage" in opts)) { return; }
b.appendChild(p);
}
+
<script type="text/javascript" src="/planetlab/tablesort/customsort.js"></script>
<script type="text/javascript" src="/planetlab/tablesort/paginate.js"></script>
<script type="text/javascript" src="/planetlab/js/plc_paginate.js"></script>
+<script type="text/javascript" src="/planetlab/js/plc_filter.js"></script>
';
$header_tablesort_css='
?>
+<script type"text/javascript">
+function nodesTextInfo (opts) {
+ displayTextInfo (opts,"nodes");
+}
+</script>
+
<div class="plc_filter">
<form method=get action='newindex.php'>
<table>
</tr>
<tr>
-<th><label for='nodepattern'>Hostname </label></th>
+<th><label for='nodepattern'>Hostname (server-side pattern)</label></th>
<td><input type='text' id='nodepattern' name='nodepattern'
size=40 value='<?php print $nodepattern; ?>'/></td>
<td><input type=submit value='Go' /></td>
?>
+<div id='tmp'>
+ <form>
+ <label> client-side pattern </label>
+ <input type='text' id='filter_text' size=15 onchange='plc_filter_table("nodes","filter_text");'/>
+ <input type='button' name='tmpbutton' value='click' onclick='plc_filter_table("nodes","filter_text");' />
+</form>
+</div>
+
<div class="fdtablePaginaterWrap" id="nodes-fdtablePaginaterWrapTop"><p></p></div>
<table id="nodes" cellpadding="0" cellspacing="0" border="0"
</thead>
<tbody>
-<script type"text/javascript">
-function nodesTextInfo (opts) {
- displayTextInfo (opts,"nodes");
-}
-</script>
-
<?php
$fake1=1; $fake2=3.14;