r30824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30823‎ | r30824 | r30825 >
Date:07:02, 11 February 2008
Author:aaron
Status:old
Tags:
Comment:
Don't include JS/CSS several times. Not sure how this gets called twice though...
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -278,6 +278,7 @@
279279
280280 class FlaggedRevs {
281281 public static $dimensions = array();
 282+ public static $styleLoaded = false;
282283
283284 public static function load() {
284285 global $wgFlaggedRevTags, $wgFlaggedRevValues;
@@ -861,6 +862,9 @@
862863 */
863864 public static function InjectStyle( $out, $parserOut ) {
864865 global $wgJsMimeType;
 866+
 867+ if( self::$styleLoaded )
 868+ return true;
865869 # UI CSS
866870 $out->addLink( array(
867871 'rel' => 'stylesheet',
@@ -871,6 +875,8 @@
872876 # UI JS
873877 $out->addScript( "<script type=\"{$wgJsMimeType}\" src=\"" . FLAGGED_JS . "\"></script>\n" );
874878
 879+ self::$styleLoaded = true;
 880+
875881 return true;
876882 }
877883

Status & tagging log