r101573 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101572‎ | r101573 | r101574 >
Date:02:01, 2 November 2011
Author:inez
Status:deferred
Tags:
Comment:
Support different "words" as a boundaries than just space
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/views/es.SurfaceView.js
@@ -78,6 +78,8 @@
7979 this.documentView.renderContent();
8080 };
8181
 82+es.SurfaceView.boundaries = [' ', '-', '\t', '\r', '\n', '\f'];
 83+
8284 es.SurfaceView.prototype.onMouseDown = function( e ) {
8385 var offset = this.documentView.getOffsetFromEvent( e );
8486 this.showCursor( offset );
@@ -154,8 +156,7 @@
155157 var end = this.documentView.getRenderedLineRange( this.cursor.offset ).end
156158 var data = this.documentView.getModel().data;
157159 if ( es.DocumentModel.isContentData( data, end ) ) {
158 - // TODO: Support all of this /([ \-\t\r\n\f])/g, not just space
159 - while( data[ end - 1] === ' ' ) {
 160+ while( $.inArray( data[ end - 1 ], es.SurfaceView.boundaries ) ) {
160161 end--;
161162 }
162163 }

Status & tagging log