r103419 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103418‎ | r103419 | r103420 >
Date:23:57, 16 November 2011
Author:tparscal
Status:deferred (Comments)
Tags:
Comment:
Made it so <p>|</p> is not considered to be a structural offset
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js
@@ -429,6 +429,9 @@
430430 }
431431 // Structual offsets will have elements on each side
432432 if ( data[offset - 1].type !== undefined && data[offset].type !== undefined ) {
 433+ if ( '/' + data[offset - 1].type === data[offset].type ) {
 434+ return false;
 435+ }
433436 return true;
434437 }
435438 return false;
@@ -630,9 +633,7 @@
631634 * @param {Integer} Offset a given distance from the given offset
632635 */
633636 es.DocumentModel.prototype.getRelativeContentOffset = function( offset, distance ) {
634 - if ( es.DocumentModel.isStructuralOffset( this.data, offset ) ) {
635 - throw 'Invalid offset error. Can not get relative content offset from non-content offset.';
636 - }
 637+ console.log(offset);
637638 if ( distance === 0 ) {
638639 return offset;
639640 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r103477Commented out some console.log statementstparscal17:59, 17 November 2011

Comments

#Comment by Catrope (talk | contribs)   12:48, 17 November 2011
-	if ( es.DocumentModel.isStructuralOffset( this.data, offset ) ) {
-		throw 'Invalid offset error. Can not get relative content offset from non-content offset.';
-	}
+	console.log(offset);

Are these debugging changes?

OK otherwise

#Comment by Trevor Parscal (WMF) (talk | contribs)   18:00, 17 November 2011

The console.log wasn't supposed to stay there. I commented it out in r103477

Status & tagging log