r66722 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66721‎ | r66722 | r66723 >
Date:15:23, 21 May 2010
Author:hartman
Status:deferred
Tags:
Comment:
Fix OggHandler to use Html::linkedScript() and friends instead of selfwritten <script>
This helps with wgHTML5 etc.
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler.php (modified) (history)
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler.php
@@ -24,7 +24,7 @@
2525 ini_get( 'include_path' ) );
2626
2727 // Bump this when updating OggPlayer.js to help update caches
28 -$wgOggScriptVersion = '11';
 28+$wgOggScriptVersion = '12';
2929
3030 $wgExtensionMessagesFiles['OggHandler'] = "$oggDir/OggHandler.i18n.php";
3131 $wgExtensionMessagesFiles['OggHandlerMagic'] = "$oggDir/OggHandler.i18n.magic.php";
Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -451,23 +451,26 @@
452452 $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl );
453453 $encExtPathUrl = Xml::encodeJsVar( $scriptPath );
454454
455 - $out->addHeadItem( 'OggHandler', <<<EOT
456 -<script type="text/javascript" src="$scriptPath/OggPlayer.js?$wgOggScriptVersion"></script>
457 -<script type="text/javascript">
 455+ $out->addHeadItem( 'OggHandlerScript' , Html::linkedScript( "{$scriptPath}/OggPlayer.js?$wgOggScriptVersion" ) );
 456+
 457+ $out->addHeadItem( 'OggHandlerInlineScript', Html::inlineScript( <<<EOT
 458+
458459 wgOggPlayer.msg = $jsMsgs;
459460 wgOggPlayer.cortadoUrl = $encCortadoUrl;
460461 wgOggPlayer.extPathUrl = $encExtPathUrl;
461 -</script>
462 -<style type="text/css">
 462+
 463+EOT
 464+) );
 465+ $out->addHeadItem( 'OggHandlerInlineCSS', Html::inlineStyle( <<<EOT
 466+
463467 .ogg-player-options {
464468 border: solid 1px #ccc;
465469 padding: 2pt;
466470 text-align: left;
467471 font-size: 10pt;
468 -}
469 -</style>
 472+
470473 EOT
471 -);
 474+) );
472475 }
473476
474477 function parserTransformHook( $parser, $file ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r66727Follow up r66722 Fix guard against multiple addition.hartman17:14, 21 May 2010
r70246Correct error in CSS of r66722hartman22:10, 31 July 2010

Status & tagging log