added template example (which include do_checkbox JavaScript)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Nov 2003 20:46:18 +0000 (20:46 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 17 Nov 2003 20:46:18 +0000 (20:46 +0000)
added select all/none/toggle at results page (usage of do_checkbox.js)

git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@156 13eb9ef6-21d5-0310-b721-a9d68796d827

TODO
public_html/do_checkbox.js [new file with mode: 0644]
public_html/template.html [new file with mode: 0644]
template_html/index_res.html
template_html/results.html
template_html/search.html

diff --git a/TODO b/TODO
index 0ca09e3..b62a889 100644 (file)
--- a/TODO
+++ b/TODO
@@ -49,3 +49,6 @@ should be better way...)
 
 - implement "master" template in which all other pages will be included.
   Good for integration of webpac into existing portal design
+
+- drop index tables which are not used anymore (at end of indexing)
+  e.g. webpac-hidra link_900
diff --git a/public_html/do_checkbox.js b/public_html/do_checkbox.js
new file mode 100644 (file)
index 0000000..607fe8d
--- /dev/null
@@ -0,0 +1,13 @@
+// usage: onClick="return do_checkbox('name',[1|0|-1];")
+// 1 = select all, 0 = select none, -1 = toggle selection
+function do_checkbox(name,what) {
+       var boxes = document.getElementsByName(name);
+       for (var i = 0; boxes && i < boxes.length; i++) {
+               switch (what) {
+                       case 1: boxes[i].checked = true; break;
+                       case 0: boxes[i].checked = false; break;
+                       case -1: boxes[i].checked = !boxes[i].checked; break;
+               }
+       }
+       return false; // don't scroll
+}
diff --git a/public_html/template.html b/public_html/template.html
new file mode 100644 (file)
index 0000000..d7aabe0
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+<title>FF WebPAC</title>
+<meta http-equiv="Content-Type" content="text/html ; charset=ISO-8859-2">
+<link rel="stylesheet" type="text/css" href="style.css">
+<script src="do_checkbox.js" type="text/javascript"></script>
+</head>
+<body bgcolor="FFFFE8">
+
+##webpac##
+
+</body>
+</html>
index 660a881..516eee2 100644 (file)
@@ -1,12 +1,4 @@
-<html>
-<head>
-<title>FF WebPAC</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
-<link rel="stylesheet" type="text/css" href="style.css">
 <TMPL_VAR NAME="PAGER_JAVASCRIPT">
-</head>
-<body>
-<p><a href="/">Knji¾nice FF-a</a></p>
 
 <form method=post>
   <div align="left">
@@ -47,7 +39,3 @@
 </TABLE>
 <TMPL_VAR NAME="PAGER_HIDDEN">
 </FORM>
-
-</body>
-</html>
-
index 29f3f7b..6eadfd6 100644 (file)
@@ -1,12 +1,4 @@
-<html>
-<head>
-<title>FF WebPAC</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
-<link rel="stylesheet" type="text/css" href="style.css">
 <TMPL_VAR NAME="PAGER_JAVASCRIPT">
-</head>
-<body>
-<p><a href="/">Knji¾nice FF-a</a></p>
 
 <form method=post>
     <input type=submit value="Natrag na pretra¾ivanje" class="navigacijaDISABLED">
@@ -65,6 +57,9 @@ PAGER_offset: <TMPL_VAR PAGER_offset>
 
 <TMPL_ELSE>
 
+<input nowrap type=button value="+" onClick="do_checkbox('path',1)">
+<input nowrap type=button value="-" onClick="do_checkbox('path',0)">
+<input nowrap type=button value="&#177;" onClick="do_checkbox('path',-1)">
 <input nowrap type=submit name="show_full" value="Poka¾i detalje o odabranim jedinicama" onClick="PAGER_set_offset_and_submit(0);">
 <input type="hidden" name="last_PAGER_offset" value="<TMPL_VAR PAGER_offset>" />
 
@@ -89,6 +84,9 @@ PAGER_offset: <TMPL_VAR PAGER_offset>
 <TMPL_IF NAME="full">
 <input type=submit value="Natrag na listu rezultata">
 <TMPL_ELSE>
+<input nowrap type=button value="+" onClick="do_checkbox('path',1)">
+<input nowrap type=button value="-" onClick="do_checkbox('path',0)">
+<input nowrap type=button value="&#177;" onClick="do_checkbox('path',-1)">
 <input type=submit name="show_full" value="Poka¾i detalje o odabranim jedinicama" onClick="PAGER_set_offset_and_submit(0);">
 </TMPL_IF>
 </td></tr>
@@ -100,7 +98,3 @@ PAGER_offset: <TMPL_VAR PAGER_offset>
 </TABLE>
 <TMPL_VAR NAME="PAGER_HIDDEN">
 </FORM>
-
-</body>
-</html>
-
index ba7c0a1..567c1e5 100644 (file)
@@ -1,10 +1,3 @@
-<html>
-<head>
-<title>FF WebPAC</title>
-<meta http-equiv="Content-Type" content="text/html ; charset=ISO-8859-2">
-<link rel="stylesheet" type="text/css" href="style.css">
-</head>
-<body bgcolor="FFFFE8">
 <table width="100%" border=0>
 <tr>
        <td valign="top" width="30%"><a href="/"><b>Knji¾nice FF-a</b></a></td>
@@ -189,6 +182,10 @@ dragocjene va
       <tr> 
         <td rowspan="2" class="label2">
                <a href="_help.html">Vrsta graðe:</a>&nbsp;&nbsp;
+               <br>
+               <a class="headline" href="#" onClick="return do_checkbox('v10',1);">+</a>
+               <a class="headline" href="#" onClick="return do_checkbox('v10',0);">-</a>
+               <a class="headline" href="#" onClick="return do_checkbox('v10',-1);">&#177;</a>
        </td>
         <td rowspan="2" class="limiter" colspan="2"> 
           <input type="hidden" name="f10" value="type">
@@ -220,7 +217,7 @@ dragocjene va
        </td>
         <td class="limiter"> 
        <input type="checkbox" name="v11" value="Informacijske or Pedagogija or
-       Psihologija or Sociologija or Sredi¹nja">       
+       Psihologija or Sociologija or Sredi¹nja">
                sve knji¾nice dru¹tvenih znanosti
        </td>
       </tr>
@@ -289,6 +286,3 @@ dragocjene va
 
        
 </form>
-
-</body>
-</html>