r66643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66642‎ | r66643 | r66644 >
Date:17:51, 19 May 2010
Author:adam
Status:ok
Tags:
Comment:
Followup to r66642. Removing console code and a spelling mistake
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (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.suggestions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,7 +72,7 @@
7373 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 16 ),
7575 array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 15 ),
76 - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 17 ),
 76+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 18 ),
7777 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 33 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 187 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
@@ -85,10 +85,10 @@
8686 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8787 ),
8888 'combined' => array(
89 - array( 'src' => 'js/plugins.combined.js', 'version' => 399 ),
 89+ array( 'src' => 'js/plugins.combined.js', 'version' => 400 ),
9090 ),
9191 'minified' => array(
92 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 399 ),
 92+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 400 ),
9393 ),
9494 ),
9595 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js
@@ -36,7 +36,7 @@
3737 * maxExpandFactor: Maximum suggestions box width relative to the textbox width. If set to e.g. 2, the suggestions box
3838 * will never be grown beyond 2 times the width of the textbox.
3939 * Type: Number, Range: 1 - infinity, Default: 2
40 - * positionFromLeft: Wether to position the suggestion box with the left attribute or the right
 40+ * positionFromLeft: Whether to position the suggestion box with the left attribute or the right
4141 * Type: Boolean, Default: true
4242 */
4343 ( function( $ ) {
@@ -134,11 +134,9 @@
135135 'height': 'auto'
136136 }
137137 if ( context.config.positionFromLeft ) {
138 - console.log("LEFT");
139138 newCSS['left'] = context.config.$region.offset().left;
140139 newCSS['right'] = 'auto';
141140 } else {
142 - console.log("right");
143141 newCSS['left'] = 'auto';
144142 newCSS['right'] = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
145143 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5793,7 +5793,7 @@
57945794 * maxExpandFactor: Maximum suggestions box width relative to the textbox width. If set to e.g. 2, the suggestions box
57955795 * will never be grown beyond 2 times the width of the textbox.
57965796 * Type: Number, Range: 1 - infinity, Default: 2
5797 - * positionFromLeft: Wether to position the suggestion box with the left attribute or the right
 5797+ * positionFromLeft: Whether to position the suggestion box with the left attribute or the right
57985798 * Type: Boolean, Default: true
57995799 */
58005800 ( function( $ ) {
@@ -5891,11 +5891,9 @@
58925892 'height': 'auto'
58935893 }
58945894 if ( context.config.positionFromLeft ) {
5895 - console.log("LEFT");
58965895 newCSS['left'] = context.config.$region.offset().left;
58975896 newCSS['right'] = 'auto';
58985897 } else {
5899 - console.log("right");
59005898 newCSS['left'] = 'auto';
59015899 newCSS['right'] = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
59025900 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -396,7 +396,7 @@
397397 if(context.data.timerID!=null){clearTimeout(context.data.timerID);}
398398 if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();}
399399 $.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(context.data.$textbox.val().length==0){context.data.$container.hide();}else{context.data.$container.show();var newCSS={'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto'}
400 -if(context.config.positionFromLeft){console.log("LEFT");newCSS['left']=context.config.$region.offset().left;newCSS['right']='auto';}else{console.log("right");newCSS['left']='auto';newCSS['right']=$('body').width()-(context.config.$region.offset().left+context.config.$region.outerWidth());}
 400+if(context.config.positionFromLeft){newCSS['left']=context.config.$region.offset().left;newCSS['right']='auto';}else{newCSS['left']='auto';newCSS['right']=$('body').width()-(context.config.$region.offset().left+context.config.$region.outerWidth());}
401401 context.data.$container.css(newCSS);var $results=context.data.$container.children('.suggestions-results');$results.empty();var expWidth=-1;var $autoEllipseMe=$([]);for(var i=0;i<context.config.suggestions.length;i++){var $result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).mouseover(function(e){$.suggestions.highlight(context,$(this).closest('.suggestions-results div'),false);}).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.append($('<span />').css('whiteSpace','nowrap').text(context.config.suggestions[i]));var $span=$result.children('span');if($span.width()>$result.width()){expWidth=Math.max(expWidth,Math.min($span.width(),context.data.$textbox.width()*context.config.maxExpandFactor));}
402402 $autoEllipseMe=$autoEllipseMe.add($result);}}
403403 if(expWidth!=-1){context.data.$container.width(expWidth);}

Follow-up revisions

RevisionCommit summaryAuthorDate
r667081.16wmf4: Merge SimpleSearch fixes from trunk: r66565, rr66623, r66631, r6664...catrope21:00, 20 May 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66642Improvements to SimpleSearch. Adding an option to switch between right/left o...adam17:48, 19 May 2010

Status & tagging log