MDL-68148 output: type attribute is unnecessary for javascript resources

This commit is contained in:
Shamim Rezaie
2020-04-08 11:44:28 +10:00
parent 351262b192
commit cabbb145dd
2 changed files with 4 additions and 6 deletions
+2 -4
View File
@@ -2089,12 +2089,10 @@ class html_writer {
*/
public static function script($jscode, $url=null) {
if ($jscode) {
$attributes = array('type'=>'text/javascript');
return self::tag('script', "\n//<![CDATA[\n$jscode\n//]]>\n", $attributes) . "\n";
return self::tag('script', "\n//<![CDATA[\n$jscode\n//]]>\n") . "\n";
} else if ($url) {
$attributes = array('type'=>'text/javascript', 'src'=>$url);
return self::tag('script', '', $attributes) . "\n";
return self::tag('script', '', ['src' => $url]) . "\n";
} else {
return '';
+2 -2
View File
@@ -1467,14 +1467,14 @@ class page_requirements_manager {
);
if ($this->yui3loader->combine) {
return '<script type="text/javascript" src="' .
return '<script src="' .
$this->yui3loader->local_comboBase .
implode('&amp;', $baserollups) .
'"></script>';
} else {
$code = '';
foreach ($baserollups as $rollup) {
$code .= '<script type="text/javascript" src="'.$this->yui3loader->local_comboBase.$rollup.'"></script>';
$code .= '<script src="'.$this->yui3loader->local_comboBase.$rollup.'"></script>';
}
return $code;
}