r65046 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65045‎ | r65046 | r65047 >
Date:09:09, 15 April 2010
Author:adam
Status:ok (Comments)
Tags:
Comment:
Fix for bug 23110 - Ensuring that the ellipsised text is never placed in the search box, and fixing a problem with the rollover on special suggestions looking different depedning on the user interaction which caused it to be active
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.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/suggestions.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.suggestions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/css/suggestions.css
@@ -23,15 +23,6 @@
2424 padding: 0.25em 0.25em;
2525 line-height: 1.25em;
2626 }
27 -.suggestions-special:hover {
28 - background-color: #4C59A6;
29 - background-color: Highlight;
30 -}
31 -.suggestions-special:hover .special-label,
32 -.suggestions-special:hover .special-query {
33 - color: white;
34 - color: HighlightText;
35 -}
3627 .suggestions-results {
3728 background-color: white;
3829 background-color: Window;
@@ -58,3 +49,19 @@
5950 color: white;
6051 color: HighlightText;
6152 }
 53+.suggestions-special .special-label {
 54+ font-size: 0.8em;
 55+ color: gray;
 56+}
 57+.suggestions-special .special-query {
 58+ color: black;
 59+ font-style: italic;
 60+}
 61+.suggestions-special .special-hover {
 62+ background-color: silver;
 63+}
 64+.suggestions-result-current .special-label,
 65+.suggestions-result-current .special-query {
 66+ color: white !important;
 67+ color: HighlightText !important;
 68+}
\ No newline at end of file
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -23,15 +23,6 @@
2424 padding: 0.25em 0.25em;
2525 line-height: 1.25em;
2626 }
27 -.suggestions-special:hover {
28 - background-color: #4C59A6;
29 - background-color: Highlight;
30 -}
31 -.suggestions-special:hover .special-label,
32 -.suggestions-special:hover .special-query {
33 - color: white;
34 - color: HighlightText;
35 -}
3627 .suggestions-results {
3728 background-color: white;
3829 background-color: Window;
@@ -58,7 +49,22 @@
5950 color: white;
6051 color: HighlightText;
6152 }
62 -/* Prototype code to show collapsing left nav options */
 53+.suggestions-special .special-label {
 54+ font-size: 0.8em;
 55+ color: gray;
 56+}
 57+.suggestions-special .special-query {
 58+ color: black;
 59+ font-style: italic;
 60+}
 61+.suggestions-special .special-hover {
 62+ background-color: silver;
 63+}
 64+.suggestions-result-current .special-label,
 65+.suggestions-result-current .special-query {
 66+ color: white !important;
 67+ color: HighlightText !important;
 68+}/* Prototype code to show collapsing left nav options */
6369 #panel.collapsible-nav div.portal {
6470 background-image:url(../images/vector/collapsibleNav/portal-break.png);
6571 background-position:left top;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -21,15 +21,6 @@
2222 padding:0.25em 0.25em;
2323 line-height:1.25em;
2424 }
25 -.suggestions-special:hover{
26 -background-color:#4C59A6;
27 -background-color:Highlight;
28 -}
29 -.suggestions-special:hover .special-label,
30 -.suggestions-special:hover .special-query{
31 -color:white;
32 -color:HighlightText;
33 -}
3425 .suggestions-results{
3526 background-color:white;
3627 background-color:Window;
@@ -56,6 +47,22 @@
5748 color:white;
5849 color:HighlightText;
5950 }
 51+.suggestions-special .special-label{
 52+font-size:0.8em;
 53+color:gray;
 54+}
 55+.suggestions-special .special-query{
 56+color:black;
 57+font-style:italic;
 58+}
 59+.suggestions-special .special-hover{
 60+background-color:silver;
 61+}
 62+.suggestions-result-current .special-label,
 63+.suggestions-result-current .special-query{
 64+color:white !important;
 65+color:HighlightText !important;
 66+}
6067 #panel.collapsible-nav div.portal{
6168 background-image:url(../images/vector/collapsibleNav/portal-break.png);
6269 background-position:left top;
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -18,7 +18,7 @@
1919 private static $styleFiles = array(
2020 'base_sets' => array(
2121 'raw' => array(
22 - array( 'src' => 'css/suggestions.css', 'version' => 10 ),
 22+ array( 'src' => 'css/suggestions.css', 'version' => 11 ),
2323 array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 7 ),
2424 array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ),
2525 array( 'src' => 'css/wikiEditor.css', 'version' => 12 ),
@@ -29,11 +29,11 @@
3030 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3131 ),
3232 'combined' => array(
33 - array( 'src' => 'css/combined.css', 'version' => 85 ),
 33+ array( 'src' => 'css/combined.css', 'version' => 86 ),
3434 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3535 ),
3636 'minified' => array(
37 - array( 'src' => 'css/combined.min.css', 'version' => 85 ),
 37+ array( 'src' => 'css/combined.min.css', 'version' => 86 ),
3838 array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ),
3939 ),
4040 )
@@ -70,7 +70,7 @@
7171 array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ),
7272 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
7373 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
74 - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 10 ),
 74+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 11 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 30 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 181 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 382 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 383 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 382 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 383 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js
@@ -90,12 +90,6 @@
9191 setTimeout( function() {
9292 // Render special
9393 $special = context.data.$container.find( '.suggestions-special' );
94 - // Only hook this up the first time
95 - if ( $special.children().length == 0 ) {
96 - $special.mousemove( function() {
97 - $.suggestions.highlight( context, $( [] ), false );
98 - } );
99 - }
10094 context.config.special.render.call( $special, context.data.$textbox.val() );
10195 }, 1 );
10296 }
@@ -188,7 +182,6 @@
189183 } else {
190184 result = context.data.$container.find( '.suggestions-results div:last' );
191185 }
192 -
193186 }
194187 }
195188 } else if ( result == 'next' ) {
@@ -198,7 +191,7 @@
199192 else {
200193 result = selected.next();
201194 if ( selected.is( '.suggestions-special' ) ) {
202 - result = [];
 195+ result = $( [] );
203196 } else if ( result.size() == 0 && context.data.$container.find( '.suggestions-special' ).html() != "" ) {
204197 // We were at the last item, jump to the specials!
205198 result = context.data.$container.find( '.suggestions-special' );
@@ -217,6 +210,7 @@
218211 // let the world know what happened
219212 context.data.$textbox.change();
220213 }
 214+ context.data.$textbox.trigger( 'change' );
221215 }
222216 $.suggestions.special( context );
223217 },
@@ -235,7 +229,6 @@
236230 } else {
237231 $.suggestions.update( context, false );
238232 }
239 - context.data.$textbox.trigger( 'change' );
240233 preventDefault = true;
241234 break;
242235 // Arrow up
@@ -243,7 +236,6 @@
244237 if ( wasVisible ) {
245238 $.suggestions.highlight( context, 'prev', false );
246239 }
247 - context.data.$textbox.trigger( 'change' );
248240 preventDefault = wasVisible;
249241 break;
250242 // Escape
@@ -265,7 +257,7 @@
266258 }
267259 } else {
268260 if ( typeof context.config.result.select == 'function' ) {
269 - context.data.$textbox.val( selected.text() );
 261+ $.suggestions.highlight( context, selected, true );
270262 context.config.result.select.call( selected, context.data.$textbox );
271263 }
272264 }
@@ -341,9 +333,6 @@
342334 'mouseDownOn': $( [] ),
343335 '$textbox': $(this)
344336 };
345 - context.data.$textbox.mousemove( function() {
346 - $.suggestions.highlight( context, $( [] ), false );
347 - } );
348337 context.data.$container = $( '<div />' )
349338 .css( {
350339 'top': Math.round( context.data.$textbox.offset().top + context.data.$textbox.outerHeight() ),
@@ -394,6 +383,11 @@
395384 }
396385 context.data.$textbox.focus();
397386 } )
 387+ .mouseover( function( e ) {
 388+ $.suggestions.highlight(
 389+ context, $( e.target ).closest( '.suggestions-special' ), false
 390+ );
 391+ } )
398392 )
399393 .appendTo( $( 'body' ) );
400394 $(this)
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5841,12 +5841,6 @@
58425842 setTimeout( function() {
58435843 // Render special
58445844 $special = context.data.$container.find( '.suggestions-special' );
5845 - // Only hook this up the first time
5846 - if ( $special.children().length == 0 ) {
5847 - $special.mousemove( function() {
5848 - $.suggestions.highlight( context, $( [] ), false );
5849 - } );
5850 - }
58515845 context.config.special.render.call( $special, context.data.$textbox.val() );
58525846 }, 1 );
58535847 }
@@ -5939,7 +5933,6 @@
59405934 } else {
59415935 result = context.data.$container.find( '.suggestions-results div:last' );
59425936 }
5943 -
59445937 }
59455938 }
59465939 } else if ( result == 'next' ) {
@@ -5949,7 +5942,7 @@
59505943 else {
59515944 result = selected.next();
59525945 if ( selected.is( '.suggestions-special' ) ) {
5953 - result = [];
 5946+ result = $( [] );
59545947 } else if ( result.size() == 0 && context.data.$container.find( '.suggestions-special' ).html() != "" ) {
59555948 // We were at the last item, jump to the specials!
59565949 result = context.data.$container.find( '.suggestions-special' );
@@ -5968,6 +5961,7 @@
59695962 // let the world know what happened
59705963 context.data.$textbox.change();
59715964 }
 5965+ context.data.$textbox.trigger( 'change' );
59725966 }
59735967 $.suggestions.special( context );
59745968 },
@@ -5986,7 +5980,6 @@
59875981 } else {
59885982 $.suggestions.update( context, false );
59895983 }
5990 - context.data.$textbox.trigger( 'change' );
59915984 preventDefault = true;
59925985 break;
59935986 // Arrow up
@@ -5994,7 +5987,6 @@
59955988 if ( wasVisible ) {
59965989 $.suggestions.highlight( context, 'prev', false );
59975990 }
5998 - context.data.$textbox.trigger( 'change' );
59995991 preventDefault = wasVisible;
60005992 break;
60015993 // Escape
@@ -6016,7 +6008,7 @@
60176009 }
60186010 } else {
60196011 if ( typeof context.config.result.select == 'function' ) {
6020 - context.data.$textbox.val( selected.text() );
 6012+ $.suggestions.highlight( context, selected, true );
60216013 context.config.result.select.call( selected, context.data.$textbox );
60226014 }
60236015 }
@@ -6092,9 +6084,6 @@
60936085 'mouseDownOn': $( [] ),
60946086 '$textbox': $(this)
60956087 };
6096 - context.data.$textbox.mousemove( function() {
6097 - $.suggestions.highlight( context, $( [] ), false );
6098 - } );
60996088 context.data.$container = $( '<div />' )
61006089 .css( {
61016090 'top': Math.round( context.data.$textbox.offset().top + context.data.$textbox.outerHeight() ),
@@ -6145,6 +6134,11 @@
61466135 }
61476136 context.data.$textbox.focus();
61486137 } )
 6138+ .mouseover( function( e ) {
 6139+ $.suggestions.highlight(
 6140+ context, $( e.target ).closest( '.suggestions-special' ), false
 6141+ );
 6142+ } )
61496143 )
61506144 .appendTo( $( 'body' ) );
61516145 $(this)
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -394,24 +394,24 @@
395395 if(typeof context.config.cancel=='function'){context.config.cancel.call(context.data.$textbox);}},restore:function(context){context.data.$textbox.val(context.data.prevText);},update:function(context,delayed){function maybeFetch(){if(context.data.$textbox.val()!==context.data.prevText){context.data.prevText=context.data.$textbox.val();if(typeof context.config.fetch=='function'){context.config.fetch.call(context.data.$textbox,context.data.$textbox.val());}}}
396396 if(context.data.timerID!=null){clearTimeout(context.data.timerID);}
397397 if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();}
398 -$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');if($special.children().length==0){$special.mousemove(function(){$.suggestions.highlight(context,$([]),false);});}
399 -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();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$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.text(context.config.suggestions[i]).autoEllipsis();}}}}
 398+$.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();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$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.text(context.config.suggestions[i]).autoEllipsis();}}}}
400399 break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'submitOnClick':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){if(selected.is('.suggestions-special')){result=context.data.$container.find('.suggestions-results div:last')}else{result=selected.prev();if(selected.size()==0){if(context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}else{result=context.data.$container.find('.suggestions-results div:last');}}}}else if(result=='next'){if(selected.size()==0)
401 -result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(selected.is('.suggestions-special')){result=[];}else if(result.size()==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}}
 400+result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(selected.is('.suggestions-special')){result=$([]);}else if(result.size()==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}}
402401 selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');}
403 -if(updateTextbox){if(result.size()==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}}
 402+if(updateTextbox){if(result.size()==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();}
 403+context.data.$textbox.trigger('change');}
404404 $.suggestions.special(context);},keypress:function(e,context,key){var wasVisible=context.data.$container.is(':visible');var preventDefault=false;switch(key){case 40:if(wasVisible){$.suggestions.highlight(context,'next',false);}else{$.suggestions.update(context,false);}
405 -context.data.$textbox.trigger('change');preventDefault=true;break;case 38:if(wasVisible){$.suggestions.highlight(context,'prev',false);}
406 -context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 13:context.data.$container.hide();preventDefault=wasVisible;selected=context.data.$container.find('.suggestions-result-current')
407 -if(selected.is('.suggestions-special')){if(typeof context.config.special.select=='function'){context.config.special.select.call(selected,context.data.$textbox);}}else{if(typeof context.config.result.select=='function'){context.data.$textbox.val(selected.text());context.config.result.select.call(selected,context.data.$textbox);}}
 405+preventDefault=true;break;case 38:if(wasVisible){$.suggestions.highlight(context,'prev',false);}
 406+preventDefault=wasVisible;break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');preventDefault=wasVisible;break;case 13:context.data.$container.hide();preventDefault=wasVisible;selected=context.data.$container.find('.suggestions-result-current')
 407+if(selected.is('.suggestions-special')){if(typeof context.config.special.select=='function'){context.config.special.select.call(selected,context.data.$textbox);}}else{if(typeof context.config.result.select=='function'){$.suggestions.highlight(context,selected,true);context.config.result.select.call(selected,context.data.$textbox);}}
408408 break;default:$.suggestions.update(context,true);break;}
409409 if(preventDefault){e.preventDefault();e.stopImmediatePropagation();}}};$.fn.suggestions=function(){var returnValue=null;var args=arguments;$(this).each(function(){var context=$(this).data('suggestions-context');if(typeof context=='undefined'){context={config:{'fetch':function(){},'cancel':function(){},'special':{},'result':{},'$region':$(this),'suggestions':[],'maxRows':7,'delay':120,'submitOnClick':false}};}
410410 if(args.length>0){if(typeof args[0]=='object'){for(var key in args[0]){$.suggestions.configure(context,key,args[0][key]);}}else if(typeof args[0]=='string'){if(args.length>1){$.suggestions.configure(context,args[0],args[1]);}else if(returnValue==null){returnValue=(args[0]in context.config?undefined:context.config[args[0]]);}}}
411 -if(typeof context.data=='undefined'){context.data={'timerID':null,'prevText':null,'visibleResults':0,'mouseDownOn':$([]),'$textbox':$(this)};context.data.$textbox.mousemove(function(){$.suggestions.highlight(context,$([]),false);});context.data.$container=$('<div />').css({'top':Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),'left':Math.round(context.data.$textbox.offset().left),'width':context.data.$textbox.outerWidth(),'display':'none'}).addClass('suggestions').append($('<div />').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!=$other.get(0)){return;}
 411+if(typeof context.data=='undefined'){context.data={'timerID':null,'prevText':null,'visibleResults':0,'mouseDownOn':$([]),'$textbox':$(this)};context.data.$container=$('<div />').css({'top':Math.round(context.data.$textbox.offset().top+context.data.$textbox.outerHeight()),'left':Math.round(context.data.$textbox.offset().left),'width':context.data.$textbox.outerWidth(),'display':'none'}).addClass('suggestions').append($('<div />').addClass('suggestions-results').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-results div');}).mouseup(function(e){var $result=$(e.target).closest('.suggestions-results div');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($result.get(0)!=$other.get(0)){return;}
412412 $.suggestions.highlight(context,$result,true);context.data.$container.hide();if(typeof context.config.result.select=='function'){context.config.result.select.call($result,context.data.$textbox);}
413413 context.data.$textbox.focus();})).append($('<div />').addClass('suggestions-special').mousedown(function(e){context.data.mouseDownOn=$(e.target).closest('.suggestions-special');}).mouseup(function(e){var $special=$(e.target).closest('.suggestions-special');var $other=context.data.mouseDownOn;context.data.mouseDownOn=$([]);if($special.get(0)!=$other.get(0)){return;}
414414 context.data.$container.hide();if(typeof context.config.special.select=='function'){context.config.special.select.call($special,context.data.$textbox);}
415 -context.data.$textbox.focus();})).appendTo($('body'));$(this).attr('autocomplete','off').keydown(function(e){context.data.keypressed=(e.keyCode==undefined)?e.which:e.keyCode;context.data.keypressedCount=0;switch(context.data.keypressed){case 40:e.preventDefault();e.stopImmediatePropagation();break;case 38:case 27:case 13:if(context.data.$container.is(':visible')){e.preventDefault();e.stopImmediatePropagation();}}}).keypress(function(e){context.data.keypressedCount++;$.suggestions.keypress(e,context,context.data.keypressed);}).keyup(function(e){if(context.data.keypressedCount==0){$.suggestions.keypress(e,context,context.data.keypressed);}}).blur(function(){if(context.data.mouseDownOn.size()>0){return;}
 415+context.data.$textbox.focus();}).mouseover(function(e){$.suggestions.highlight(context,$(e.target).closest('.suggestions-special'),false);})).appendTo($('body'));$(this).attr('autocomplete','off').keydown(function(e){context.data.keypressed=(e.keyCode==undefined)?e.which:e.keyCode;context.data.keypressedCount=0;switch(context.data.keypressed){case 40:e.preventDefault();e.stopImmediatePropagation();break;case 38:case 27:case 13:if(context.data.$container.is(':visible')){e.preventDefault();e.stopImmediatePropagation();}}}).keypress(function(e){context.data.keypressedCount++;$.suggestions.keypress(e,context,context.data.keypressed);}).keyup(function(e){if(context.data.keypressedCount==0){$.suggestions.keypress(e,context,context.data.keypressed);}}).blur(function(){if(context.data.mouseDownOn.size()>0){return;}
416416 context.data.$container.hide();$.suggestions.cancel(context);});}
417417 $(this).data('suggestions-context',context);});return returnValue!==null?returnValue:$(this);};})(jQuery);(function($){$.fn.textSelection=function(command,options){var fn={getContents:function(){return this.val();},getSelection:function(){var e=this.get(0);var retval='';if($(e).is(':hidden')){}else if(document.selection&&document.selection.createRange){e.focus();var range=document.selection.createRange();retval=range.text;}else if(e.selectionStart||e.selectionStart=='0'){retval=e.value.substring(e.selectionStart,e.selectionEnd);}
418418 return retval;},encapsulateSelection:function(options){return this.each(function(){function checkSelectedText(){if(!selText){selText=options.peri;isSample=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);options.post+=' ';}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r65063Compliment to r65046 - Removing duplicate css from Vector's css fileadam13:26, 15 April 2010
r66209Follow up to r65046, implimenting Roan's suggestionadam18:15, 11 May 2010

Comments

#Comment by Catrope (talk | contribs)   19:51, 1 May 2010
+.suggestions-result-current .special-label,
+.suggestions-result-current .special-query {
+	color: white !important;
+	color: HighlightText !important;
+}

Is !important needed here? I don't see what it would need to override apart from the duplicate CSS in Vector removed in r65063.

Status & tagging log