r55284 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55283‎ | r55284 | r55285 >
Date:22:39, 18 August 2009
Author:catrope
Status:ok
Tags:
Comment:
wmf-deployment: Merge parts of r55269 and r55280: autodetect whether the browser supports the toolbar (includes check for IE7+RTL, which seems to be a toxic combo) and show the old toolbar if the new one is not supported.
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/images (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
11 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php:51646
/trunk/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php:52089-55192,55247,55251
22 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php:51646
/trunk/extensions/UsabilityInitiative/SimpleSearch/SimpleSearch.i18n.php:52089-55192,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
33 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php:51646
/trunk/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php:52089-55192,55247,55251
44 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php:51646
/trunk/extensions/UsabilityInitiative/UsabilityInitiative.i18n.php:52089-55192,55247,55251,55269
Index: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -1,15 +1,16 @@
22 /* JavaScript for EditToolbar extension */
33
44 js2AddOnloadHook( function() {
5 - $j( 'textarea#wpTextbox1' ).wikiEditor(
6 - { 'toolbar': editToolbarConfiguration }
7 - );
8 -});
 5+ if ( $j.wikiEditor.isSupported() ) {
 6+ // Remove the old toolbar
 7+ $j( '#toolbar' ).remove();
 8+ // Build a wikiEditor around the textarea
 9+ $j( 'textarea#wpTextbox1' ).wikiEditor( { 'toolbar': editToolbarConfiguration } );
 10+ }
 11+} );
912
1013 /**
11 - * This enormous structure is what makes the toolbar what it is. Customization
12 - * of this structure prior to the document being ready and thus executing the
13 - * initialization procedure for the toolbar will result in a custom toolbar.
 14+ * Configuration of toolbar
1415 */
1516 var editToolbarConfiguration = {
1617 // Main section
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/images
___________________________________________________________________
Name: svn:mergeinfo
1718 - /trunk/extensions/UsabilityInitiative/EditToolbar/images:54467-54593,54597,54607,54619,54625,54642,54647-54648,54662-54664,54675,54682,54715,54717,54720,54732,54738,54743,54749,54756,54758,54762,54778,54781,54786,54810-54811,55178,55247,55251
1819 + /trunk/extensions/UsabilityInitiative/EditToolbar/images:54467-54593,54597,54607,54619,54625,54642,54647-54648,54662-54664,54675,54682,54715,54717,54720,54732,54738,54743,54749,54756,54758,54762,54778,54781,54786,54810-54811,55178,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
1920 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php:51646
/trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php:52089-54882,55144-55192,55247,55251
2021 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php:51646
/trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.i18n.php:52089-54882,55144-55192,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
2122 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php:51646
/trunk/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php:52089-55192,55247,55251
2223 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php:51646
/trunk/extensions/UsabilityInitiative/OptIn/OptIn.i18n.php:52089-55192,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
2324 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php:51646
/trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php:52089-55192,55247,55251
2425 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php:51646
/trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.i18n.php:52089-55192,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
2526 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php:51646
/trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php:52089-55192,55247,55251
2627 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php:51646
/trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.i18n.php:52089-55192,55247,55251,55269
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -10,8 +10,22 @@
1111 * );
1212 * ...using the API, which is still be finished.
1313 */
14 -(function($) {
15 -$.wikiEditor = { 'modules': {}, 'instances': [] };
 14+( function( $ ) {
 15+
 16+$.wikiEditor = {
 17+ 'modules': {},
 18+ 'instances': [],
 19+ 'isSupported': function() {
 20+ function isSupported( supportedBrowsers ) {
 21+ return $.browser.name in supportedBrowsers && $.browser.versionNumber >= supportedBrowsers[$.browser.name];
 22+ }
 23+ var supportedBrowsers = {
 24+ 'ltr': { 'msie': 7, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 },
 25+ 'rtl': { 'msie': 8, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 }
 26+ };
 27+ return isSupported( supportedBrowsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'] );
 28+ }
 29+};
1630 $.fn.wikiEditor = function() {
1731
1832 /* Initialization */
@@ -116,4 +130,4 @@
117131 // Store the context for next time, and support chaining
118132 return $(this).data( 'context', context );;
119133
120 -};})(jQuery);
\ No newline at end of file
 134+};})(jQuery);
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
___________________________________________________________________
Name: svn:mergeinfo
121135 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js:51646
/trunk/extensions/LocalisationUpdate/js/plugins/jquery.wikiEditor.js:55269
/trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js:52089-54593,54597,54607,54619,54625,54642,54647-54648,54662-54664,54675,54682,54715,54717,54720,54732,54738,54743,54749,54756,54758,54762,54778,54781,54786,54810-54811,55178,55247,55251,55269,55280
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -528,8 +528,22 @@
529529 * );
530530 * ...using the API, which is still be finished.
531531 */
532 -(function($) {
533 -$.wikiEditor = { 'modules': {}, 'instances': [] };
 532+( function( $ ) {
 533+
 534+$.wikiEditor = {
 535+ 'modules': {},
 536+ 'instances': [],
 537+ 'isSupported': function() {
 538+ function isSupported( supportedBrowsers ) {
 539+ return $.browser.name in supportedBrowsers && $.browser.versionNumber >= supportedBrowsers[$.browser.name];
 540+ }
 541+ var supportedBrowsers = {
 542+ 'ltr': { 'msie': 7, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 },
 543+ 'rtl': { 'msie': 8, 'firefox': 2, 'opera': 9, 'safari': 3, 'chrome': 1, 'camino': 1 }
 544+ };
 545+ return isSupported( supportedBrowsers[$( 'body.rtl' ).size() ? 'rtl' : 'ltr'] );
 546+ }
 547+};
534548 $.fn.wikiEditor = function() {
535549
536550 /* Initialization */
@@ -634,7 +648,8 @@
635649 // Store the context for next time, and support chaining
636650 return $(this).data( 'context', context );;
637651
638 -};})(jQuery);/**
 652+};})(jQuery);
 653+/**
639654 * TOC Module for wikiEditor
640655 */
641656 (function($) { $.wikiEditor.modules.toc = {
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -40,7 +40,8 @@
4141 return($.os.name=='mac'?13:($.os.name=='linux'?15:16))*row;}
4242 return this.each(function(){$(this).focus();if(this.selectionStart||this.selectionStart=='0'){this.selectionStart=pos;this.selectionEnd=pos;$(this).scrollTop(getCaretScrollPosition(this));}else if(document.selection&&document.selection.createRange){var range=document.selection.createRange();var oldPos=$(this).getCaretPosition();var goBack=false;if(oldPos==pos){pos++;goBack=true;}
4343 range.moveToElementText(this);range.collapse();range.move('character',pos);range.select();this.scrollTop+=range.offsetTop;if(goBack){range.move('character',-1);range.select();}}
44 -$(this).trigger('scrollToPosition');});}});})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[]};$.fn.wikiEditor=function(){var context=$(this).data('context');if(typeof context!=='undefined'){arguments=$.makeArray(arguments);if(arguments.length>0){var call=arguments.shift();if(call in context.api){context.api[call](context,arguments[0]==undefined?{}:arguments[0]);}
 44+$(this).trigger('scrollToPosition');});}});})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'isSupported':function(){function isSupported(supportedBrowsers){return $.browser.name in supportedBrowsers&&$.browser.versionNumber>=supportedBrowsers[$.browser.name];}
 45+var supportedBrowsers={'ltr':{'msie':7,'firefox':2,'opera':9,'safari':3,'chrome':1,'camino':1},'rtl':{'msie':8,'firefox':2,'opera':9,'safari':3,'chrome':1,'camino':1}};return isSupported(supportedBrowsers[$('body.rtl').size()?'rtl':'ltr']);}};$.fn.wikiEditor=function(){var context=$(this).data('context');if(typeof context!=='undefined'){arguments=$.makeArray(arguments);if(arguments.length>0){var call=arguments.shift();if(call in context.api){context.api[call](context,arguments[0]==undefined?{}:arguments[0]);}
4546 return $(this).data('context',context);}
4647 return $(this);}
4748 var instance=$.wikiEditor.instances.length;context={'$textarea':$(this),'modules':{},'data':{},'instance':instance};$.wikiEditor.instances[instance]=$(this);$(this).wrap($('<div></div>').addClass('wikiEditor-ui')).wrap($('<div></div>').addClass('wikiEditor-ui-bottom')).wrap($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=$(this).parent().parent().parent();context.$ui.after($('<div style="clear:both;"></div>'));context.$ui.prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.api={addModule:function(context,data){function callModuleApi(module,call,data){if(module in $.wikiEditor.modules&&'fn'in $.wikiEditor.modules[module]&&call in $.wikiEditor.modules[module].fn){$.wikiEditor.modules[module].fn[call](context,data);}}
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php
___________________________________________________________________
Name: svn:mergeinfo
4849 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php:51646
/trunk/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php:52089-55192,55247,55251
4950 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php:51646
/trunk/extensions/UsabilityInitiative/NavigableTOC/NavigableTOC.i18n.php:52089-55192,55247,55251,55269
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative
___________________________________________________________________
Name: svn:mergeinfo
5051 - /branches/REL1_15/phase3/extensions/UsabilityInitiative:51646
/trunk/extensions/UsabilityInitiative:52089-54593,54597,54607,54619,54625,54642,54647-54648,54662-54664,54675,54682,54715,54717,54720,54732,54738,54743,54749,54756,54758,54762,54778,54781,54786,54810-54811,55178,55247,55251
5152 + /branches/REL1_15/phase3/extensions/UsabilityInitiative:51646
/trunk/extensions/LocalisationUpdate:55269
/trunk/extensions/UsabilityInitiative:52089-54593,54597,54607,54619,54625,54642,54647-54648,54662-54664,54675,54682,54715,54717,54720,54732,54738,54743,54749,54756,54758,54762,54778,54781,54786,54810-54811,55178,55247,55251,55269

Follow-up revisions

RevisionCommit summaryAuthorDate
r55285wmf-deployment: Live hack: append 'x' to the end of some style versions for r...catrope22:42, 18 August 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55269Added browser support detection. We no longer override the old toolbar unless...tparscal20:57, 18 August 2009
r55280Added direction to compatibility check, taking IE7 with RTL out of the compat...tparscal22:05, 18 August 2009

Status & tagging log