r101494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101493‎ | r101494 | r101495 >
Date:16:20, 1 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed some 100 character line breaks and some jshint issues.
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/bases/es.DocumentNode.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.ContentView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/bases/es.DocumentNode.js
@@ -146,12 +146,14 @@
147147 }
148148 if ( start == left - 1 ) {
149149 // start is between this[i-1] and this[i], move it to left for convenience
150 - // We don't need to check for start < end here because we already have start != end and start <= end
 150+ // We don't need to check for start < end here because we already have start != end and
 151+ // start <= end
151152 start = left;
152153 }
153154 if ( end == right + 1 ) {
154155 // end is between this[i] and this[i+1], move it to right for convenience
155 - // We don't need to check for start < end here because we already have start != end and start <= end
 156+ // We don't need to check for start < end here because we already have start != end and
 157+ // start <= end
156158 end = right;
157159 }
158160
@@ -166,7 +168,8 @@
167169 // Recurse into this[i]
168170 nodes = this[i].selectNodes( new es.Range( start - left, end - left ) );
169171 }
170 - // Since the start and end are both inside this[i], we know for sure that we're done, so return
 172+ // Since the start and end are both inside this[i], we know for sure that we're done, so
 173+ // return
171174 return nodes;
172175 } else if ( startInside ) {
173176 // The start is inside this[i] but the end isn't
Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js
@@ -350,15 +350,15 @@
351351 */
352352 var $ruler = $( '<div class="editSurface-ruler"></div>' ).appendTo( this.$ ),
353353 ruler = $ruler[0],
354 - fit = this.fitCharacters( line.range, ruler, position.left );
 354+ fit = this.fitCharacters( line.range, ruler, position.left ),
 355+ center;
355356 ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end ) );
356357 if ( fit.end < this.model.getContentLength() ) {
357358 var left = ruler.clientWidth;
358359 ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end + 1 ) );
359 - var right = ruler.clientWidth;
360 - var center = Math.round( left + ( ( right - left ) / 2 ) );
 360+ center = Math.round( left + ( ( ruler.clientWidth - left ) / 2 ) );
361361 } else {
362 - var center = ruler.clientWidth;
 362+ center = ruler.clientWidth;
363363 }
364364 $ruler.remove();
365365 // Reset RegExp object's state

Status & tagging log