Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -109,12 +109,7 @@ |
110 | 110 | * addStyle() and draws from the /skins folder. |
111 | 111 | */ |
112 | 112 | public function addExtensionStyle( $url ) { |
113 | | - global $wgHtml5; |
114 | | - $linkarr = array( 'rel' => 'stylesheet', 'href' => $url ); |
115 | | - if ( !$wgHtml5 ) { |
116 | | - # type attribute is mandatory in XHTML 1.0 Transitional |
117 | | - $linkarr['type'] = 'text/css'; |
118 | | - } |
| 113 | + $linkarr = array( 'rel' => 'stylesheet', 'href' => $url, 'type' => 'text/css' ); |
119 | 114 | array_push( $this->mExtStyles, $linkarr ); |
120 | 115 | } |
121 | 116 | |
— | — | @@ -123,7 +118,7 @@ |
124 | 119 | * @param string $file filename in skins/common or complete on-server path (/foo/bar.js) |
125 | 120 | */ |
126 | 121 | function addScriptFile( $file ) { |
127 | | - global $wgStylePath, $wgStyleVersion, $wgJsMimeType, $wgScript, $wgUser, $wgHtml5; |
| 122 | + global $wgStylePath, $wgStyleVersion, $wgJsMimeType, $wgScript, $wgUser; |
128 | 123 | global $wgJSAutoloadClasses, $wgJSAutoloadLocalClasses, $wgEnableScriptLoader, $wgScriptPath; |
129 | 124 | |
130 | 125 | if( substr( $file, 0, 1 ) == '/' ) { |
— | — | @@ -168,11 +163,15 @@ |
169 | 164 | } |
170 | 165 | |
171 | 166 | // if the script loader did not find a way to add the script than add using addScript |
172 | | - $attrs = array( 'src' => wfAppendQuery( $path, $this->getURIDparam() ) ); |
173 | | - if ( !$wgHtml5 ) { |
174 | | - $attrs['type'] = $wgJsMimeType; |
175 | | - } |
176 | | - $this->addScript( Xml::element( 'script', $attrs, '', false ) ); |
| 167 | + $this->addScript( |
| 168 | + Xml::element( 'script', |
| 169 | + array( |
| 170 | + 'type' => $wgJsMimeType, |
| 171 | + 'src' => wfAppendQuery( $path, $this->getURIDparam() ), |
| 172 | + ), |
| 173 | + '', false |
| 174 | + ) |
| 175 | + ); |
177 | 176 | } |
178 | 177 | |
179 | 178 | /** |
— | — | @@ -181,8 +180,7 @@ |
182 | 181 | * different page load types (edit, upload, view, etc) |
183 | 182 | */ |
184 | 183 | function addCoreScripts2Top(){ |
185 | | - global $wgEnableScriptLoader, $wgStyleVersion, $wgJSAutoloadLocalClasses, |
186 | | - $wgJsMimeType, $wgScriptPath, $wgEnableJS2system, $wgHtml5; |
| 184 | + global $wgEnableScriptLoader, $wgStyleVersion, $wgJSAutoloadLocalClasses, $wgJsMimeType, $wgScriptPath, $wgEnableJS2system; |
187 | 185 | //@@todo we should deprecate wikibits in favor of mv_embed and native jQuery functions |
188 | 186 | |
189 | 187 | if( $wgEnableJS2system ){ |
— | — | @@ -197,11 +195,12 @@ |
198 | 196 | $so = ''; |
199 | 197 | foreach( $core_classes as $s ){ |
200 | 198 | if( isset( $wgJSAutoloadLocalClasses[$s] ) ){ |
201 | | - $attrs = array( 'src' => "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() ); |
202 | | - if ( !$wgHtml5 ) { |
203 | | - $attrs['type'] = $wgJsMimeType; |
204 | | - } |
205 | | - $so.= Xml::element( 'script', $attrs, '', false ); |
| 199 | + $so.= Xml::element( 'script', array( |
| 200 | + 'type' => $wgJsMimeType, |
| 201 | + 'src' => "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() |
| 202 | + ), |
| 203 | + '', false |
| 204 | + ); |
206 | 205 | } |
207 | 206 | } |
208 | 207 | $this->mScripts = $so . $this->mScripts; |
— | — | @@ -214,7 +213,7 @@ |
215 | 214 | */ |
216 | 215 | function addScriptClass( $js_class ){ |
217 | 216 | global $wgDebugJavaScript, $wgJSAutoloadLocalClasses, $wgJSAutoloadClasses, |
218 | | - $wgJsMimeType, $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath, $wgHtml5; |
| 217 | + $wgJsMimeType, $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath; |
219 | 218 | |
220 | 219 | if( isset( $wgJSAutoloadClasses[$js_class] ) || isset( $wgJSAutoloadLocalClasses[$js_class] ) ){ |
221 | 220 | if( $wgEnableScriptLoader ){ |
— | — | @@ -229,12 +228,16 @@ |
230 | 229 | }else if( isset( $wgJSAutoloadLocalClasses[$js_class] ) ){ |
231 | 230 | $path.= $wgJSAutoloadLocalClasses[$js_class]; |
232 | 231 | } |
233 | | - $urlAppend = ( $wgDebugJavaScript) ? time() : $wgStyleVersion; |
234 | | - $attrs = array( 'src' => "$path?$urlAppend" ); |
235 | | - if ( !$wgHtml5 ) { |
236 | | - $attrs['type'] = $wgJsMimeType; |
237 | | - } |
238 | | - $this->addScript( Xml::element( 'script', $attrs, '', false ) ); |
| 232 | + $urlApend = ( $wgDebugJavaScript) ? time() : $wgStyleVersion; |
| 233 | + $this->addScript( |
| 234 | + Xml::element( 'script', |
| 235 | + array( |
| 236 | + 'type' => $wgJsMimeType, |
| 237 | + 'src' => "$path?" . $urlApend, |
| 238 | + ), |
| 239 | + '', false |
| 240 | + ) |
| 241 | + ); |
239 | 242 | } |
240 | 243 | return true; |
241 | 244 | } |
— | — | @@ -247,7 +250,7 @@ |
248 | 251 | * @param $forcClassAry Boolean: false by default |
249 | 252 | */ |
250 | 253 | function getScriptLoaderJs( $forceClassAry = false ){ |
251 | | - global $wgJsMimeType, $wgStyleVersion, $wgRequest, $wgDebugJavaScript, $wgHtml5; |
| 254 | + global $wgJsMimeType, $wgStyleVersion, $wgRequest, $wgDebugJavaScript; |
252 | 255 | |
253 | 256 | if( !$forceClassAry ){ |
254 | 257 | $class_list = implode( ',', $this->mScriptLoaderClassList ); |
— | — | @@ -265,11 +268,14 @@ |
266 | 269 | |
267 | 270 | //generate the unique request param (combine with the most recent revision id of any wiki page with the $wgStyleVersion var) |
268 | 271 | |
269 | | - $attrs = array( 'src' => wfScript( 'mwScriptLoader' ) . "?class={$class_list}{$debug_param}&".$this->getURIDparam() ); |
270 | | - if ( !$wgHtml5 ) { |
271 | | - $attrs['type'] = $wgJsMimeType; |
272 | | - } |
273 | | - return Xml::element( 'script', $attrs, '', false ); |
| 272 | + |
| 273 | + return Xml::element( 'script', |
| 274 | + array( |
| 275 | + 'type' => $wgJsMimeType, |
| 276 | + 'src' => wfScript( 'mwScriptLoader' ) . "?class={$class_list}{$debug_param}&".$this->getURIDparam(), |
| 277 | + ), |
| 278 | + '', false |
| 279 | + ); |
274 | 280 | } |
275 | 281 | |
276 | 282 | function getURIDparam(){ |
— | — | @@ -298,9 +304,8 @@ |
299 | 305 | * @param string $script JavaScript text, no <script> tags |
300 | 306 | */ |
301 | 307 | function addInlineScript( $script ) { |
302 | | - global $wgJsMimeType, $wgHtml5; |
303 | | - $this->mScripts .= "\t\t<script" . ($wgHtml5 ? '' : " type=\"$wgJsMimeType\"") |
304 | | - . ">/*<![CDATA[*/\n\t\t$script\n\t\t/*]]>*/</script>\n"; |
| 308 | + global $wgJsMimeType; |
| 309 | + $this->mScripts .= "\t\t<script type=\"$wgJsMimeType\">/*<![CDATA[*/\n\t\t$script\n\t\t/*]]>*/</script>\n"; |
305 | 310 | } |
306 | 311 | |
307 | 312 | function getScript() { |
— | — | @@ -1935,24 +1940,8 @@ |
1936 | 1941 | return "\t" . implode( "\n\t", $links ); |
1937 | 1942 | } |
1938 | 1943 | |
1939 | | - /** |
1940 | | - * Return a <link rel="stylesheet"> with the given parameters. |
1941 | | - * |
1942 | | - * @param $style string Relative or absolute URL. If $style begins with |
1943 | | - * '/', 'http:', or 'https:' it's used for the href as-is. Otherwise, |
1944 | | - * it's assumed to refer to some file within $wgStylePath, so the URL |
1945 | | - * used is "$wgStylePath/$style?$wgStyleVersion". |
1946 | | - * @param $options array Associative array with the following possible |
1947 | | - * keys: |
1948 | | - * 'dir': 'rtl' or 'ltr'. If the site language direction doesn't match |
1949 | | - * this, the empty string is returned. |
1950 | | - * 'media': Contents of the media attribute (will be mangled a bit, |
1951 | | - * e.g. 'screen' -> 'screen,projection' so Opera fullscreen works) |
1952 | | - * 'condition': Wrap in an IE conditional comment, e.g., 'lt IE 7'. |
1953 | | - * @return string Raw HTML |
1954 | | - */ |
1955 | 1944 | protected function styleLink( $style, $options ) { |
1956 | | - global $wgRequest, $wgHtml5; |
| 1945 | + global $wgRequest; |
1957 | 1946 | |
1958 | 1947 | if( isset( $options['dir'] ) ) { |
1959 | 1948 | global $wgContLang; |
— | — | @@ -1981,11 +1970,9 @@ |
1982 | 1971 | |
1983 | 1972 | $attribs = array( |
1984 | 1973 | 'rel' => 'stylesheet', |
1985 | | - 'href' => $url ); |
1986 | | - if ( !$wgHtml5 ) { |
1987 | | - $attribs['type'] = 'text/css'; |
1988 | | - } |
1989 | | - if ( $media ) { |
| 1974 | + 'href' => $url, |
| 1975 | + 'type' => 'text/css' ); |
| 1976 | + if( $media ) { |
1990 | 1977 | $attribs['media'] = $media; |
1991 | 1978 | } |
1992 | 1979 | |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -333,10 +333,9 @@ |
334 | 334 | } |
335 | 335 | |
336 | 336 | static function makeVariablesScript( $data ) { |
337 | | - global $wgJsMimeType, $wgHtml5; |
| 337 | + global $wgJsMimeType; |
338 | 338 | |
339 | | - $r = array( "<script" . ( $wgHtml5 ? '' : " type=\"$wgJsMimeType\"" ) |
340 | | - . ">/*<![CDATA[*/" ); |
| 339 | + $r = array( "<script type=\"$wgJsMimeType\">/*<![CDATA[*/" ); |
341 | 340 | foreach ( $data as $name => $value ) { |
342 | 341 | $encValue = Xml::encodeJsVar( $value ); |
343 | 342 | $r[] = "var $name = $encValue;"; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -198,7 +198,6 @@ |
199 | 199 | numbers outside the permitted ranges), etc. |
200 | 200 | ** The summary attribute has been removed from tables of contents. summary is |
201 | 201 | obsolete in HTML 5 and wasn't useful here anyway. |
202 | | -** Remove unnecessary type="" for CSS/JS in HTML 5 output |
203 | 202 | * New hook SpecialRandomBeforeSQL allows extensions to modify or replace the SQL |
204 | 203 | query used in Special:Random and subclasses, deprecating the $wgExtraRandompageSQL |
205 | 204 | config variable |