From: tjhunt Date: Wed, 24 Sep 2008 09:32:46 +0000 (+0000) Subject: MDL-16583 - Clean up javascript: Move some static scripts out of javascript.php and... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c849ed1e1e82399a21c4241e9e89dc12717561f4;p=moodle.git MDL-16583 - Clean up javascript: Move some static scripts out of javascript.php and into javascript-static.js. Also, ensure the HTML editor JS is only included if the user has chosen to use the HTML editor. --- diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 1728c58c0d..f76d1a87a8 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -488,3 +488,49 @@ function addonload(fn) { fn(); } } + +function uncheckall() { + void(d=document); + void(el=d.getElementsByTagName('INPUT')); + for(i=0;ieditorsrc) ) { + if (can_use_html_editor() && !empty($CFG->editorsrc)) { foreach ( $CFG->editorsrc as $scriptsource ) { echo ''."\n"; } @@ -40,25 +40,8 @@ function openpopup(url,name,options,fullscreen) { windowobj.focus(); return false; } - -function uncheckall() { - void(d=document); - void(el=d.getElementsByTagName('INPUT')); - for(i=0;iinserttextform)) { $insertfield = "opener.document.forms['$SESSION->inserttextform'].$SESSION->inserttextfield"; echo " if(!opener.document.forms['$SESSION->inserttextform']){"; @@ -76,49 +59,21 @@ function inserttext(text) { echo " $insertfield.value += text;\n"; echo " }\n"; echo " $insertfield.focus();\n"; -?> -} - -function getElementsByClassName(oElm, strTagName, oClassNames){ - var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); - var arrReturnElements = new Array(); - var arrRegExpClassNames = new Array(); - if(typeof oClassNames == "object"){ - for(var i=0; i - + echo "var id2suffix = {};\n"; + echo "//]]>\n"; + echo "\n"; +?>