r91998 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91997‎ | r91998 | r91999 >
Date:20:22, 12 July 2011
Author:junaidpv
Status:ok
Tags:
Comment:
Making data key names to camelCase to escape from jQuery bug (http://bugs.jquery.com/ticket/9301)
Modified paths:
  • /trunk/extensions/Narayam/ext.narayam.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/ext.narayam.core.js
@@ -165,7 +165,7 @@
166166
167167 if ( e.which == 8 ) { // Backspace
168168 // Blank the keybuffer
169 - $( this ).data( 'narayam-keyBuffer', '' );
 169+ $( this ).data( 'narayamKeyBuffer', '' );
170170 return true;
171171 }
172172
@@ -187,7 +187,7 @@
188188 // to provide context for the transliteration regexes.
189189 // We need to append c because it hasn't been added to $this.val() yet
190190 var input = lastNChars( $this.val(), startPos, currentScheme.lookbackLength ) + c;
191 - var keyBuffer = $this.data( 'narayam-keyBuffer' );
 191+ var keyBuffer = $this.data( 'narayamKeyBuffer' );
192192 var replacement = transliterate( input, keyBuffer, e.altKey );
193193
194194 // Update the key buffer
@@ -196,7 +196,7 @@
197197 // The buffer is longer than needed, truncate it at the front
198198 keyBuffer = keyBuffer.substring( keyBuffer.length - currentScheme.keyBufferLength );
199199 }
200 - $this.data( 'narayam-keyBuffer', keyBuffer );
 200+ $this.data( 'narayamKeyBuffer', keyBuffer );
201201
202202 // textSelection() magic is expensive, so we avoid it as much as we can
203203 if ( replacement == input ) {
@@ -245,7 +245,7 @@
246246 $newInputs
247247 .bind( 'keydown.narayam', onkeydown )
248248 .bind( 'keypress.narayam', onkeypress )
249 - .data( 'narayam-keyBuffer', '' );
 249+ .data( 'narayamKeyBuffer', '' );
250250 if ( enabled ) {
251251 $newInputs.addClass( 'narayam-input' );
252252 }

Status & tagging log