]> git.mjollnir.org Git - moodle.git/commitdiff
javascript: MDL-18568 We don't need a function called uncheckall, as well as one...
authortjhunt <tjhunt>
Mon, 16 Mar 2009 02:11:15 +0000 (02:11 +0000)
committertjhunt <tjhunt>
Mon, 16 Mar 2009 02:11:15 +0000 (02:11 +0000)
Also, clean up coding style in the popupchecker function.

course/search.php
lib/javascript-static.js

index 73bf8e9dafd7344ceb19f68baf3319456b102bc6..31f97c8c6cc80cad4554f7d2aba2b51f31a4116f 100644 (file)
             echo "<tr>\n<td colspan=\"4\" style=\"text-align:center\">\n";
             echo "<br />";
             echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n";
-            echo "<input type=\"button\" onclick=\"uncheckall()\" value=\"$strdeselectall\" />\n";
+            echo "<input type=\"button\" onclick=\"checknone()\" value=\"$strdeselectall\" />\n";
             choose_from_menu ($displaylist, "moveto", "", get_string("moveselectedcoursesto"), "javascript: getElementById('movecourses').submit()");
             echo "</td>\n</tr>\n";
             echo "</table>\n</form>";
index de6996cf131a24b06fe50f5960b9ae67986bd141..e197e2114d7c1360009ca6ebf32a7dbb737e49ce 100644 (file)
@@ -2,9 +2,9 @@
 
 function popupchecker(msg) {
     var testwindow = window.open('itestwin.html', '', 'width=1,height=1,left=0,top=0,scrollbars=no');
-    if (testwindow == null)
-        {alert(msg);}
-    else {
+    if (!testwindow) {
+        alert(msg);
+    else {
         testwindow.close();
     }
 }
@@ -654,22 +654,6 @@ function addonload(fn) {
     }
 }
 
-function uncheckall() {
-  void(d=document);
-  void(el=d.getElementsByTagName('INPUT'));
-  for(i=0;i<el.length;i++) {
-    void(el[i].checked=0);
-  }
-}
-
-function checkall() {
-  void(d=document);
-  void(el=d.getElementsByTagName('INPUT'));
-  for(i=0;i<el.length;i++) {
-    void(el[i].checked=1);
-  }
-}
-
 function getElementsByClassName(oElm, strTagName, oClassNames){
     var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
     var arrReturnElements = new Array();