https://www.mediawiki.org/wiki/Special:Code/MediaWiki/101831
Revision: 101831 Author: tparscal Date: 2011-11-03 16:33:10 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Using content.range.* instead of content.* for start and end properties of content objects when converting from plain objects into flat data Modified Paths: -------------- trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js Modified: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js =================================================================== --- trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js 2011-11-03 16:28:04 UTC (rev 101830) +++ trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js 2011-11-03 16:33:10 UTC (rev 101831) @@ -424,17 +424,17 @@ // Add a hash to the annotation for faster comparison dst.hash = es.DocumentModel.getAnnotationHash( dst ); // Apply annotation to range - if ( src.start < 0 ) { + if ( src.range.start < 0 ) { // TODO: The start can not be lower than 0! Throw error? // Clamp start value - src.start = 0; + src.range.start = 0; } - if ( src.end > data.length ) { + if ( src.range.end > data.length ) { // TODO: The end can not be higher than the length! Throw error? // Clamp end value - src.end = data.length; + src.range.end = data.length; } - for ( var j = src.start; j < src.end; j++ ) { + for ( var j = src.range.start; j < src.range.end; j++ ) { // Auto-convert to array if ( typeof data[j] === 'string' ) { data[j] = [data[j]]; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs