Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.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' => 158 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 159 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 36 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 52 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 19 ), |
— | — | @@ -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' => 303 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 304 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 303 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 304 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -1257,9 +1257,11 @@ |
1258 | 1258 | } else { |
1259 | 1259 | atEnd = true; |
1260 | 1260 | } |
1261 | | - } else if ( range.startContainer.nodeName == '#text' && |
1262 | | - range.startOffset == range.startContainer.nodeValue.length ) { |
1263 | | - // Apparently this happens when splitting text nodes |
| 1261 | + } |
| 1262 | + if ( ( range.endOffset == 0 && range.endContainer.nodeValue == null ) || |
| 1263 | + ( range.endContainer.nodeName == '#text' && |
| 1264 | + range.endOffset == range.endContainer.nodeValue.length ) || |
| 1265 | + ( range.endContainer.nodeName == 'P' && range.endContainer.nodeValue == null ) ) { |
1264 | 1266 | atEnd = true; |
1265 | 1267 | } |
1266 | 1268 | if ( !atStart ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7800,9 +7800,11 @@ |
7801 | 7801 | } else { |
7802 | 7802 | atEnd = true; |
7803 | 7803 | } |
7804 | | - } else if ( range.startContainer.nodeName == '#text' && |
7805 | | - range.startOffset == range.startContainer.nodeValue.length ) { |
7806 | | - // Apparently this happens when splitting text nodes |
| 7804 | + } |
| 7805 | + if ( ( range.endOffset == 0 && range.endContainer.nodeValue == null ) || |
| 7806 | + ( range.endContainer.nodeName == '#text' && |
| 7807 | + range.endOffset == range.endContainer.nodeValue.length ) || |
| 7808 | + ( range.endContainer.nodeName == 'P' && range.endContainer.nodeValue == null ) ) { |
7807 | 7809 | atEnd = true; |
7808 | 7810 | } |
7809 | 7811 | if ( !atStart ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -528,7 +528,8 @@ |
529 | 529 | if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);if(collapseToEnd){if(range.endContainer.nodeName=='BR'){range.setEndBefore(range.endContainer);} |
530 | 530 | range.collapse(false);} |
531 | 531 | if(options.ownline){var atStart=false,atEnd=false;var body=context.$content.get(0);if(range.startOffset==0){atStart=true;}else if(range.startContainer==body){var n=body.firstChild;for(var i=0;i<range.startOffset-1&&n;i++){n=n.nextSibling;} |
532 | | -if(n&&n.nodeName=='BR'){atStart=true;}else{atEnd=true;}}else if(range.startContainer.nodeName=='#text'&&range.startOffset==range.startContainer.nodeValue.length){atEnd=true;} |
| 532 | +if(n&&n.nodeName=='BR'){atStart=true;}else{atEnd=true;}} |
| 533 | +if((range.endOffset==0&&range.endContainer.nodeValue==null)||(range.endContainer.nodeName=='#text'&&range.endOffset==range.endContainer.nodeValue.length)||(range.endContainer.nodeName=='P'&&range.endContainer.nodeValue==null)){atEnd=true;} |
533 | 534 | if(!atStart){pre="\n"+options.pre;} |
534 | 535 | if(!atEnd){post+="\n";}} |
535 | 536 | var insertText="";if(options.splitlines){for(var j=0;j<selTextArr.length;j++){insertText=insertText+pre+selTextArr[j]+post;if(j!=selTextArr.length-1){insertText+="\n";}}}else{insertText=pre+selText+post;} |