r64441 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64440‎ | r64441 | r64442 >
Date:15:45, 31 March 2010
Author:adam
Status:ok
Tags:
Comment:
Followup to r64439. Fixing a bug that was causing an error in anything that wasn't IE
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -71,7 +71,7 @@
7272 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ),
7373 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 9 ),
75 - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 29 ),
 75+ array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 30 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 179 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 54 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 371 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 372 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 371 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 372 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js
@@ -313,7 +313,6 @@
314314 * character back and forth.
315315 */
316316 var range = document.body.createTextRange();
317 - // store the current selection so we can reselect it later
318317 var savedRange = document.selection.createRange();
319318 var pos = $(this).textSelection( 'getCaretPosition' );
320319 var oldScrollTop = this.scrollTop;
@@ -327,8 +326,8 @@
328327 range.move( 'character', -1 );
329328 range.select();
330329 }
 330+ savedRange.select();
331331 }
332 - savedRange.select();
333332 $(this).trigger( 'scrollToPosition' );
334333 } );
335334 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6480,7 +6480,6 @@
64816481 * character back and forth.
64826482 */
64836483 var range = document.body.createTextRange();
6484 - // store the current selection so we can reselect it later
64856484 var savedRange = document.selection.createRange();
64866485 var pos = $(this).textSelection( 'getCaretPosition' );
64876486 var oldScrollTop = this.scrollTop;
@@ -6494,8 +6493,8 @@
64956494 range.move( 'character', -1 );
64966495 range.select();
64976496 }
 6497+ savedRange.select();
64986498 }
6499 - savedRange.select();
65006499 $(this).trigger( 'scrollToPosition' );
65016500 } );
65026501 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -438,8 +438,9 @@
439439 return($.os.name=='mac'?13:($.os.name=='linux'?15:16))*row;}
440440 return this.each(function(){if($(this).is(':hidden')){}else if(this.selectionStart||this.selectionStart=='0'){var scroll=getCaretScrollPosition(this);if(options.force||scroll<$(this).scrollTop()||scroll>$(this).scrollTop()+$(this).height())
441441 $(this).scrollTop(scroll);}else if(document.selection&&document.selection.createRange){var range=document.body.createTextRange();var savedRange=document.selection.createRange();var pos=$(this).textSelection('getCaretPosition');var oldScrollTop=this.scrollTop;range.moveToElementText(this);range.collapse();range.move('character',pos+1);range.select();if(this.scrollTop!=oldScrollTop)
442 -this.scrollTop+=range.offsetTop;else if(options.force){range.move('character',-1);range.select();}}
443 -savedRange.select();$(this).trigger('scrollToPosition');});}};switch(command){case'encapsulateSelection':options=$.extend({'pre':'','peri':'','post':'','ownline':false,'replace':false},options);break;case'getCaretPosition':options=$.extend({'startAndEnd':false},options);break;case'setSelection':options=$.extend({'start':undefined,'end':undefined,'startContainer':undefined,'endContainer':undefined},options);if(options.end===undefined)
 442+this.scrollTop+=range.offsetTop;else if(options.force){range.move('character',-1);range.select();}
 443+savedRange.select();}
 444+$(this).trigger('scrollToPosition');});}};switch(command){case'encapsulateSelection':options=$.extend({'pre':'','peri':'','post':'','ownline':false,'replace':false},options);break;case'getCaretPosition':options=$.extend({'startAndEnd':false},options);break;case'setSelection':options=$.extend({'start':undefined,'end':undefined,'startContainer':undefined,'endContainer':undefined},options);if(options.end===undefined)
444445 options.end=options.start;if(options.endContainer==undefined)
445446 options.endContainer=options.startContainer;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;}
446447 var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;var needSave=false;if(hasIframe&&context.savedSelection!==null){context.fn.restoreSelection();needSave=true;}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64439Altering scrollToPosition() in the textSelection plugin so that it doesn't cl...adam15:15, 31 March 2010

Status & tagging log