r101893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101892‎ | r101893 | r101894 >
Date:22:03, 3 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Line breaks
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js
@@ -173,13 +173,15 @@
174174 return [ { 'node': this.children[i] } ];
175175 }
176176 if ( start == left - 1 ) {
177 - // start is between this.children[i-1] and this.children[i], move it to left for convenience
 177+ // start is between this.children[i-1] and this.children[i], move it to left for
 178+ // convenience
178179 // We don't need to check for start < end here because we already have start != end and
179180 // start <= end
180181 start = left;
181182 }
182183 if ( end == right + 1 ) {
183 - // end is between this.children[i] and this.children[i+1], move it to right for convenience
 184+ // end is between this.children[i] and this.children[i+1], move it to right for
 185+ // convenience
184186 // We don't need to check for start < end here because we already have start != end and
185187 // start <= end
186188 end = right;
@@ -191,18 +193,22 @@
192194 if ( startInside && endInside ) {
193195 // The range is entirely inside this.children[i]
194196 if ( shallow ) {
195 - nodes = [{ 'node': this.children[i], 'range': new es.Range( start - left, end - left ) }];
 197+ nodes = [
 198+ { 'node': this.children[i], 'range': new es.Range( start - left, end - left ) }
 199+ ];
196200 } else {
197201 // Recurse into this.children[i]
198202 nodes = this.children[i].selectNodes( new es.Range( start - left, end - left ) );
199203 }
200 - // Since the start and end are both inside this.children[i], we know for sure that we're done, so
201 - // return
 204+ // Since the start and end are both inside this.children[i], we know for sure that we're
 205+ // done, so return
202206 return nodes;
203207 } else if ( startInside ) {
204208 // The start is inside this.children[i] but the end isn't
205209 // Add a range from the start of the range to the end of this.children[i]
206 - nodes.push( { 'node': this.children[i], 'range': new es.Range( start - left, right - left ) } );
 210+ nodes.push(
 211+ { 'node': this.children[i], 'range': new es.Range( start - left, right - left ) }
 212+ );
207213 } else if ( endInside ) {
208214 // The end is inside this.children[i] but the start isn't
209215 // Add a range from the start of this.children[i] to the end of the range
@@ -217,7 +223,8 @@
218224 }
219225
220226 // Move left to the start of this.children[i+1] for the next iteration
221 - // +2 because we need to jump over the offset between this.children[i] and this.children[i+1]
 227+ // We use +2 because we need to jump over the offset between this.children[i] and
 228+ // this.children[i+1]
222229 left = right + 2;
223230 }
224231

Status & tagging log