r99212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99211‎ | r99212 | r99213 >
Date:14:15, 7 October 2011
Author:siebrand
Status:deferred
Tags:
Comment:
stylize.php
Modified paths:
  • /trunk/extensions/ApiExplorer/ApiExplorer.i18n.php (modified) (history)
  • /trunk/extensions/ApiExplorer/SpecialApiExplorer.php (modified) (history)
  • /trunk/extensions/ApiExplorer/apiExplorer.css (modified) (history)
  • /trunk/extensions/ApiExplorer/apiExplorer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiExplorer/SpecialApiExplorer.php
@@ -12,7 +12,7 @@
1313 * handle all functions.
1414 */
1515
16 -if (!defined('MEDIAWIKI')) die();
 16+if ( !defined( 'MEDIAWIKI' ) ) die();
1717
1818 $wgExtensionFunctions[] = 'wfSpecialApiExplorer';
1919 $wgExtensionCredits['specialpage'][] = array(
@@ -23,7 +23,7 @@
2424 'author' => '[http://seancolombo.com Sean Colombo]'
2525 );
2626
27 -$dir = dirname(__FILE__) . '/';
 27+$dir = dirname( __FILE__ ) . '/';
2828 $wgExtensionMessagesFiles['ApiExplorer'] = $dir . 'ApiExplorer.i18n.php';
2929
3030 function wfSpecialApiExplorer () {
@@ -52,7 +52,7 @@
5353
5454 // TODO: Make this work for ResourceLoader (Wikia isn't using RL yet at the time of this writing).
5555 // Wikia has the cachebuster in the wgExtensionPath (we rewrite that in varnish because many proxies won't cache things that have "?" in the URL), but other MediaWikis need the style-version in the querystring.
56 - $cbSuffix = ( isset($wgCityId) ? "?{$wgStyleVersion}" : "" );
 56+ $cbSuffix = ( isset( $wgCityId ) ? "?{$wgStyleVersion}" : "" );
5757 $wgOut->addScript( "<script type=\"text/javascript\" src=\"{$wgExtensionsPath}/wikia/JavascriptAPI/Mediawiki.js{$cbSuffix}\"></script>" );
5858 $wgOut->addScript( "<script type=\"text/javascript\" src=\"{$wgExtensionsPath}/ApiExplorer/apiExplorer.js{$cbSuffix}\"></script>" );
5959 $wgOut->addScript( "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$wgExtensionsPath}/ApiExplorer/apiExplorer.css{$cbSuffix}\" />" );
@@ -60,7 +60,7 @@
6161 ob_start();
6262 $buttonHeight = 15;
6363 $collapseSrc = "$wgExtensionsPath/ApiExplorer/collapse.png$cbSuffix";
64 - $expandSrc = "$wgExtensionsPath/ApiExplorer/collapse.png$cbSuffix";
 64+ $expandSrc = "$wgExtensionsPath/ApiExplorer/collapse.png$cbSuffix";
6565 ?><style>
6666 .collapsible h2 span, .collapsible h3 span{
6767 width:<?= $buttonHeight ?>px;
@@ -82,8 +82,8 @@
8383 <div id='apEx_loading'><?= wfMsg('apiexplorer-loading') ?></div>
8484 <div id='apEx'>
8585 <?php
86 - $params = array("modules", "querymodules", "formatmodules");
87 - foreach($params as $param){
 86+ $params = array( "modules", "querymodules", "formatmodules" );
 87+ foreach ( $params as $param ) {
8888 ?><div class='<?= $param ?> collapsible collapsed paramName' data-param-name='<?= $param ?>'>
8989 <h2 class='name'><span class='toggleIcon'></span></h2>
9090 <div class='paramContent'>
Index: trunk/extensions/ApiExplorer/apiExplorer.css
@@ -48,7 +48,7 @@
4949 -webkit-border-radius: 10px;
5050 -moz-border-radius: 10px;
5151 border-radius: 10px;
52 -
 52+
5353 /* Not collapsed... so hide the bottom border so it bleeds into the rest */
5454 border-bottom:0px;
5555 border-bottom-left-radius:0px;
@@ -68,7 +68,7 @@
6969 background-image: -o-linear-gradient(top, #2C85D6 0%, #00396D 100%);
7070 background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #2C85D6), color-stop(1, #00396D));
7171 background-image: -webkit-linear-gradient(top, #2C85D6 0%, #00396D 100%);
72 - background-image: linear-gradient(top, #2C85D6 0%, #00396D 100%);
 72+ background-image: linear-gradient(top, #2C85D6 0%, #00396D 100%);
7373
7474 color:white;
7575 }
Index: trunk/extensions/ApiExplorer/apiExplorer.js
@@ -17,7 +17,7 @@
1818 */
1919 this.run = function(){
2020 $().log("Starting API Explorer...");
21 -
 21+
2222 // Show the loading indicator until the API request has returned & the new page-content is set-up.
2323 $('#apEx_loading').show();
2424
@@ -99,7 +99,7 @@
100100 $().log(err);
101101 });
102102 };
103 -
 103+
104104 /**
105105 * Converts a JS object to HTML (mostly nested lists), but tweaked for the specific use-case of
106106 * the API Explorer's results from the API... so it will make the result more readable, but this function
Index: trunk/extensions/ApiExplorer/ApiExplorer.i18n.php
@@ -14,7 +14,7 @@
1515 'apiexplorer' => 'API Explorer',
1616 'apiexplorer-desc' => 'Page for interactively exploring the documentation of the live version of the MediaWiki API running on this installation.',
1717 'apiexplorer-intro' => "This page shows documentation for the current wiki's API. Please click on a function below to see more info about what parameters can be used in each call. For the general MediaWiki API documentation, see $1",
18 -
 18+
1919 'apiexplorer-loading' => 'Loading functions...',
2020 );
2121

Status & tagging log