r91329 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91328‎ | r91329 | r91330 >
Date:23:47, 1 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed position to location
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -16,7 +16,7 @@
1717 block = $block.data( 'block' );
1818 var position = new Position(e.pageX - $block.offset().left, e.pageY - $block.offset().top);
1919 var offest = block.flow.getOffset( position );
20 - block.insertContent(offest, '___!___');
 20+ block.insertContent(offest, '!');
2121 //this.setCursor(new Location(block, offset))
2222 });
2323 }
Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -80,9 +80,14 @@
8181 var $ruler = $( '<div class="editSurface-line"></div>' ).appendTo( this.$ )
8282 ruler = $ruler[0],
8383 fit = this.fitCharacters( this.lines[line].start, this.lines[line].end, ruler, position.x );
 84+ ruler.innerHTML = this.escape( this.text.substring( this.lines[line].start, fit.end ) );
 85+ var left = ruler.clientWidth;
 86+ ruler.innerHTML = this.escape( this.text.substring( this.lines[line].start, fit.end + 1 ) );
 87+ var right = ruler.clientWidth;
 88+ var center = Math.round( left + ( ( right - left ) / 2 ) );
8489 $ruler.remove();
85 -
86 - return fit.end;
 90+ console.log(left, center, right, position.x);
 91+ return fit.end + ( position.x >= center ? 1 : 0 );
8792 };
8893
8994 /**

Status & tagging log