r51189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51188‎ | r51189 | r51190 >
Date:10:26, 30 May 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* updated 'toolbar-preference' message
* added version in extension credits
* update indentation, stylize.php
* bumped versions
* added suggestion to license 'GPL v2 or later'
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.i18n.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php
@@ -14,4 +14,4 @@
1515 $messages['en'] = array(
1616 'usabilityinitiative' => 'Usability Initiative',
1717 'usabilityinitiative-desc' => 'Features developed by the Wikipedia Usability Initiative to enhance the usability of MediaWiki',
18 -);
\ No newline at end of file
 18+);
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.php
@@ -12,8 +12,9 @@
1313 * require_once( "$IP/extensions/UsabilityInitiative/UsabilityInitiative.php" );
1414 *
1515 * @author Trevor Parscal <tparscal@wikimedia.org>
 16+ * Allow "or a later version" here?
1617 * @license GPL v2
17 - * @version 0.1.0
 18+ * @version 0.1.1
1819 */
1920 /* Configuration */
2021
@@ -22,6 +23,7 @@
2324 'path' => __FILE__,
2425 'name' => 'UsabilityInitiative',
2526 'author' => 'Trevor Parscal',
 27+ 'version' => '0.1.1',
2628 'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative',
2729 'descriptionmsg' => 'usabilityinitiative-desc',
2830 );
@@ -30,15 +32,12 @@
3133 $dir = dirname( __FILE__ );
3234
3335 // Autoload Classes
34 -$wgAutoloadClasses['UsabilityInitiativeHooks'] =
35 - "$dir/UsabilityInitiative.hooks.php";
 36+$wgAutoloadClasses['UsabilityInitiativeHooks'] = "$dir/UsabilityInitiative.hooks.php";
 37+$wgExtensionMessagesFiles['UsabilityInitiative'] = "$dir/UsabilityInitiative.i18n.php";
3638
37 -$wgExtensionMessagesFiles['UsabilityInitiative'] =
38 - "$dir/UsabilityInitiative.i18n.php";
39 -
4039 // Register ajax add script hook
4140 $wgHooks['AjaxAddScript'][] = 'UsabilityInitiativeHooks::addJS';
4241
4342 /* Components */
4443
45 -require_once( "$dir/Toolbar/Toolbar.php" );
\ No newline at end of file
 44+require_once( "$dir/Toolbar/Toolbar.php" );
Index: trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.i18n.php
@@ -14,5 +14,5 @@
1515 $messages['en'] = array(
1616 'toolbar' => 'Toolbar',
1717 'toolbar-desc' => 'Edit page toolbar with enhanced usability',
18 - 'toolbar-preference' => 'Enable beta version of new editing toolbar',
19 -);
\ No newline at end of file
 18+ 'toolbar-preference' => 'Enable enhanced editing toolbar',
 19+);
Index: trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.php
@@ -11,8 +11,9 @@
1212 * Usage: This file is included automatically by ../UsabilityInitiative.php
1313 *
1414 * @author Trevor Parscal <tparscal@wikimedia.org>
 15+ * Allow "or a later version" here?
1516 * @license GPL v2
16 - * @version 0.1.0
 17+ * @version 0.1.1
1718 */
1819
1920 // Shortcut to this extension directory
@@ -25,6 +26,7 @@
2627 'path' => __FILE__,
2728 'name' => 'Toolbar',
2829 'author' => 'Trevor Parscal',
 30+ 'version' => '0.1.1',
2931 'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative',
3032 'descriptionmsg' => 'toolbar-desc',
3133 );
Index: trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.hooks.php
@@ -14,26 +14,21 @@
1515 * EditPageBeforeEditToolbar hook
1616 * Intercept the display of the toolbar, replacing the content of $toolbar
1717 */
18 - public static function interceptToolbar(
19 - &$toolbar
20 - ) {
 18+ public static function interceptToolbar( &$toolbar ) {
2119 global $wgUser;
22 -
23 - if ( $wgUser->getOption('usebetatoolbar') ) {
 20+
 21+ if ( $wgUser->getOption( 'usebetatoolbar' ) ) {
2422 $toolbar = '<div id="editing-toolbar"></div>';
2523 }
2624 // Continue
2725 return true;
2826 }
29 -
 27+
3028 /**
3129 * GetPreferences hook
3230 * Add toolbar related items to the preferences
3331 */
34 - public static function addPreferences(
35 - $user,
36 - $defaultPreferences
37 - ) {
 32+ public static function addPreferences( $user, $defaultPreferences ) {
3833 wfLoadExtensionMessages( 'Toolbar' );
3934 $defaultPreferences['usebetatoolbar'] =
4035 array(
@@ -43,15 +38,12 @@
4439 );
4540 return true;
4641 }
47 -
48 -
 42+
4943 /**
5044 * AjaxAddScript hook
5145 * Add ajax support script
5246 */
53 - public static function addJS(
54 - $out
55 - ) {
 47+ public static function addJS( $out ) {
5648 global $wgScriptPath, $wgJsMimeType, $wgToolbarStyleVersion;
5749 // Add javascript version variable
5850 $out->addInlineScript(
@@ -79,9 +71,7 @@
8072 * BeforePageDisplay hook
8173 * Add css style sheet
8274 */
83 - public static function addCSS(
84 - $out
85 - ) {
 75+ public static function addCSS( $out ) {
8676 global $wgScriptPath, $wgToolbarStyleVersion;
8777 // Add css for various styles
8878 $out->addLink(
@@ -96,5 +86,4 @@
9787 // Continue
9888 return true;
9989 }
100 -
10190 }
Index: trunk/extensions/UsabilityInitiative/Toolbar/Toolbar.js
@@ -33,4 +33,4 @@
3434 toolDiv.css( 'background-image', 'url(' + imageUrl + tools[group][tool]['icon'] + ')' );
3535 }
3636 }
37 -});
\ No newline at end of file
 37+});
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -14,9 +14,7 @@
1515 * AjaxAddScript hook
1616 * Add ajax support script
1717 */
18 - public static function addJS(
19 - $out
20 - ) {
 18+ public static function addJS( $out ) {
2119 global $wgScriptPath, $wgJsMimeType;
2220 // Add javascript resources to document
2321 $out->addScript(
@@ -34,4 +32,4 @@
3533 // Continue
3634 return true;
3735 }
38 -}
\ No newline at end of file
 36+}

Status & tagging log