r61472 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61471‎ | r61472 | r61473 >
Date:19:43, 24 January 2010
Author:simetrical
Status:ok
Tags:
Comment:
Use Html::linkedScript()

Follow-up to r61432. This has a simpler call interface and encapsulates
ugly $wgJsMimeType nonsense.
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -122,20 +122,13 @@
123123 * @param string $file filename in skins/common or complete on-server path (/foo/bar.js)
124124 */
125125 function addScriptFile( $file ) {
126 - global $wgStylePath, $wgStyleVersion, $wgJsMimeType;
 126+ global $wgStylePath, $wgStyleVersion;
127127 if( substr( $file, 0, 1 ) == '/' ) {
128128 $path = $file;
129129 } else {
130130 $path = "{$wgStylePath}/common/{$file}";
131131 }
132 - $this->addScript(
133 - Html::element( 'script',
134 - array(
135 - 'type' => $wgJsMimeType,
136 - 'src' => "$path?$wgStyleVersion",
137 - )
138 - )
139 - );
 132+ $this->addScript( Html::linkedScript( "$path?$wgStyleVersion" ) );
140133 }
141134
142135 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61432Use Html::element instead of Xml::element...nikerabbit20:15, 23 January 2010

Status & tagging log