r65660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65659‎ | r65660 | r65661 >
Date:17:34, 29 April 2010
Author:tparscal
Status:ok
Tags:
Comment:
Integrated Michael Dale's patch to add a preference to the Labs section of user preferences for the AddMediaWizard, which hooks into the toolbar's file tool.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/Makefile (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard (added) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.i18n.php (added) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js (added) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.php
@@ -18,6 +18,7 @@
1919
2020 /* Configuration */
2121
 22+
2223 // Each module may be configured individually to be globally on/off or user preference based
2324 $wgWikiEditorModules = array(
2425 'toolbar' => array( 'global' => false, 'user' => true ), // Order is significant: makes beta prefs appear before labs prefs
@@ -26,6 +27,7 @@
2728 'publish' => array( 'global' => false, 'user' => true ),
2829 'toc' => array( 'global' => false, 'user' => true ),
2930 'templateEditor' => array( 'global' => false, 'user' => true ),
 31+ 'addMediaWizard' => array( 'global' => false, 'user' => false ),
3032 );
3133
3234 /* Setup */
@@ -57,6 +59,7 @@
5860 $wgExtensionMessagesFiles['WikiEditorToc'] = dirname( __FILE__ ) . '/Modules/Toc/Toc.i18n.php';
5961 $wgExtensionMessagesFiles['WikiEditorToolbar'] = dirname( __FILE__ ) . '/Modules/Toolbar/Toolbar.i18n.php';
6062 $wgExtensionMessagesFiles['WikiEditorTemplateEditor'] = dirname( __FILE__ ) . '/Modules/TemplateEditor/TemplateEditor.i18n.php';
 63+$wgExtensionMessagesFiles['WikiEditorAddMediaWizard'] = dirname( __FILE__ ) . '/Modules/AddMediaWizard/AddMediaWizard.i18n.php';
6164
6265 // Register Hooks
6366 $wgHooks['EditPageBeforeEditToolbar'][] = 'WikiEditorHooks::addModules';
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -18,6 +18,7 @@
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
2020 array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 83 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
 22+ array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ),
2223 ),
2324 'combined' => array(
2425 array( 'src' => 'WikiEditor.combined.js', 'version' => 87 ),
@@ -67,6 +68,19 @@
6869 'wikieditor-template-editor-dialog-cancel',
6970 ),
7071 ),
 72+ 'addMediaWizard' => array(
 73+ 'i18n' => 'addMediaWizard',
 74+ 'preferences' => array(
 75+ 'enable' => array(
 76+ 'key' => 'addmediawizard-gadget',
 77+ 'ui' => array(
 78+ 'type' => 'toggle',
 79+ 'label-message' => 'wikieditor-addMediaWizard-preference',
 80+ 'section' => 'editing/labs',
 81+ ),
 82+ ),
 83+ )
 84+ ),
7185 'preview' => array(
7286 'i18n' => 'WikiEditorPreview',
7387 'preferences' => array(
@@ -130,7 +144,7 @@
131145 'wikieditor-toc-show',
132146 'wikieditor-toc-hide',
133147 ),
134 - ),
 148+ ),
135149 'toolbar' => array(
136150 'i18n' => 'WikiEditorToolbar',
137151 'preferences' => array(
@@ -443,7 +457,6 @@
444458 if ( $key == 'enable' && !$enable['user'] ) {
445459 continue;
446460 }
447 -
448461 // The preference with the key 'enable' determines if the rest are even relevant, so in the future
449462 // setting up some dependencies on that might make sense
450463 $defaultPreferences[$preference['key']] = $preference['ui'];
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js
@@ -0,0 +1,10 @@
 2+
 3+/* JavaScript for AddMediaWizard gadget */
 4+
 5+if( typeof mwAddMediaConfig == 'undefined'){
 6+ mwAddMediaConfig = {};
 7+}
 8+mwAddMediaConfig['enabled_providers'] = [ 'wiki_commons', 'upload' ];
 9+
 10+// Transclude mwEmbed.js
 11+importScriptURI('http://prototype.wikimedia.org/s-2/js/mwEmbed/remotes/mediaWiki.js?&uselang=' + wgUserLanguage );
Property changes on: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js
___________________________________________________________________
Name: svn:eol-style
112 + native
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.i18n.php
@@ -0,0 +1,16 @@
 2+<?php
 3+/**
 4+ * Internationalisation for the AddMediaWizard gadget
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$messages = array();
 11+
 12+/** English
 13+ * @author Michael Dale
 14+ */
 15+$messages['en'] = array(
 16+ 'wikieditor-addMediaWizard-preference' => 'Enable Add Media Wizard Gadget',
 17+);
\ No newline at end of file
Property changes on: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/AddMediaWizard/AddMediaWizard.i18n.php
___________________________________________________________________
Name: svn:eol-style
118 + native
Index: trunk/extensions/UsabilityInitiative/Makefile
@@ -33,7 +33,7 @@
3434 js/plugins/jquery.wikiEditor.highlight.js\
3535 js/plugins/jquery.wikiEditor.preview.js\
3636 js/plugins/jquery.wikiEditor.publish.js\
37 - js/plugins/jquery.wikiEditor.templateEditor.js\
 37+ js/plugins/jquery.wikiEditor.templateEditor.js\
3838 js/plugins/jquery.wikiEditor.toc.js\
3939 js/plugins/jquery.wikiEditor.toolbar.js
4040
@@ -44,6 +44,7 @@
4545 WikiEditor/Modules/Toc/Toc.js\
4646 WikiEditor/Modules/Toolbar/Toolbar.js\
4747 WikiEditor/Modules/TemplateEditor/TemplateEditor.js
 48+ WikiEditor/Modules/AddMediaWizard/AddMediaWizard.js
4849
4950 VECTOR_MODULES := \
5051 Vector/Modules/CollapsibleNav/CollapsibleNav.js\

Follow-up revisions

RevisionCommit summaryAuthorDate
r65661* follow up to r65660 added check for wgWikiEditorEnabledModules.addMediaWizard...dale17:49, 29 April 2010
r65662Follow-up r65660: Tweak i18n for consistenxy...raymond17:52, 29 April 2010
r65763UsabilityInitiative: Various fixes...catrope21:14, 1 May 2010

Status & tagging log