Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 4 ), |
67 | 67 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 11 ), |
68 | 68 | 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 ), |
70 | 70 | array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2x' ), |
71 | 71 | ), |
72 | 72 | 'combined' => array( |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -34,7 +34,6 @@ |
35 | 35 | margin: 0; |
36 | 36 | } |
37 | 37 | .suggestions-result { |
38 | | - /*white-space: nowrap;*/ |
39 | 38 | color: black; |
40 | 39 | color: WindowText; |
41 | 40 | padding: 0.25em 0.25em; |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -445,4 +445,4 @@ |
446 | 446 | background-color:white; |
447 | 447 | text-decoration:none; |
448 | 448 | border-color:#a8d7f9; |
449 | | -} |
| 449 | +} |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -525,7 +525,7 @@ |
526 | 526 | } else if ( typeof args[0] == 'string' ) { |
527 | 527 | if ( args.length > 1 ) { |
528 | 528 | // Set property values |
529 | | - $.suggestions.configure( context, args[0], args[1] );; |
| 529 | + $.suggestions.configure( context, args[0], args[1] ); |
530 | 530 | } else if ( returnValue == null ) { |
531 | 531 | // Get property values, but don't give access to internal data - returns only the first |
532 | 532 | returnValue = ( args[0] in context.config ? undefined : context.config[args[0]] ); |
— | — | @@ -557,7 +557,7 @@ |
558 | 558 | .mouseover( function( e ) { |
559 | 559 | $.suggestions.highlight( context, $( e.target ).closest( '.suggestions-results div' ), false ); |
560 | 560 | } ) |
561 | | - .addClass( 'suggestions' ) // TODO: use own CSS |
| 561 | + .addClass( 'suggestions' ) |
562 | 562 | .append( |
563 | 563 | $( '<div />' ).addClass( 'suggestions-results' ) |
564 | 564 | // Can't use click() because the container div is hidden when the textbox loses focus. Instead, |
— | — | @@ -1897,7 +1897,7 @@ |
1898 | 1898 | var position = wikitext.indexOf( text, offset ); |
1899 | 1899 | // Update offset to avoid stumbling on duplicate headings |
1900 | 1900 | if ( position > offset ) { |
1901 | | - offset = position; |
| 1901 | + offset = position + 1; |
1902 | 1902 | } else if ( position == -1 ) { |
1903 | 1903 | // Not sure this is possible, or what should happen |
1904 | 1904 | continue; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | $.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);} |
36 | 36 | context.data.$textbox.trigger('change');break;case 38:if(context.data.$container.is(':visible')){$.suggestions.highlight(context,'prev',true);} |
37 | 37 | 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]]);}}} |
39 | 39 | 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;} |
40 | 40 | highlight($result,true);context.data.$container.hide();if(typeof context.config.result.select=='function'){context.config.result.select.call($result,context.data.$textbox);} |
41 | 41 | 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 @@ |
132 | 132 | 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));} |
133 | 133 | list.append(item);} |
134 | 134 | 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;} |
136 | 136 | text=$.trim(text);var startLevel=0;for(var c=0;c<text.length;c++){if(text.charAt(c)=='='){startLevel++;}else{break;}} |
137 | 137 | var endLevel=0;for(var c=text.length-1;c>=0;c--){if(text.charAt(c)=='='){endLevel++;}else{break;}} |
138 | 138 | 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};} |