r99208 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99207‎ | r99208 | r99209 >
Date:12:34, 7 October 2011
Author:inez
Status:deferred
Tags:
Comment:
Support for cursor display in Headings, Lists and Tables
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/views/es.HeadingBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
@@ -76,7 +76,12 @@
7777 * @returns {es.Position} Position of offset
7878 */
7979 es.ListBlockItemView.prototype.getRenderedPosition = function( offset ) {
80 - return this.contentView.getPosition( position );
 80+ var position = this.contentView.getPosition( offset ),
 81+ offset = this.$content.offset();
 82+ position.top += offset.top;
 83+ position.left += offset.left;
 84+ position.bottom += offset.top;
 85+ return position;
8186 };
8287
8388 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
@@ -94,7 +94,11 @@
9595 * @returns {es.Position} Position of offset
9696 */
9797 es.ListBlockView.prototype.getRenderedPosition = function( offset ) {
98 - // TODO
 98+ var item = this.items.lookup( offset );
 99+ if ( item !== null ) {
 100+ return item.getRenderedPosition( offset - this.items.offsetOf( item ) );
 101+ }
 102+ return null;
99103 };
100104
101105 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.HeadingBlockView.js
@@ -40,7 +40,6 @@
4141 es.HeadingBlockView.prototype.getRenderedPosition = function( offset ) {
4242 var position = this.contentView.getPosition( offset ),
4343 offset = this.$.offset();
44 -
4544 position.top += offset.top;
4645 position.left += offset.left;
4746 position.bottom += offset.top;
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
@@ -90,7 +90,11 @@
9191 * @returns {es.Position} Position of offset
9292 */
9393 es.TableBlockRowView.prototype.getRenderedPosition = function( offset ) {
94 - // TODO
 94+ var item = this.items.lookup( offset );
 95+ if ( item !== null ) {
 96+ return item.getRenderedPosition( offset - this.items.offsetOf( item ) );
 97+ }
 98+ return null;
9599 };
96100
97101 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js
@@ -69,7 +69,12 @@
7070 * @returns {es.Position} Position of offset
7171 */
7272 es.ParagraphBlockView.prototype.getRenderedPosition = function( offset ) {
73 - return this.contentView.getPosition( position );
 73+ var position = this.contentView.getPosition( offset ),
 74+ offset = this.$.offset();
 75+ position.top += offset.top;
 76+ position.left += offset.left;
 77+ position.bottom += offset.top;
 78+ return position;
7479 };
7580
7681 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
@@ -89,7 +89,11 @@
9090 * @returns {es.Position} Position of offset
9191 */
9292 es.TableBlockCellView.prototype.getRenderedPosition = function( offset ) {
93 - // TODO
 93+ var item = this.items.lookup( offset );
 94+ if ( item !== null ) {
 95+ return item.getRenderedPosition( offset - this.items.offsetOf( item ) );
 96+ }
 97+ return null;
9498 };
9599
96100 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js
@@ -91,7 +91,11 @@
9292 * @returns {es.Position} Position of offset
9393 */
9494 es.TableBlockView.prototype.getRenderedPosition = function( offset ) {
95 - // TODO
 95+ var item = this.items.lookup( offset );
 96+ if ( item !== null ) {
 97+ return item.getRenderedPosition( offset - this.items.offsetOf( item ) );
 98+ }
 99+ return null;
96100 };
97101
98102 /**

Status & tagging log