r75745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75744‎ | r75745 | r75746 >
Date:20:27, 31 October 2010
Author:yaron
Status:deferred
Tags:
Comment:
Moved loading of JS and CSS to happen after setting of main text, to work correctly for MW <= 1.16
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -106,14 +106,15 @@
107107 $text .= $form_text;
108108 }
109109 }
 110+ if ( $embedded )
 111+ $text = "<div class='runQueryEmbedded'>$text</div>";
 112+ $wgOut->addHTML( $text );
110113 SFUtils::addJavascriptAndCSS( $embedded ? $wgParser:null );
111114 $script = ' <script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n";
112 - if ( $embedded )
 115+ if ( $embedded ) {
113116 $wgParser->getOutput()->addHeadItem( $script );
114 - else
 117+ } else {
115118 $wgOut->addScript( $script );
116 - if ( $embedded )
117 - $text = "<div class='runQueryEmbedded'>$text</div>";
118 - $wgOut->addHTML( $text );
 119+ }
119120 }
120121 }

Status & tagging log