r56135 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56134‎ | r56135 | r56136 >
Date:13:53, 10 September 2009
Author:catrope
Status:deferred
Tags:
Comment:
Bump version, recombine for r56134
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/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -65,7 +65,7 @@
6666 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 4 ),
6767 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 11 ),
6868 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 1 ),
69 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 5 ),
 69+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 6 ),
7070 array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2x' ),
7171 ),
7272 'combined' => array(
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -34,7 +34,6 @@
3535 margin: 0;
3636 }
3737 .suggestions-result {
38 - /*white-space: nowrap;*/
3938 color: black;
4039 color: WindowText;
4140 padding: 0.25em 0.25em;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -445,4 +445,4 @@
446446 background-color:white;
447447 text-decoration:none;
448448 border-color:#a8d7f9;
449 -}
 449+}
\ No newline at end of file
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -525,7 +525,7 @@
526526 } else if ( typeof args[0] == 'string' ) {
527527 if ( args.length > 1 ) {
528528 // Set property values
529 - $.suggestions.configure( context, args[0], args[1] );;
 529+ $.suggestions.configure( context, args[0], args[1] );
530530 } else if ( returnValue == null ) {
531531 // Get property values, but don't give access to internal data - returns only the first
532532 returnValue = ( args[0] in context.config ? undefined : context.config[args[0]] );
@@ -557,7 +557,7 @@
558558 .mouseover( function( e ) {
559559 $.suggestions.highlight( context, $( e.target ).closest( '.suggestions-results div' ), false );
560560 } )
561 - .addClass( 'suggestions' ) // TODO: use own CSS
 561+ .addClass( 'suggestions' )
562562 .append(
563563 $( '<div />' ).addClass( 'suggestions-results' )
564564 // Can't use click() because the container div is hidden when the textbox loses focus. Instead,
@@ -1897,7 +1897,7 @@
18981898 var position = wikitext.indexOf( text, offset );
18991899 // Update offset to avoid stumbling on duplicate headings
19001900 if ( position > offset ) {
1901 - offset = position;
 1901+ offset = position + 1;
19021902 } else if ( position == -1 ) {
19031903 // Not sure this is possible, or what should happen
19041904 continue;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -34,7 +34,7 @@
3535 $.suggestions.special(context);},keypress:function(context,key){switch(key){case 40:if(context.data.$container.is(':visible')){$.suggestions.highlight(context,'next',true);}else{$.suggestions.update(context,false);}
3636 context.data.$textbox.trigger('change');break;case 38:if(context.data.$container.is(':visible')){$.suggestions.highlight(context,'prev',true);}
3737 context.data.$textbox.trigger('change');break;case 27:context.data.$container.hide();$.suggestions.restore(context);$.suggestions.cancel(context);context.data.$textbox.trigger('change');break;case 13:context.data.$container.hide();break;default:$.suggestions.update(context,true);break;}}};$.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':1200,'submitOnClick':false}};}
38 -if(args.length>0){if(typeof args[0]=='object'){for(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]]);}}}
 38+if(args.length>0){if(typeof args[0]=='object'){for(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]]);}}}
3939 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'}).mouseover(function(e){$.suggestions.highlight(context,$(e.target).closest('.suggestions-results div'),false);}).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;}
4040 highlight($result,true);context.data.$container.hide();if(typeof context.config.result.select=='function'){context.config.result.select.call($result,context.data.$textbox);}
4141 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;}
@@ -131,7 +131,7 @@
132132 function buildList(structure){var list=$('<ul></ul>');for(i in structure){var item=$('<li></li>').append($('<a></a>').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).click(function(event){$(this).data('textbox').scrollToCaretPosition($(this).data('position'));event.preventDefault();}).text(structure[i].text));if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));}
133133 list.append(item);}
134134 return list;}
135 -var outline=[];var wikitext='\n'+context.$textarea.val()+'\n';var headings=wikitext.match(/\n={1,5}.*={1,5}(?=\n)/g);var offset=0;headings=$.makeArray(headings);for(var h=0;h<headings.length;h++){text=headings[h];var position=wikitext.indexOf(text,offset);if(position>offset){offset=position;}else if(position==-1){continue;}
 135+var outline=[];var wikitext='\n'+context.$textarea.val()+'\n';var headings=wikitext.match(/\n={1,5}.*={1,5}(?=\n)/g);var offset=0;headings=$.makeArray(headings);for(var h=0;h<headings.length;h++){text=headings[h];var position=wikitext.indexOf(text,offset);if(position>offset){offset=position+1;}else if(position==-1){continue;}
136136 text=$.trim(text);var startLevel=0;for(var c=0;c<text.length;c++){if(text.charAt(c)=='='){startLevel++;}else{break;}}
137137 var endLevel=0;for(var c=text.length-1;c>=0;c--){if(text.charAt(c)=='='){endLevel++;}else{break;}}
138138 var level=Math.min(startLevel,endLevel);text=$.trim(text.substr(level,text.length-(level*2)));outline[h]={'text':text,'position':position,'level':level,'index':h+1};}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56134NavigableTOC: (bug 20570) Consecutive sections with the same name treated as ...catrope13:51, 10 September 2009

Status & tagging log