Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -153,7 +153,7 @@ |
154 | 154 | array( |
155 | 155 | 'src' => 'js/plugins/jquery.wikiEditor.js', |
156 | 156 | 'class' => 'j.wikiEditor', |
157 | | - 'version' => 54 |
| 157 | + 'version' => 55 |
158 | 158 | ), |
159 | 159 | array( |
160 | 160 | 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', |
— | — | @@ -191,10 +191,10 @@ |
192 | 192 | 'version' => 1 ), |
193 | 193 | ), |
194 | 194 | 'combined' => array( |
195 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 157 ), |
| 195 | + array( 'src' => 'js/plugins.combined.js', 'version' => 158 ), |
196 | 196 | ), |
197 | 197 | 'minified' => array( |
198 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 157 ), |
| 198 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 158 ), |
199 | 199 | ), |
200 | 200 | ), |
201 | 201 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -587,6 +587,8 @@ |
588 | 588 | var e; |
589 | 589 | if ( context.$iframe[0].contentWindow.getSelection ) { |
590 | 590 | // Firefox and Opera |
| 591 | + // This needs to be here for webkit, or the selection is invalid |
| 592 | + context.$iframe[0].contentWindow.focus(); |
591 | 593 | var range = context.$iframe[0].contentWindow.getSelection().getRangeAt( 0 ); |
592 | 594 | // Start at the selection's start and traverse the DOM backwards |
593 | 595 | // This is done by traversing an element's children first, then the |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7068,6 +7068,8 @@ |
7069 | 7069 | var e; |
7070 | 7070 | if ( context.$iframe[0].contentWindow.getSelection ) { |
7071 | 7071 | // Firefox and Opera |
| 7072 | + // This needs to be here for webkit, or the selection is invalid |
| 7073 | + context.$iframe[0].contentWindow.focus(); |
7072 | 7074 | var range = context.$iframe[0].contentWindow.getSelection().getRangeAt( 0 ); |
7073 | 7075 | // Start at the selection's start and traverse the DOM backwards |
7074 | 7076 | // This is done by traversing an element's children first, then the |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -463,7 +463,7 @@ |
464 | 464 | var range=context.$iframe[0].contentWindow.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'),parentHtml=$('html'),parentBody=$('body');var y=$element.offset().top;if(!$.browser.msie){y=parentHtml.scrollTop()>0?y+html.scrollTop()-parentHtml.scrollTop():y;y=parentBody.scrollTop()>0?y+body.scrollTop()-parentBody.scrollTop():y;} |
465 | 465 | if(force||y<html.scrollTop()||y>html.scrollTop()+context.$iframe.height()){html.scrollTop(y);body.scrollTop(y);} |
466 | 466 | $element.trigger('scrollToTop');},'beforeSelection':function(selector,strict){if(typeof selector=='undefined'){selector='*';} |
467 | | -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 $([]);} |
| 467 | +var e;if(context.$iframe[0].contentWindow.getSelection){context.$iframe[0].contentWindow.focus();var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);e=range.startContainer;}else if(context.$iframe[0].contentWindow.document.selection){return $([]);} |
468 | 468 | if(e.nodeName!='#text'){var newE=e.firstChild;for(var i=0;i<range.startOffset-1&&newE;i++){newE=newE.nextSibling;} |
469 | 469 | while(newE&&newE.lastChild){newE=newE.lastChild;} |
470 | 470 | e=newE;} |