Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | array( 'src' => 'css/suggestions.css', 'version' => 6 ), |
23 | 23 | array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 6 ), |
24 | 24 | array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ), |
25 | | - array( 'src' => 'css/wikiEditor.css', 'version' => 7 ), |
| 25 | + array( 'src' => 'css/wikiEditor.css', 'version' => 8 ), |
26 | 26 | array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 13 ), |
27 | 27 | array( 'src' => 'css/wikiEditor.preview.css', 'version' => 1 ), |
28 | 28 | array( 'src' => 'css/wikiEditor.toc.css', 'version' => 28 ), |
— | — | @@ -29,11 +29,11 @@ |
30 | 30 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
31 | 31 | ), |
32 | 32 | 'combined' => array( |
33 | | - array( 'src' => 'css/combined.css', 'version' => 54 ), |
| 33 | + array( 'src' => 'css/combined.css', 'version' => 55 ), |
34 | 34 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
35 | 35 | ), |
36 | 36 | 'minified' => array( |
37 | | - array( 'src' => 'css/combined.min.css', 'version' => 54 ), |
| 37 | + array( 'src' => 'css/combined.min.css', 'version' => 55 ), |
38 | 38 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
39 | 39 | ), |
40 | 40 | ) |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | array( |
142 | 142 | 'src' => 'js/plugins/jquery.wikiEditor.js', |
143 | 143 | 'class' => 'j.wikiEditor', |
144 | | - 'version' => 62 |
| 144 | + 'version' => 63 |
145 | 145 | ), |
146 | 146 | array( |
147 | 147 | 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | array( |
152 | 152 | 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', |
153 | 153 | 'class' => 'j.wikiEditor.modules.toolbar', |
154 | | - 'version' => 42 |
| 154 | + 'version' => 43 |
155 | 155 | ), |
156 | 156 | array( |
157 | 157 | 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', |
— | — | @@ -178,10 +178,10 @@ |
179 | 179 | 'version' => 1 ), |
180 | 180 | ), |
181 | 181 | 'combined' => array( |
182 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 169 ), |
| 182 | + array( 'src' => 'js/plugins.combined.js', 'version' => 170 ), |
183 | 183 | ), |
184 | 184 | 'minified' => array( |
185 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 169 ), |
| 185 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 170 ), |
186 | 186 | ), |
187 | 187 | ), |
188 | 188 | ); |
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css |
— | — | @@ -198,6 +198,7 @@ |
199 | 199 | padding-right: 22px; |
200 | 200 | margin-right: 4px; |
201 | 201 | cursor: pointer; |
| 202 | + text-decoration: none; |
202 | 203 | color: #333333; |
203 | 204 | } |
204 | 205 | body.rtl .wikiEditor-ui-toolbar .group .tool-select .label { |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -753,6 +753,7 @@ |
754 | 754 | padding-right: 22px; |
755 | 755 | margin-right: 4px; |
756 | 756 | cursor: pointer; |
| 757 | + text-decoration: none; |
757 | 758 | color: #333333; |
758 | 759 | } |
759 | 760 | body.rtl .wikiEditor-ui-toolbar .group .tool-select .label { |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -700,6 +700,7 @@ |
701 | 701 | padding-right:22px; |
702 | 702 | margin-right:4px; |
703 | 703 | cursor:pointer; |
| 704 | +text-decoration:none; |
704 | 705 | color:#333333; |
705 | 706 | } |
706 | 707 | body.rtl .wikiEditor-ui-toolbar .group .tool-select .label{ |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -438,12 +438,16 @@ |
439 | 439 | // Firefox and Opera |
440 | 440 | var range = context.$iframe[0].contentWindow.getSelection().getRangeAt( 0 ); |
441 | 441 | if ( options.ownline ) { |
| 442 | + var body = context.$content.get( 0 ); |
442 | 443 | // TODO: This'll probably break with syntax highlighting |
443 | | - if ( range.startOffset != 0 ) { |
| 444 | + // When the selection starts at the beginning of a line, it'll have either |
| 445 | + // startOffset == 0 or startContainer == body |
| 446 | + if ( range.startOffset != 0 && range.startContainer != body ) { |
444 | 447 | pre = "\n" + options.pre; |
445 | 448 | } |
446 | 449 | // TODO: Will this still work with syntax highlighting? |
447 | | - if ( range.endContainer == range.commonAncestorContainer ) { |
| 450 | + // When the selection ends at the end of a line, it'll have endContainer == body |
| 451 | + if ( range.endContainer != body ) { |
448 | 452 | post += "\n"; |
449 | 453 | } |
450 | 454 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -312,11 +312,7 @@ |
313 | 313 | return $button; |
314 | 314 | case 'select': |
315 | 315 | var $select = $( '<div />' ) |
316 | | - .attr( { 'rel' : id, 'class' : 'tool tool-select' } ) |
317 | | - .click( function() { |
318 | | - var $options = $(this).find( '.options' ); |
319 | | - $options.animate( { 'opacity': 'toggle' }, 'fast' ); |
320 | | - } ); |
| 316 | + .attr( { 'rel' : id, 'class' : 'tool tool-select' } ); |
321 | 317 | $options = $( '<div />' ).addClass( 'options' ); |
322 | 318 | if ( 'list' in tool ) { |
323 | 319 | for ( option in tool.list ) { |
— | — | @@ -329,15 +325,31 @@ |
330 | 326 | $.wikiEditor.modules.toolbar.fn.doAction( |
331 | 327 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
332 | 328 | ); |
| 329 | + // Hide the dropdown |
| 330 | + // Sanity check: if this somehow gets called while the dropdown |
| 331 | + // is hidden, don't show it |
| 332 | + if ( $(this).parent().is( ':visible' ) ) { |
| 333 | + $(this).parent().animate( { 'opacity': 'toggle' }, 'fast' ); |
| 334 | + } |
| 335 | + return false; |
333 | 336 | } ) |
334 | 337 | .text( optionLabel ) |
335 | 338 | .addClass( 'option' ) |
336 | | - .attr( 'rel', option ) |
| 339 | + .attr( { 'rel': option, 'href': '#' } ) |
337 | 340 | ); |
338 | 341 | } |
339 | 342 | } |
340 | 343 | $select.append( $( '<div />' ).addClass( 'menu' ).append( $options ) ); |
341 | | - $select.append( $( '<div />' ).addClass( 'label' ).text( label ) ); |
| 344 | + $select.append( $( '<a />' ) |
| 345 | + .addClass( 'label' ) |
| 346 | + .text( label ) |
| 347 | + .data( 'options', $options ) |
| 348 | + .attr( 'href', '#' ) |
| 349 | + .click( function() { |
| 350 | + $(this).data( 'options' ).animate( { 'opacity': 'toggle' }, 'fast' ); |
| 351 | + return false; |
| 352 | + } ) |
| 353 | + ); |
342 | 354 | return $select; |
343 | 355 | default: |
344 | 356 | return null; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6919,12 +6919,16 @@ |
6920 | 6920 | // Firefox and Opera |
6921 | 6921 | var range = context.$iframe[0].contentWindow.getSelection().getRangeAt( 0 ); |
6922 | 6922 | if ( options.ownline ) { |
| 6923 | + var body = context.$content.get( 0 ); |
6923 | 6924 | // TODO: This'll probably break with syntax highlighting |
6924 | | - if ( range.startOffset != 0 ) { |
| 6925 | + // When the selection starts at the beginning of a line, it'll have either |
| 6926 | + // startOffset == 0 or startContainer == body |
| 6927 | + if ( range.startOffset != 0 && range.startContainer != body ) { |
6925 | 6928 | pre = "\n" + options.pre; |
6926 | 6929 | } |
6927 | 6930 | // TODO: Will this still work with syntax highlighting? |
6928 | | - if ( range.endContainer == range.commonAncestorContainer ) { |
| 6931 | + // When the selection ends at the end of a line, it'll have endContainer == body |
| 6932 | + if ( range.endContainer != body ) { |
6929 | 6933 | post += "\n"; |
6930 | 6934 | } |
6931 | 6935 | } |
— | — | @@ -9569,11 +9573,7 @@ |
9570 | 9574 | return $button; |
9571 | 9575 | case 'select': |
9572 | 9576 | var $select = $( '<div />' ) |
9573 | | - .attr( { 'rel' : id, 'class' : 'tool tool-select' } ) |
9574 | | - .click( function() { |
9575 | | - var $options = $(this).find( '.options' ); |
9576 | | - $options.animate( { 'opacity': 'toggle' }, 'fast' ); |
9577 | | - } ); |
| 9577 | + .attr( { 'rel' : id, 'class' : 'tool tool-select' } ); |
9578 | 9578 | $options = $( '<div />' ).addClass( 'options' ); |
9579 | 9579 | if ( 'list' in tool ) { |
9580 | 9580 | for ( option in tool.list ) { |
— | — | @@ -9586,15 +9586,31 @@ |
9587 | 9587 | $.wikiEditor.modules.toolbar.fn.doAction( |
9588 | 9588 | $(this).data( 'context' ), $(this).data( 'action' ), $(this) |
9589 | 9589 | ); |
| 9590 | + // Hide the dropdown |
| 9591 | + // Sanity check: if this somehow gets called while the dropdown |
| 9592 | + // is hidden, don't show it |
| 9593 | + if ( $(this).parent().is( ':visible' ) ) { |
| 9594 | + $(this).parent().animate( { 'opacity': 'toggle' }, 'fast' ); |
| 9595 | + } |
| 9596 | + return false; |
9590 | 9597 | } ) |
9591 | 9598 | .text( optionLabel ) |
9592 | 9599 | .addClass( 'option' ) |
9593 | | - .attr( 'rel', option ) |
| 9600 | + .attr( { 'rel': option, 'href': '#' } ) |
9594 | 9601 | ); |
9595 | 9602 | } |
9596 | 9603 | } |
9597 | 9604 | $select.append( $( '<div />' ).addClass( 'menu' ).append( $options ) ); |
9598 | | - $select.append( $( '<div />' ).addClass( 'label' ).text( label ) ); |
| 9605 | + $select.append( $( '<a />' ) |
| 9606 | + .addClass( 'label' ) |
| 9607 | + .text( label ) |
| 9608 | + .data( 'options', $options ) |
| 9609 | + .attr( 'href', '#' ) |
| 9610 | + .click( function() { |
| 9611 | + $(this).data( 'options' ).animate( { 'opacity': 'toggle' }, 'fast' ); |
| 9612 | + return false; |
| 9613 | + } ) |
| 9614 | + ); |
9599 | 9615 | return $select; |
9600 | 9616 | default: |
9601 | 9617 | return null; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -452,8 +452,8 @@ |
453 | 453 | +'</pre>');$pre.find(".wikiEditor-noinclude").each(function(){$(this).remove();});$pre.find(".wikiEditor-tab").each(function(){$(this).text("\t")});return $pre.text();},'getSelection':function(){var retval;if(context.$iframe[0].contentWindow.getSelection){retval=context.$iframe[0].contentWindow.getSelection();}else if(context.$iframe[0].contentWindow.document.selection){retval=context.$iframe[0].contentWindow.document.selection.createRange();} |
454 | 454 | if(typeof retval.text!='undefined'){retval=retval.text;}else if(retval.toString){retval=retval.toString();} |
455 | 455 | return retval;},'encapsulateSelection':function(options){var selText=$(this).textSelection('getSelection');var selectAfter=false;var pre=options.pre,post=options.post;if(!selText){selText=options.peri;selectAfter=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);post+=' ';} |
456 | | -if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);if(options.ownline){if(range.startOffset!=0){pre="\n"+options.pre;} |
457 | | -if(range.endContainer==range.commonAncestorContainer){post+="\n";}} |
| 456 | +if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);if(options.ownline){var body=context.$content.get(0);if(range.startOffset!=0&&range.startContainer!=body){pre="\n"+options.pre;} |
| 457 | +if(range.endContainer!=body){post+="\n";}} |
458 | 458 | var insertText=pre+selText+post;var insertLines=insertText.split("\n");range.extractContents();var lastNode;for(var i=insertLines.length-1;i>=0;i--){range.insertNode(context.$iframe[0].contentWindow.document.createTextNode(insertLines[i]));if(i>0){lastNode=range.insertNode(context.$iframe[0].contentWindow.document.createElement('br'));}} |
459 | 459 | if(lastNode){context.fn.scrollToTop(lastNode);}}else if(context.$iframe[0].contentWindow.document.selection){context.$iframe[0].contentWindow.focus();var range=context.$iframe[0].contentWindow.document.selection.createRange();if(options.ownline&&range.moveStart){var range2=context.$iframe[0].contentWindow.document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){pre="\n"+pre;} |
460 | 460 | var range3=context.$iframe[0].contentWindow.document.selection.createRange();range3.collapse(false);range3.moveEnd('character',1);if(range3.text!="\r"&&range3.text!="\n"&&range3.text!=""){post+="\n";}} |
— | — | @@ -640,8 +640,9 @@ |
641 | 641 | var empty=true;if('tools'in group){for(tool in group.tools){var tool=$.wikiEditor.modules.toolbar.fn.buildTool(context,tool,group.tools[tool]);if(tool){empty=false;$group.append(tool);}}} |
642 | 642 | return empty?null:$group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}} |
643 | 643 | var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});if('action'in tool){$button.data('action',tool.action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));return false;});} |
644 | | -return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'}).click(function(){var $options=$(this).find('.options');$options.animate({'opacity':'toggle'},'fast');});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));}).text(optionLabel).addClass('option').attr('rel',option));}} |
645 | | -$select.append($('<div />').addClass('menu').append($options));$select.append($('<div />').addClass('label').text(label));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).bind('mousedown',function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));} |
| 644 | +return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');} |
| 645 | +return false;}).text(optionLabel).addClass('option').attr({'rel':option,'href':'#'}));}} |
| 646 | +$select.append($('<div />').addClass('menu').append($options));$select.append($('<a />').addClass('label').text(label).data('options',$options).attr('href','#').click(function(){$(this).data('options').animate({'opacity':'toggle'},'fast');return false;}));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).bind('mousedown',function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));} |
646 | 647 | $.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));});},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)} |
647 | 648 | if('rows'in page){for(row in page.rows){html+=$.wikiEditor.modules.toolbar.fn.buildRow(context,page.rows[row])}} |
648 | 649 | $page.html(html);break;case'characters':$page.addClass('page-characters');$characters=$('<div />').data('context',context).data('actions',{});var actions=$characters.data('actions');if('language'in page){$characters.attr('lang',page.language);} |