http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82947
Revision: 82947
Author: catrope
Date: 2011-02-28 18:42:02 +0000 (Mon, 28 Feb 2011)
Log Message:
-----------
Narayam: Followup r82890: fix whitespace, rephrase comment
Modified Paths:
--------------
trunk/extensions/Narayam/ext.narayam.core.js
Modified: trunk/extensions/Narayam/ext.narayam.core.js
===================================================================
--- trunk/extensions/Narayam/ext.narayam.core.js 2011-02-28 18:39:32 UTC
(rev 82946)
+++ trunk/extensions/Narayam/ext.narayam.core.js 2011-02-28 18:42:02 UTC
(rev 82947)
@@ -155,13 +155,12 @@
var $this = $( this );
var c = String.fromCharCode( e.which );
- // Get current caret position
- // User may select text to overwrite
- // Get start and end position of selection
- // In case if user do no selection, both startPos and endPos
will be same
+ // Get the current caret position. The user may have selected
text to overwrite,
+ // so get both the start and end position of the selection. If
there is no selection,
+ // startPos and endPos will be equal.
var pos = $this.textSelection( 'getCaretPosition', {
'startAndEnd': true } );
- var startPos = pos[0];
- var endPos = pos[1];
+ var startPos = pos[0];
+ var endPos = pos[1];
// Get the last few characters before the one the user just
typed,
// to provide context for the transliteration regexes.
// We need to append c because it hasn't been added to
$this.val() yet
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs