r64392 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64391‎ | r64392 | r64393 >
Date:15:56, 30 March 2010
Author:tparscal
Status:ok
Tags:
Comment:
Cleans up some things in r64371 such as merging some CSS rules with identical properties and rebuilding the combined and minified versions properly.
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/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' => 7 ),
 22+ array( 'src' => 'css/suggestions.css', 'version' => 8 ),
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' => 81 ),
 33+ array( 'src' => 'css/combined.css', 'version' => 82 ),
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' => 81 ),
 37+ array( 'src' => 'css/combined.min.css', 'version' => 82 ),
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' => 8 ),
 74+ array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 9 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 179 ),
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' => 368 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 369 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 368 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 369 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/css/suggestions.css
@@ -28,10 +28,7 @@
2929 background-color: #4C59A6;
3030 background-color: Highlight;
3131 }
32 -.suggestions-special:hover .special-label {
33 - color: white;
34 - color: HighlightText;
35 -}
 32+.suggestions-special:hover .special-label,
3633 .suggestions-special:hover .special-query {
3734 color: white;
3835 color: HighlightText;
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -28,10 +28,7 @@
2929 background-color: #4C59A6;
3030 background-color: Highlight;
3131 }
32 -.suggestions-special:hover .special-label {
33 - color: white;
34 - color: HighlightText;
35 -}
 32+.suggestions-special:hover .special-label,
3633 .suggestions-special:hover .special-query {
3734 color: white;
3835 color: HighlightText;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -26,10 +26,7 @@
2727 background-color:#4C59A6;
2828 background-color:Highlight;
2929 }
30 -.suggestions-special:hover .special-label{
31 -color:white;
32 -color:HighlightText;
33 -}
 30+.suggestions-special:hover .special-label,
3431 .suggestions-special:hover .special-query{
3532 color:white;
3633 color:HighlightText;
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js
@@ -93,7 +93,7 @@
9494 // Only hook this up the first time
9595 if ( $special.children().length == 0 ) {
9696 $special.mousemove( function() {
97 - $.suggestions.highlight( context, $(), false );
 97+ $.suggestions.highlight( context, $( [] ), false );
9898 } );
9999 }
100100 context.config.special.render.call( $special, context.data.$textbox.val() );
@@ -321,7 +321,7 @@
322322 '$textbox': $(this)
323323 };
324324 context.data.$textbox.mousemove( function() {
325 - $.suggestions.highlight( context, $(), false );
 325+ $.suggestions.highlight( context, $( [] ), false );
326326 } );
327327 context.data.$container = $( '<div />' )
328328 .css( {
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -5831,7 +5831,7 @@
58325832 // Only hook this up the first time
58335833 if ( $special.children().length == 0 ) {
58345834 $special.mousemove( function() {
5835 - $.suggestions.highlight( context, $(), false );
 5835+ $.suggestions.highlight( context, $( [] ), false );
58365836 } );
58375837 }
58385838 context.config.special.render.call( $special, context.data.$textbox.val() );
@@ -6059,7 +6059,7 @@
60606060 '$textbox': $(this)
60616061 };
60626062 context.data.$textbox.mousemove( function() {
6063 - $.suggestions.highlight( context, $(), false );
 6063+ $.suggestions.highlight( context, $( [] ), false );
60646064 } );
60656065 context.data.$container = $( '<div />' )
60666066 .css( {
@@ -6917,7 +6917,7 @@
69186918 }
69196919 break;
69206920 case 86: //v
6921 - if ( event.ctrlKey ){
 6921+ if ( event.ctrlKey && $.browser.msie ) {
69226922 //paste, intercepted for IE
69236923 context.evt.paste( event );
69246924 }
@@ -6971,7 +6971,6 @@
69726972 // Save the cursor position to restore it after all this voodoo
69736973 var cursorPos = context.fn.getCaretPosition();
69746974 var oldLength = context.fn.getContents().length;
6975 -
69766975 context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' );
69776976 if ( $.layout.name !== 'webkit' ) {
69786977 context.$content.addClass( 'pasting' );
@@ -8985,7 +8984,7 @@
89868985
89878986 // Remove this marker
89888987 var marker = $(this).data( 'marker' );
8989 - if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
 8988+ if ( marker && typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
89908989 // Don't remove these either
89918990 return true;
89928991 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -393,7 +393,7 @@
394394 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());}}}
395395 if(context.data.timerID!=null){clearTimeout(context.data.timerID);}
396396 if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();}
397 -$.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);});}
 397+$.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);});}
398398 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();}}}}
399399 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'){result=selected.prev();}else if(result=='next'){if(selected.size()==0)
400400 result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(result.size()==0)
@@ -406,7 +406,7 @@
407407 break;default:$.suggestions.update(context,true);break;}
408408 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}};}
409409 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]]);}}}
410 -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;}
 410+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;}
411411 $.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);}
412412 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;}
413413 context.data.$container.hide();if(typeof context.config.special.select=='function'){context.config.special.select.call($special,context.data.$textbox);}
@@ -459,7 +459,7 @@
460460 return false;}
461461 break;case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex-b.tabIndex;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}}
462462 return false;}
463 -break;case 86:if(event.ctrlKey){context.evt.paste(event);}
 463+break;case 86:if(event.ctrlKey&&$.browser.msie){context.evt.paste(event);}
464464 break;}
465465 return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';}
466466 if(context.$content.children().length==0){context.$content.append('<p></p>');}
@@ -614,7 +614,7 @@
615615 $(anchor).data('marker',markers[i]).addClass('wikiEditor-highlight');markers[i].afterWrap(anchor,markers[i]);}else{$(anchor).data('marker',markers[i]);markers[i].onSkip(anchor);}
616616 visited[v++]=anchor;}}
617617 var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;}
618 -var marker=$(this).data('marker');if(typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;}
 618+var marker=$(this).data('marker');if(marker&&typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;}
619619 if(marker&&typeof marker.beforeUnwrap=='function')
620620 marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);}
621621 context.fn.purgeOffsets();});}}};})(jQuery);(function($){$.wikiEditor.modules.preview={'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]}},fn:{create:function(context,config){if('initialized'in context.modules.preview){return;}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64371Made some minor UI tweaks to the search suggestion interface.tparscal00:08, 30 March 2010

Status & tagging log