]> git.p6c8.net - devedit.git/commitdiff
Added some JavaScript to the directory listing for selecting or unselecting
authorpcanterino <>
Tue, 28 Dec 2010 22:05:14 +0000 (22:05 +0000)
committerpcanterino <>
Tue, 28 Dec 2010 22:05:14 +0000 (22:05 +0000)
all files

templates/dirlist.htm

index 4777d4189a1c16e8a3ef605912328d0c17bbbdb7..f1626e35621e9e8f21de6f37efca604ee5c8321a 100644 (file)
@@ -5,6 +5,35 @@
 <head>
 <title>Directory listing of {DIR}</title>
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+<script type="text/javascript">
+function selectAll()
+{
+ if(document.forms[0])
+ {
+  for(var x = 0; x < document.forms[0].length; x++)
+  {
+   if(document.forms[0].elements[x].name == "files" && document.forms[0].elements[x].type == "checkbox")
+   {
+    document.forms[0].elements[x].checked = true
+   }
+  }
+ }
+}
+
+function unselectAll()
+{
+ if(document.forms[0])
+ {
+  for(var x = 0; x < document.forms[0].length; x++)
+  {
+   if(document.forms[0].elements[x].name == "files" && document.forms[0].elements[x].type == "checkbox")
+   {
+    document.forms[0].elements[x].checked = false
+   }
+  }
+ }
+}
+</script>
 </head>
 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
 
@@ -23,6 +52,8 @@
 
 <hr>
 
+<p><a onclick="selectAll(); return false;" href="#">Select all</a> / <a onclick="unselectAll(); return false;" href="#">Unselect all</a></p>
+
 <p><input type="submit" value="Delete selected files"></p>
 
 </form>{ENDIF}

patrick-canterino.de