Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 14 ), |
75 | | - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 32 ), |
| 75 | + array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 33 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 187 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 62 ), |
— | — | @@ -83,10 +83,10 @@ |
84 | 84 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ), |
85 | 85 | ), |
86 | 86 | 'combined' => array( |
87 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 395 ), |
| 87 | + array( 'src' => 'js/plugins.combined.js', 'version' => 396 ), |
88 | 88 | ), |
89 | 89 | 'minified' => array( |
90 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 395 ), |
| 90 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 396 ), |
91 | 91 | ), |
92 | 92 | ), |
93 | 93 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | var caretPos = 0, endPos = 0; |
140 | 140 | if ( $.browser.msie ) { |
141 | 141 | // IE Support |
142 | | - var postFinished = false; |
| 142 | + var preFinished = false; |
143 | 143 | var periFinished = false; |
144 | 144 | var postFinished = false; |
145 | 145 | var preText, rawPreText, periText; |
— | — | @@ -167,15 +167,15 @@ |
168 | 168 | * not changed then we know that IE has trimmed a \r\n from the end. |
169 | 169 | */ |
170 | 170 | do { |
171 | | - if ( !postFinished ) { |
| 171 | + if ( !preFinished ) { |
172 | 172 | if ( preRange.compareEndPoints( "StartToEnd", preRange ) == 0 ) { |
173 | | - postFinished = true; |
| 173 | + preFinished = true; |
174 | 174 | } else { |
175 | 175 | preRange.moveEnd( "character", -1 ) |
176 | 176 | if ( preRange.text == preText ) { |
177 | 177 | rawPreText += "\r\n"; |
178 | 178 | } else { |
179 | | - postFinished = true; |
| 179 | + preFinished = true; |
180 | 180 | } |
181 | 181 | } |
182 | 182 | } |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | } |
205 | 205 | } |
206 | 206 | } |
207 | | - } while ( ( !postFinished || !periFinished || !postFinished ) ); |
| 207 | + } while ( ( !preFinished || !periFinished || !postFinished ) ); |
208 | 208 | caretPos = rawPreText.replace( /\r\n/g, "\n" ).length; |
209 | 209 | endPos = caretPos + rawPeriText.replace( /\r\n/g, "\n" ).length; |
210 | 210 | } else if ( e.selectionStart || e.selectionStart == '0' ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6342,7 +6342,7 @@ |
6343 | 6343 | var caretPos = 0, endPos = 0; |
6344 | 6344 | if ( $.browser.msie ) { |
6345 | 6345 | // IE Support |
6346 | | - var postFinished = false; |
| 6346 | + var preFinished = false; |
6347 | 6347 | var periFinished = false; |
6348 | 6348 | var postFinished = false; |
6349 | 6349 | var preText, rawPreText, periText; |
— | — | @@ -6371,15 +6371,15 @@ |
6372 | 6372 | * not changed then we know that IE has trimmed a \r\n from the end. |
6373 | 6373 | */ |
6374 | 6374 | do { |
6375 | | - if ( !postFinished ) { |
| 6375 | + if ( !preFinished ) { |
6376 | 6376 | if ( preRange.compareEndPoints( "StartToEnd", preRange ) == 0 ) { |
6377 | | - postFinished = true; |
| 6377 | + preFinished = true; |
6378 | 6378 | } else { |
6379 | 6379 | preRange.moveEnd( "character", -1 ) |
6380 | 6380 | if ( preRange.text == preText ) { |
6381 | 6381 | rawPreText += "\r\n"; |
6382 | 6382 | } else { |
6383 | | - postFinished = true; |
| 6383 | + preFinished = true; |
6384 | 6384 | } |
6385 | 6385 | } |
6386 | 6386 | } |
— | — | @@ -6407,7 +6407,7 @@ |
6408 | 6408 | } |
6409 | 6409 | } |
6410 | 6410 | } |
6411 | | - } while ( ( !postFinished || !periFinished || !postFinished ) ); |
| 6411 | + } while ( ( !preFinished || !periFinished || !postFinished ) ); |
6412 | 6412 | caretPos = rawPreText.replace( /\r\n/g, "\n" ).length; |
6413 | 6413 | endPos = caretPos + rawPeriText.replace( /\r\n/g, "\n" ).length; |
6414 | 6414 | } else if ( e.selectionStart || e.selectionStart == '0' ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -422,12 +422,12 @@ |
423 | 423 | var range3=document.selection.createRange();range3.collapse(false);range3.moveEnd('character',1);if(range3.text!="\r"&&range3.text!="\n"&&range3.text!=""){options.post+="\n";}} |
424 | 424 | checkSelectedText();range.text=options.pre+selText+options.post;if(isSample&&range.moveStart){range.moveStart('character',-options.post.length-selText.length);range.moveEnd('character',-options.post.length);} |
425 | 425 | range.select();this.scrollTop=scrollTop;} |
426 | | -$(this).trigger('encapsulateSelection',[options.pre,options.peri,options.post,options.ownline,options.replace]);});},getCaretPosition:function(options){function getCaret(e){var caretPos=0,endPos=0;if($.browser.msie){var postFinished=false;var periFinished=false;var postFinished=false;var preText,rawPreText,periText;var rawPeriText,postText,rawPostText;var periRange=document.selection.createRange().duplicate();var preRange=document.body.createTextRange();preRange.moveToElementText(e);preRange.setEndPoint("EndToStart",periRange);var postRange=document.body.createTextRange();postRange.moveToElementText(e);postRange.setEndPoint("StartToEnd",periRange);preText=rawPreText=preRange.text;periText=rawPeriText=periRange.text;postText=rawPostText=postRange.text;do{if(!postFinished){if(preRange.compareEndPoints("StartToEnd",preRange)==0){postFinished=true;}else{preRange.moveEnd("character",-1) |
427 | | -if(preRange.text==preText){rawPreText+="\r\n";}else{postFinished=true;}}} |
| 426 | +$(this).trigger('encapsulateSelection',[options.pre,options.peri,options.post,options.ownline,options.replace]);});},getCaretPosition:function(options){function getCaret(e){var caretPos=0,endPos=0;if($.browser.msie){var preFinished=false;var periFinished=false;var postFinished=false;var preText,rawPreText,periText;var rawPeriText,postText,rawPostText;var periRange=document.selection.createRange().duplicate();var preRange=document.body.createTextRange();preRange.moveToElementText(e);preRange.setEndPoint("EndToStart",periRange);var postRange=document.body.createTextRange();postRange.moveToElementText(e);postRange.setEndPoint("StartToEnd",periRange);preText=rawPreText=preRange.text;periText=rawPeriText=periRange.text;postText=rawPostText=postRange.text;do{if(!preFinished){if(preRange.compareEndPoints("StartToEnd",preRange)==0){preFinished=true;}else{preRange.moveEnd("character",-1) |
| 427 | +if(preRange.text==preText){rawPreText+="\r\n";}else{preFinished=true;}}} |
428 | 428 | if(!periFinished){if(periRange.compareEndPoints("StartToEnd",periRange)==0){periFinished=true;}else{periRange.moveEnd("character",-1) |
429 | 429 | if(periRange.text==periText){rawPeriText+="\r\n";}else{periFinished=true;}}} |
430 | 430 | if(!postFinished){if(postRange.compareEndPoints("StartToEnd",postRange)==0){postFinished=true;}else{postRange.moveEnd("character",-1) |
431 | | -if(postRange.text==postText){rawPostText+="\r\n";}else{postFinished=true;}}}}while((!postFinished||!periFinished||!postFinished));caretPos=rawPreText.replace(/\r\n/g,"\n").length;endPos=caretPos+rawPeriText.replace(/\r\n/g,"\n").length;}else if(e.selectionStart||e.selectionStart=='0'){caretPos=e.selectionStart;endPos=e.selectionEnd;} |
| 431 | +if(postRange.text==postText){rawPostText+="\r\n";}else{postFinished=true;}}}}while((!preFinished||!periFinished||!postFinished));caretPos=rawPreText.replace(/\r\n/g,"\n").length;endPos=caretPos+rawPeriText.replace(/\r\n/g,"\n").length;}else if(e.selectionStart||e.selectionStart=='0'){caretPos=e.selectionStart;endPos=e.selectionEnd;} |
432 | 432 | return options.startAndEnd?[caretPos,endPos]:caretPos;} |
433 | 433 | return getCaret(this.get(0));},setSelection:function(options){return this.each(function(){if($(this).is(':hidden')){}else if(this.selectionStart||this.selectionStart=='0'){if(options.start>this.selectionEnd){this.selectionEnd=options.end;this.selectionStart=options.start;}else{this.selectionStart=options.start;this.selectionEnd=options.end;}}else if(document.body.createTextRange){var selection=document.body.createTextRange();selection.moveToElementText(this);var length=this.value.length;var newLines=this.value.match(/\n/g);if(newLines)length=length-newLines.length;selection.moveStart('character',options.start);selection.moveEnd('character',-length+options.end);selection.select();}});},scrollToCaretPosition:function(options){function getLineLength(e){return Math.floor(e.scrollWidth/($.os.name=='linux'?7:8));} |
434 | 434 | function getCaretScrollPosition(e){var text=e.value.replace(/\r/g,"");var caret=$(e).textSelection('getCaretPosition');var lineLength=getLineLength(e);var row=0;var charInLine=0;var lastSpaceInLine=0;for(i=0;i<caret;i++){charInLine++;if(text.charAt(i)==" "){lastSpaceInLine=charInLine;}else if(text.charAt(i)=="\n"){lastSpaceInLine=0;charInLine=0;row++;} |