mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Added CDATA to Javascript
This commit is contained in:
parent
a4e2f9e9bb
commit
5e87b920e3
3 changed files with 8 additions and 4 deletions
|
@ -1045,6 +1045,7 @@ function validate_' . $this->_attributes['id'] . '(frm) {
|
||||||
|
|
||||||
function getLockOptionEndScript(){
|
function getLockOptionEndScript(){
|
||||||
$js = '<script type="text/javascript" language="javascript">'."\n";
|
$js = '<script type="text/javascript" language="javascript">'."\n";
|
||||||
|
$js .= '//<![CDATA['."\n";
|
||||||
$js .= "var ".$this->getAttribute('id')."items= {";
|
$js .= "var ".$this->getAttribute('id')."items= {";
|
||||||
foreach ($this->_dependencies as $dependentOn => $elements){
|
foreach ($this->_dependencies as $dependentOn => $elements){
|
||||||
$js .= "'$dependentOn'".' : {dependents :[';
|
$js .= "'$dependentOn'".' : {dependents :[';
|
||||||
|
@ -1065,6 +1066,7 @@ function validate_' . $this->_attributes['id'] . '(frm) {
|
||||||
$js=rtrim($js, ",\n");
|
$js=rtrim($js, ",\n");
|
||||||
$js .= '};'."\n";
|
$js .= '};'."\n";
|
||||||
$js .="lockoptionsallsetup('".$this->getAttribute('id')."');\n";
|
$js .="lockoptionsallsetup('".$this->getAttribute('id')."');\n";
|
||||||
|
$js .='//]]>'."\n";
|
||||||
$js .='</script>'."\n";
|
$js .='</script>'."\n";
|
||||||
return $js;
|
return $js;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3694,7 +3694,8 @@ function use_html_editor($name='', $editorhidebuttons='', $id='') {
|
||||||
if ($id === '') {
|
if ($id === '') {
|
||||||
$id = 'edit-'.$name;
|
$id = 'edit-'.$name;
|
||||||
}
|
}
|
||||||
echo '<script language="javascript" type="text/javascript" defer="defer">'."\n";
|
echo "\n".'<script language="javascript" type="text/javascript" defer="defer">'."\n";
|
||||||
|
echo '//<![CDATA['."\n";
|
||||||
echo "$editor = new HTMLArea('$id');\n";
|
echo "$editor = new HTMLArea('$id');\n";
|
||||||
echo "var config = $editor.config;\n";
|
echo "var config = $editor.config;\n";
|
||||||
|
|
||||||
|
@ -3705,6 +3706,7 @@ function use_html_editor($name='', $editorhidebuttons='', $id='') {
|
||||||
} else {
|
} else {
|
||||||
echo "\n$editor.generate();\n";
|
echo "\n$editor.generate();\n";
|
||||||
}
|
}
|
||||||
|
echo '//]]>'."\n";
|
||||||
echo '</script>'."\n";
|
echo '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
foreach ($feedback as $i=>$str) {
|
foreach ($feedback as $i=>$str) {
|
||||||
$js .= 'FEEDBACK['.$i."] = $str;\n";
|
$js .= 'FEEDBACK['.$i."] = $str;\n";
|
||||||
}
|
}
|
||||||
$js = '<script type="text/javascript" language="javascript">'."<!--\n"."FEEDBACK = new Array();\n".$js."//--></script>\n";
|
$js = '<script type="text/javascript" language="javascript">'."\n//<![CDATA[\n"."FEEDBACK = new Array();\n".$js."//]]>\n</script>\n";
|
||||||
$hp->html = preg_replace('|</head>|i', "$js</head>", $hp->html, 1);
|
$hp->html = preg_replace('|</head>|i', "$js</head>", $hp->html, 1);
|
||||||
}
|
}
|
||||||
// insert hot-potatoes.js
|
// insert hot-potatoes.js
|
||||||
|
@ -302,7 +302,7 @@
|
||||||
// so some old or modified themes may not insert $body_tags
|
// so some old or modified themes may not insert $body_tags
|
||||||
$body .= ""
|
$body .= ""
|
||||||
. '<script type="text/javascript">'."\n"
|
. '<script type="text/javascript">'."\n"
|
||||||
. "<!--\n"
|
. "//<![CDATA[\n"
|
||||||
. " var s = (typeof(window.onload)=='function') ? onload.toString() : '';\n"
|
. " var s = (typeof(window.onload)=='function') ? onload.toString() : '';\n"
|
||||||
. " if (s.indexOf('".$matches[3]."')<0) {\n"
|
. " if (s.indexOf('".$matches[3]."')<0) {\n"
|
||||||
. " if (s=='') {\n" // no previous onload
|
. " if (s=='') {\n" // no previous onload
|
||||||
|
@ -312,7 +312,7 @@
|
||||||
. " window.onload = new Function('window.onload_hotpot();'+'".$matches[3]."');\n"
|
. " window.onload = new Function('window.onload_hotpot();'+'".$matches[3]."');\n"
|
||||||
. " }\n"
|
. " }\n"
|
||||||
. " }\n"
|
. " }\n"
|
||||||
. "//-->\n"
|
. "//]]>\n"
|
||||||
. "</script>\n"
|
. "</script>\n"
|
||||||
;
|
;
|
||||||
$footer = '</body>'.$footer;
|
$footer = '</body>'.$footer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue