r73657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73656‎ | r73657 | r73658 >
Date:14:30, 24 September 2010
Author:catrope
Status:deferred
Tags:
Comment:
ArticleAssessmentPilot: Rename JUIPath to JUIJSPath and add JUICSSPath. This is needed to properly handle jQuery UI CSS on Wikimedia without loading it twice from two different URLs for some users.
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php
@@ -14,11 +14,11 @@
1515 // Set to 'combined' or 'raw' if you need to debug this extension's JS
1616 $wgArticleAssessmentResourceMode = 'minified';
1717
18 -// Path to jQuery UI
19 -$wgArticleAssessmentJUIPath = null; // Defaults to "$wgExtensionAssetsPath/ArticleAssessmentPilot/js/jui.combined.min.js"
 18+// Path to jQuery UI's JS
 19+$wgArticleAssessmentJUIJSPath = null; // Defaults to "$wgExtensionAssetsPath/ArticleAssessmentPilot/js/jui.combined.min.js"
2020
21 -// Set to false if jQuery UI's CSS is already included through other means
22 -$wgArticleAssessmentNeedJUICSS = true;
 21+// Path to jQuery UI's CSS
 22+$wgArticleAssessmentJUICSSPath = null; // Defaults to "$wgExtensionAssetsPath/ArticleAssessmentPilot/css/jquery-ui-1.7.2.css"
2323
2424 // Auto-load files
2525 $dir = dirname( __FILE__ ) . '/';
Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php
@@ -50,8 +50,8 @@
5151 }
5252
5353 public static function addVariables( &$vars ) {
54 - global $wgArticleAssessmentJUIPath, $wgExtensionAssetsPath;
55 - $vars['wgArticleAssessmentJUIPath'] = $wgArticleAssessmentJUIPath ? $wgArticleAssessmentJUIPath :
 54+ global $wgArticleAssessmentJUIJSPath, $wgExtensionAssetsPath;
 55+ $vars['wgArticleAssessmentJUIPath'] = $wgArticleAssessmentJUIJSPath ? $wgArticleAssessmentJUIJSPath :
5656 "$wgExtensionAssetsPath/ArticleAssessmentPilot/js/jui.combined.min.js";
5757 return true;
5858 }
@@ -101,10 +101,10 @@
102102 );
103103 }
104104
105 - global $wgArticleAssessmentNeedJUICSS;
106 - if ( $wgArticleAssessmentNeedJUICSS ) {
107 - self::$styleFiles[$mode][] = array( 'src' => 'css/jquery-ui-1.7.2.css', 'version' => '1.7.2y' );
108 - }
 105+ global $wgArticleAssessmentJUICSSPath;
 106+ $out->addExtensionStyle( ( $wgArticleAssessmentJUICSSPath ? $wgArticleAssessmentJUICSSPath :
 107+ "$wgExtensionAssetsPath/ArticleAssessmentPilot/css/jquery-ui-1.7.2.css" ) . '?1.7.2y'
 108+ );
109109 foreach ( self::$styleFiles[$mode] as $style ) {
110110 $out->addExtensionStyle( $wgExtensionAssetsPath .
111111 "/ArticleAssessmentPilot/{$style['src']}?{$style['version']}"

Status & tagging log