Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 145 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 146 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 34 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 50 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 18 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 277 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 278 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 277 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 278 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -435,7 +435,7 @@ |
436 | 436 | } else if ( $currentElement.is( 'span' ) && text.length == 0 ) { |
437 | 437 | // Markers! |
438 | 438 | $currentElement.remove(); |
439 | | - } else { |
| 439 | + } else if ( $currentElement.is( 'p' ) || $currentElement.is( 'div' ) ) { |
440 | 440 | $newElement = $( '<p></p>' ) |
441 | 441 | .addClass( 'wikiEditor' ) |
442 | 442 | .insertAfter( $currentElement ); |
— | — | @@ -445,6 +445,12 @@ |
446 | 446 | $newElement.append( $( '<br>' ).addClass( 'wikiEditor' ) ); |
447 | 447 | } |
448 | 448 | $currentElement.remove(); |
| 449 | + } else { |
| 450 | + $( '<span></span>' ) |
| 451 | + .addClass( 'wikiEditor' ) |
| 452 | + .text( $currentElement.text() ) |
| 453 | + .insertAfter( $currentElement ); |
| 454 | + $currentElement.remove(); |
449 | 455 | } |
450 | 456 | $selection = context.$content.find( ':not(.wikiEditor)' ); |
451 | 457 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6868,7 +6868,7 @@ |
6869 | 6869 | } else if ( $currentElement.is( 'span' ) && text.length == 0 ) { |
6870 | 6870 | // Markers! |
6871 | 6871 | $currentElement.remove(); |
6872 | | - } else { |
| 6872 | + } else if ( $currentElement.is( 'p' ) || $currentElement.is( 'div' ) ) { |
6873 | 6873 | $newElement = $( '<p></p>' ) |
6874 | 6874 | .addClass( 'wikiEditor' ) |
6875 | 6875 | .insertAfter( $currentElement ); |
— | — | @@ -6878,6 +6878,12 @@ |
6879 | 6879 | $newElement.append( $( '<br>' ).addClass( 'wikiEditor' ) ); |
6880 | 6880 | } |
6881 | 6881 | $currentElement.remove(); |
| 6882 | + } else { |
| 6883 | + $( '<span></span>' ) |
| 6884 | + .addClass( 'wikiEditor' ) |
| 6885 | + .text( $currentElement.text() ) |
| 6886 | + .insertAfter( $currentElement ); |
| 6887 | + $currentElement.remove(); |
6882 | 6888 | } |
6883 | 6889 | $selection = context.$content.find( ':not(.wikiEditor)' ); |
6884 | 6890 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -458,8 +458,8 @@ |
459 | 459 | return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.oldDelayedHTML=newHTML;event.data.scope='realchange';} |
460 | 460 | context.fn.updateHistory(event.data.scope=='realchange');return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');} |
461 | 461 | setTimeout(function(){context.$content.find('link, style, meta').remove();context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)').each(function(){var outerParent=$(this).parent();outerParent.replaceWith(outerParent.childNodes());});context.$content.find('span.Apple-style-span').each(function(){$(this.childNodes).insertBefore(this);}).remove();var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();} |
462 | | -$currentElement.find('*').each(function(){if($(this).children()==0&&this.childNodes.length>0){$(this).text($(this).text());}});var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else{$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));} |
463 | | -$currentElement.remove();} |
| 462 | +$currentElement.find('*').each(function(){if($(this).children()==0&&this.childNodes.length>0){$(this).text($(this).text());}});var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else if($currentElement.is('p')||$currentElement.is('div')){$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));} |
| 463 | +$currentElement.remove();}else{$('<span></span>').addClass('wikiEditor').text($currentElement.text()).insertAfter($currentElement);$currentElement.remove();} |
464 | 464 | $selection=context.$content.find(':not(.wikiEditor)');} |
465 | 465 | context.$content.find('.wikiEditor').removeClass('wikiEditor');var t=context.fn.traverser(context.$content);while(t){if(t.node.nodeName=='#text'){if(t.node.nodeValue==='\n'){$('<p><br></p>').insertAfter($(t.node));var oldNode=t.node;t=t.next();$(oldNode).remove();continue;} |
466 | 466 | else if(t.node.nodeValue.search(/\S+/)==-1){var oldNode=t.node;t=t.next();$(oldNode).remove();continue;} |