+ /**
+ * Add a JavaScript file out of skins/common, or a given relative path.
+ * @param string $file filename in skins/common or complete on-server path (/foo/bar.js)
+ */
+ function addScriptFile( $file ) {
+ global $wgStylePath, $wgStyleVersion, $wgJsMimeType;
+ if( substr( $file, 0, 1 ) == '/' ) {
+ $path = $file;
+ } else {
+ $path = "{$wgStylePath}/common/{$file}";
+ }
+ $encPath = htmlspecialchars( $path );
+ $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"$path?$wgStyleVersion\"></script>\n" );
+ }
+