Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
86 | 86 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
87 | 87 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 22 ), |
88 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 45 ), |
| 88 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 46 ), |
89 | 89 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ), |
90 | 90 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 41 ), |
91 | 91 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
— | — | @@ -94,10 +94,10 @@ |
95 | 95 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
96 | 96 | ), |
97 | 97 | 'combined' => array( |
98 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 143 ), |
| 98 | + array( 'src' => 'js/plugins.combined.js', 'version' => 144 ), |
99 | 99 | ), |
100 | 100 | 'minified' => array( |
101 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 143 ), |
| 101 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 144 ), |
102 | 102 | ), |
103 | 103 | ), |
104 | 104 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -517,15 +517,16 @@ |
518 | 518 | sel.removeAllRanges(); |
519 | 519 | sel.addRange( range ); |
520 | 520 | context.$iframe[0].contentWindow.focus(); |
521 | | - } else if ( context.$iframe[0].contentWindow.document.selection ) { |
522 | | - // FIXME: IE is still broken for when sc or ec is the <body>, needs more tweaking |
523 | | - var range = document.selection.createRange(); |
| 521 | + } else if ( context.$iframe[0].contentWindow.document.body.createTextRange ) { |
| 522 | + // IE |
| 523 | + var range = context.$iframe[0].contentWindow.document.body.createTextRange(); |
524 | 524 | range.moveToElementText( sc ); |
525 | 525 | range.moveStart( 'character', options.start ); |
526 | | - var range2 = document.selection.createRange(); |
| 526 | + var range2 = context.$iframe[0].contentWindow.document.body.createTextRange(); |
527 | 527 | range2.moveToElementText( ec ); |
| 528 | + range2.collapse(); |
528 | 529 | range2.moveEnd( 'character', options.end ); |
529 | | - range.setEndPoint( EndToEnd, range2 ); |
| 530 | + range.setEndPoint( 'EndToEnd', range2 ); |
530 | 531 | range.select(); |
531 | 532 | } |
532 | 533 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6884,15 +6884,16 @@ |
6885 | 6885 | sel.removeAllRanges(); |
6886 | 6886 | sel.addRange( range ); |
6887 | 6887 | context.$iframe[0].contentWindow.focus(); |
6888 | | - } else if ( context.$iframe[0].contentWindow.document.selection ) { |
6889 | | - // FIXME: IE is still broken for when sc or ec is the <body>, needs more tweaking |
6890 | | - var range = document.selection.createRange(); |
| 6888 | + } else if ( context.$iframe[0].contentWindow.document.body.createTextRange ) { |
| 6889 | + // IE |
| 6890 | + var range = context.$iframe[0].contentWindow.document.body.createTextRange(); |
6891 | 6891 | range.moveToElementText( sc ); |
6892 | 6892 | range.moveStart( 'character', options.start ); |
6893 | | - var range2 = document.selection.createRange(); |
| 6893 | + var range2 = context.$iframe[0].contentWindow.document.body.createTextRange(); |
6894 | 6894 | range2.moveToElementText( ec ); |
| 6895 | + range2.collapse(); |
6895 | 6896 | range2.moveEnd( 'character', options.end ); |
6896 | | - range.setEndPoint( EndToEnd, range2 ); |
| 6897 | + range.setEndPoint( 'EndToEnd', range2 ); |
6897 | 6898 | range.select(); |
6898 | 6899 | } |
6899 | 6900 | }, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -453,7 +453,7 @@ |
454 | 454 | if(lastNode){context.fn.scrollToTop(lastNode);}}else if(context.$iframe[0].contentWindow.document.selection){} |
455 | 455 | context.$content.trigger('encapsulateSelection',[pre,options.peri,post,options.ownline,options.replace]);return context.$textarea;},'getCaretPosition':function(options){},'setSelection':function(options){var sc=options.startContainer,ec=options.endContainer;sc=sc.jquery?sc[0]:sc;ec=ec.jquery?ec[0]:ec;if(context.$iframe[0].contentWindow.getSelection){var sel=context.$iframe[0].contentWindow.getSelection();while(sc.firstChild&&sc.nodeName!='#text'){sc=sc.firstChild;} |
456 | 456 | while(ec.firstChild&&ec.nodeName!='#text'){ec=ec.firstChild;} |
457 | | -var range=document.createRange();range.setStart(sc,options.start);range.setEnd(ec,options.end);sel.removeAllRanges();sel.addRange(range);context.$iframe[0].contentWindow.focus();}else if(context.$iframe[0].contentWindow.document.selection){var range=document.selection.createRange();range.moveToElementText(sc);range.moveStart('character',options.start);var range2=document.selection.createRange();range2.moveToElementText(ec);range2.moveEnd('character',options.end);range.setEndPoint(EndToEnd,range2);range.select();}},'scrollToCaretPosition':function(options){},'scrollToTop':function($element,force){var html=context.$content.closest('html'),body=context.$content.closest('body'),parent=$('html');var y=$element.offset().top-context.$content.offset().top;y=parent.scrollTop()>0?y+html.scrollTop()-parent.scrollTop():y;if(force||y<html.scrollTop()||y>html.scrollTop()+context.$iframe.height()){html.scrollTop(y);} |
| 457 | +var range=document.createRange();range.setStart(sc,options.start);range.setEnd(ec,options.end);sel.removeAllRanges();sel.addRange(range);context.$iframe[0].contentWindow.focus();}else if(context.$iframe[0].contentWindow.document.body.createTextRange){var range=context.$iframe[0].contentWindow.document.body.createTextRange();range.moveToElementText(sc);range.moveStart('character',options.start);var range2=context.$iframe[0].contentWindow.document.body.createTextRange();range2.moveToElementText(ec);range2.collapse();range2.moveEnd('character',options.end);range.setEndPoint('EndToEnd',range2);range.select();}},'scrollToCaretPosition':function(options){},'scrollToTop':function($element,force){var html=context.$content.closest('html'),body=context.$content.closest('body'),parent=$('html');var y=$element.offset().top-context.$content.offset().top;y=parent.scrollTop()>0?y+html.scrollTop()-parent.scrollTop():y;if(force||y<html.scrollTop()||y>html.scrollTop()+context.$iframe.height()){html.scrollTop(y);} |
458 | 458 | $element.trigger('scrollToTop');},'beforeSelection':function(selector,strict){if(typeof selector=='undefined'){selector='*';} |
459 | 459 | var e;if(context.$iframe[0].contentWindow.getSelection){var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);e=range.startContainer;}else if(context.$iframe[0].contentWindow.document.selection){return $([]);} |
460 | 460 | if(e.nodeName!='#text'){var newE=e.firstChild;for(var i=0;i<range.startOffset-1&&newE;i++){newE=newE.nextSibling;} |