r67757 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67756‎ | r67757 | r67758 >
Date:20:33, 9 June 2010
Author:adam
Status:deferred
Tags:
Comment:
Making ExpandableSearch RTL friendly.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/ExpandableSearch/ExpandableSearch.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/combined.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/combined.min.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/vector.expandableSearch.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.expandableField.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/css/vector.expandableSearch.css
@@ -1,6 +1,5 @@
22 .expandableField {
33 display: block;
4 - float: left;
54 }
65 #simpleSearch {
76 overflow: auto;
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -38,10 +38,8 @@
3939 color: WindowText;
4040 margin: 0;
4141 width: 100%;
42 -}
43 -.suggestions-result span {
4442 line-height: 1.5em;
45 - padding: 0.25em 0.25em;
 43+ padding: 0.01em 0.25em;
4644 }
4745 .suggestions-result-current {
4846 background-color: #4C59A6;
@@ -64,6 +62,9 @@
6563 .suggestions-result-current .special-query {
6664 color: white;
6765 color: HighlightText;
 66+}
 67+.autoellipsis-matched {
 68+ font-weight: bold;
6869 }/* Prototype code to show collapsing left nav options */
6970 #mw-panel.collapsible-nav div.portal {
7071 background-image:url(../images/vector/collapsibleNav/portal-break.png?1);
@@ -134,7 +135,6 @@
135136 }
136137 .expandableField {
137138 display: block;
138 - float: left;
139139 }
140140 #simpleSearch {
141141 overflow: auto;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -36,10 +36,8 @@
3737 color:WindowText;
3838 margin:0;
3939 width:100%;
40 -}
41 -.suggestions-result span{
4240 line-height:1.5em;
43 -padding:0.25em 0.25em;
 41+padding:0.01em 0.25em;
4442 }
4543 .suggestions-result-current{
4644 background-color:#4C59A6;
@@ -63,6 +61,9 @@
6462 color:white;
6563 color:HighlightText;
6664 }
 65+.autoellipsis-matched{
 66+font-weight:bold;
 67+}
6768 #mw-panel.collapsible-nav div.portal{
6869 background-image:url(../images/vector/collapsibleNav/portal-break.png?1);
6970 background-position:left top;
@@ -132,7 +133,6 @@
133134 }
134135 .expandableField{
135136 display:block;
136 -float:left;
137137 }
138138 #simpleSearch{
139139 overflow:auto;
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/ExpandableSearch/ExpandableSearch.js
@@ -38,8 +38,10 @@
3939 if ( typeof $j.collapsibleTabs != 'undefined' ){
4040 $j.collapsibleTabs.handleResize();
4141 }
42 - }
 42+ },
 43+ 'expandToLeft': ! $j( 'body' ).is( '.rtl' )
4344 } )
 45+ .css( 'float', $j( 'body' ).is( '.rtl' ) ? 'right' : 'left' )
4446 .siblings( 'button' )
45 - .css( 'float', 'right' );
 47+ .css( 'float', $j( 'body' ).is( '.rtl' ) ? 'left' : 'right' );
4648 });
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php
@@ -14,16 +14,16 @@
1515 'raw' => array(
1616 array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 25 ),
1717 array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ),
18 - array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 3 ),
 18+ array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 4 ),
1919 array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ),
2020 array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ),
2121 array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 16 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'Vector.combined.js', 'version' => 49 ),
 24+ array( 'src' => 'Vector.combined.js', 'version' => 50 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'Vector.combined.min.js', 'version' => 49 ),
 27+ array( 'src' => 'Vector.combined.min.js', 'version' => 50 ),
2828 ),
2929 );
3030 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -380,10 +380,12 @@
381381 if ( typeof $j.collapsibleTabs != 'undefined' ){
382382 $j.collapsibleTabs.handleResize();
383383 }
384 - }
 384+ },
 385+ 'expandToLeft': ! $j( 'body' ).is( '.rtl' )
385386 } )
 387+ .css( 'float', $j( 'body' ).is( '.rtl' ) ? 'right' : 'left' )
386388 .siblings( 'button' )
387 - .css( 'float', 'right' );
 389+ .css( 'float', $j( 'body' ).is( '.rtl' ) ? 'left' : 'right' );
388390 });
389391 /* Prototype code to demonstrate proposed edit page footer cleanups */
390392 /* First draft and will be changing greatly */
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js
@@ -19,7 +19,7 @@
2020 if(fallbackResult!==undefined){return fallbackResult;}
2121 if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return mw.usability.getMsg('vector-editwarning-warning');}}
2222 $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;$j(document).ready(function(){if(!wgVectorEnabledModules.expandablesearch||skin!='vector'){return true;}
23 -$j('#searchInput').expandableField({'beforeExpand':function(context){$j(this).parent().animate({'borderTopColor':'#a0d8ff','borderLeftColor':'#a0d8ff','borderRightColor':'#a0d8ff','borderBottomColor':'#a0d8ff'},'fast');},'beforeCondense':function(context){$j(this).parent().animate({'borderTopColor':'#aaaaaa','borderLeftColor':'#aaaaaa','borderRightColor':'#aaaaaa','borderBottomColor':'#aaaaaa'},'fast');},'afterExpand':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'afterCondense':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}}}).siblings('button').css('float','right');});$j(document).ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
 23+$j('#searchInput').expandableField({'beforeExpand':function(context){$j(this).parent().animate({'borderTopColor':'#a0d8ff','borderLeftColor':'#a0d8ff','borderRightColor':'#a0d8ff','borderBottomColor':'#a0d8ff'},'fast');},'beforeCondense':function(context){$j(this).parent().animate({'borderTopColor':'#aaaaaa','borderLeftColor':'#aaaaaa','borderRightColor':'#aaaaaa','borderBottomColor':'#aaaaaa'},'fast');},'afterExpand':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'afterCondense':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'expandToLeft':!$j('body').is('.rtl')}).css('float',$j('body').is('.rtl')?'right':'left').siblings('button').css('float',$j('body').is('.rtl')?'left':'right');});$j(document).ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;}
2424 $j('#editpage-copywarn').add('.editOptions').wrapAll('<div id="editpage-bottom"></div>');$j('#wpSummary').data('hint',$j('#wpSummaryLabel span small').remove().text().replace(/\)|\(/g,'')).change(function(){if($j(this).val().length==0){$j(this).addClass('inline-hint').val($j(this).data('hint'));}else{$j(this).removeClass('inline-hint');}}).focus(function(){if($j(this).val()==$j(this).data('hint')){$j(this).removeClass('inline-hint').val("");}}).blur(function(){$j(this).trigger('change');}).trigger('change');$j('#wpSummary').add('.editCheckboxes').wrapAll('<div id="editpage-summary-fields"></div>');$j('#editpage-specialchars').remove();var transclusionCount=$j('.templatesUsed ul li').size();$j('.templatesUsed ul').wrap('<div id="transclusions-list" class="collapsible-list collapsed"></div>').parent().prepend('<label>This page contains <a href="http://en.wikipedia.org/wiki/transclusion">transclusions</a> of <strong>'
2525 +transclusionCount
2626 +'</strong> other pages.</label>');$j('.mw-templatesUsedExplanation').remove();$j('.collapsible-list label').click(function(){$j(this).parent().toggleClass('expanded').toggleClass('collapsed').find('ul').slideToggle('fast');return false;}).trigger('click');$j('#wpPreview, #wpDiff, .editHelp, #editpage-specialchars').remove();$j('#mw-editform-cancel').remove().appendTo('.editButtons');});if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];}
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -20,7 +20,7 @@
2121 'raw' => array(
2222 array( 'src' => 'css/suggestions.css', 'version' => 15 ),
2323 array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 12 ),
24 - array( 'src' => 'css/vector.expandableSearch.css', 'version' => 3 ),
 24+ array( 'src' => 'css/vector.expandableSearch.css', 'version' => 4 ),
2525 array( 'src' => 'css/vector.footerCleanup.css', 'version' => 2 ),
2626 array( 'src' => 'css/wikiEditor.css', 'version' => 14 ),
2727 array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 29 ),
@@ -30,11 +30,11 @@
3131 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3232 ),
3333 'combined' => array(
34 - array( 'src' => 'css/combined.css', 'version' => 102 ),
 34+ array( 'src' => 'css/combined.css', 'version' => 103 ),
3535 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3636 ),
3737 'minified' => array(
38 - array( 'src' => 'css/combined.min.css', 'version' => 102 ),
 38+ array( 'src' => 'css/combined.min.css', 'version' => 103 ),
3939 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
4040 ),
4141 )
@@ -72,7 +72,7 @@
7373 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
7474 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
7575 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 18 ),
76 - array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 16 ),
 76+ array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 17 ),
7777 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 22 ),
7878 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 35 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 193 ),
@@ -89,10 +89,10 @@
9090 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 2 ),
9191 ),
9292 'combined' => array(
93 - array( 'src' => 'js/plugins.combined.js', 'version' => 423 ),
 93+ array( 'src' => 'js/plugins.combined.js', 'version' => 424 ),
9494 ),
9595 'minified' => array(
96 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 423 ),
 96+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 424 ),
9797 ),
9898 ),
9999 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.expandableField.js
@@ -73,7 +73,9 @@
7474 // callback function for after collapse
7575 'afterCondense': function( context ) {},
7676 // callback function for after expand
77 - 'afterExpand': function( context ) {}
 77+ 'afterExpand': function( context ) {},
 78+ // Whether the field should expand to the left or the right -- defaults to left
 79+ 'expandToLeft': true
7880 }
7981 };
8082 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5949,7 +5949,9 @@
59505950 // callback function for after collapse
59515951 'afterCondense': function( context ) {},
59525952 // callback function for after expand
5953 - 'afterExpand': function( context ) {}
 5953+ 'afterExpand': function( context ) {},
 5954+ // Whether the field should expand to the left or the right -- defaults to left
 5955+ 'expandToLeft': true
59545956 }
59555957 };
59565958 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -396,7 +396,7 @@
397397 $.fn.extend({delayedBind:function(timeout,event,data,callback){var encEvent=encodeEvent(event);return this.each(function(){var that=this;if(!($(this).data('_delayedBindBound-'+encEvent+'-'+timeout))){$(this).data('_delayedBindBound-'+encEvent+'-'+timeout,true);$(this).bind(event,function(){var timerID=$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout);if(typeof timerID!='undefined')
398398 clearTimeout(timerID);timerID=setTimeout(function(){$(that).trigger('_delayedBind-'+encEvent+'-'+timeout);},timeout);$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout,timerID);});}
399399 $(this).bind('_delayedBind-'+encEvent+'-'+timeout,data,callback);});},delayedBindCancel:function(timeout,event){var encEvent=encodeEvent(event);return this.each(function(){var timerID=$(this).data('_delayedBindTimerID-'+encEvent+'-'+timeout);if(typeof timerID!='undefined')
400 -clearTimeout(timerID);});},delayedBindUnbind:function(timeout,event,callback){var encEvent=encodeEvent(event);return this.each(function(){$(this).unbind('_delayedBind-'+encEvent+'-'+timeout,callback);});}});})(jQuery);(function($){$.expandableField={expandField:function(e,context){context.config.beforeExpand.call(context.data.$field,context);context.data.$field.animate({'width':context.data.expandedWidth},'fast',function(){context.config.afterExpand.call(this,context);});},condenseField:function(e,context){context.config.beforeCondense.call(context.data.$field,context);context.data.$field.animate({'width':context.data.condensedWidth},'fast',function(){context.config.afterCondense.call(this,context);});},configure:function(context,property,value){switch(property){default:context.config[property]=value;break;}}};$.fn.expandableField=function(){var returnValue=null;var args=arguments;$(this).each(function(){var context=$(this).data('expandableField-context');if(context==null){context={config:{'beforeCondense':function(context){},'beforeExpand':function(context){},'afterCondense':function(context){},'afterExpand':function(context){}}};}
 400+clearTimeout(timerID);});},delayedBindUnbind:function(timeout,event,callback){var encEvent=encodeEvent(event);return this.each(function(){$(this).unbind('_delayedBind-'+encEvent+'-'+timeout,callback);});}});})(jQuery);(function($){$.expandableField={expandField:function(e,context){context.config.beforeExpand.call(context.data.$field,context);context.data.$field.animate({'width':context.data.expandedWidth},'fast',function(){context.config.afterExpand.call(this,context);});},condenseField:function(e,context){context.config.beforeCondense.call(context.data.$field,context);context.data.$field.animate({'width':context.data.condensedWidth},'fast',function(){context.config.afterCondense.call(this,context);});},configure:function(context,property,value){switch(property){default:context.config[property]=value;break;}}};$.fn.expandableField=function(){var returnValue=null;var args=arguments;$(this).each(function(){var context=$(this).data('expandableField-context');if(context==null){context={config:{'beforeCondense':function(context){},'beforeExpand':function(context){},'afterCondense':function(context){},'afterExpand':function(context){},'expandToLeft':true}};}
401401 if(args.length>0){if(typeof args[0]=='object'){for(var key in args[0]){$.expandableField.configure(context,key,args[0][key]);}}else if(typeof args[0]=='string'){if(args.length>1){$.expandableField.configure(context,args[0],args[1]);}else if(returnValue==null){returnValue=(args[0]in context.config?undefined:context.config[args[0]]);}}}
402402 if(typeof context.data=='undefined'){context.data={'condensedWidth':$(this).width(),'expandedWidth':$(this).width()*2,'$field':$(this)};$(this).addClass('expandableField').focus(function(e){$.expandableField.expandField(e,context);}).delayedBind(250,'blur',function(e){$.expandableField.condenseField(e,context);});}
403403 $(this).data('expandableField-context',context);});return returnValue!==null?returnValue:$(this);};})(jQuery);(function($){$.suggestions={cancel:function(context){if(context.data.timerID!=null){clearTimeout(context.data.timerID);}

Status & tagging log