r78132 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78131‎ | r78132 | r78133 >
Date:18:26, 9 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Made SemanticForms.js get loaded normally, instead of at the end of the page, for MW < 1.17.
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -177,6 +177,8 @@
178178
179179 if ( $wgFCKEditorDir )
180180 $scripts[] = "$wgScriptPath/$wgFCKEditorDir/fckeditor.js";
 181+ $scripts[] = "$sfgScriptPath/libs/SemanticForms.js";
 182+
181183 global $wgOut;
182184 foreach ( $scripts as $js ) {
183185 if ( $parser ) {
@@ -186,12 +188,6 @@
187189 $wgOut->addScriptFile( $js );
188190 }
189191 }
190 - // The Semantic Forms custom Javascript needs to be included
191 - // at the end of the page, after the relevant HTML elements
192 - // have been defined.
193 - $js = "$sfgScriptPath/libs/SemanticForms.js";
194 - $script = "<script type=\"$wgJsMimeType\" src=\"$js\"></script>\n";
195 - $wgOut->addHTML( $script );
196192 if ( !$parser )
197193 $wgOut->addMeta( 'robots', 'noindex,nofollow' );
198194 }

Status & tagging log