r97302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97301‎ | r97302 | r97303 >
Date:18:04, 16 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Removed dynamic property names from base container and container item classes
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.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/models/es.DocumentModel.js
@@ -3,14 +3,14 @@
44 *
55 * @class
66 * @constructor
7 - * @param blocks {Array}
 7+ * @param items {Array}
88 * @param attributes {Object}
9 - * @property blocks {Array}
 9+ * @property items {Array}
1010 * @property attributes {Object}
1111 */
1212 es.DocumentModel = function( blocks, attributes ) {
13 - es.ModelContainer.call( this, 'blocks' );
14 - this.blocks = new es.AggregateArray( blocks || [] );
 13+ es.ModelContainer.call( this );
 14+ this.items = new es.AggregateArray( blocks || [] );
1515 this.attributes = attributes || {};
1616 };
1717
@@ -39,10 +39,10 @@
4040
4141 es.DocumentModel.prototype.getPlainObject = function() {
4242 var obj = {};
43 - if ( this.blocks.length ) {
 43+ if ( this.items.length ) {
4444 obj.blocks = [];
45 - for ( var i = 0; i < this.blocks.length; i++ ) {
46 - obj.blocks.push( this.blocks[i].getPlainObject() );
 45+ for ( var i = 0; i < this.items.length; i++ ) {
 46+ obj.blocks.push( this.items[i].getPlainObject() );
4747 }
4848 }
4949 if ( !$.isEmptyObject( this.attributes ) ) {
@@ -57,7 +57,7 @@
5858 * @returns {Integer}
5959 */
6060 es.DocumentModel.prototype.getContentLength = function() {
61 - return this.blocks.getContentLength();
 61+ return this.items.getContentLength();
6262 };
6363
6464 es.extend( es.DocumentModel, es.ModelContainer );
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
@@ -9,7 +9,7 @@
1010 * @property attributes {Object}
1111 */
1212 es.TableBlockCellModel = function( documentModel, attributes ) {
13 - es.ModelContainerItem.call( this, 'row' );
 13+ es.ModelContainerItem.call( this );
1414 this.documentModel = documentModel || null;
1515 this.attributes = attributes || {};
1616 };
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
@@ -9,7 +9,7 @@
1010 * @property styles {Array}
1111 */
1212 es.ListBlockItemModel = function( content, styles ) {
13 - es.ModelContainerItem.call( this, 'list' );
 13+ es.ModelContainerItem.call( this );
1414 this.content = content || null;
1515 this.styles = styles || ['bullet'];
1616 };
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
@@ -3,18 +3,18 @@
44 *
55 * @class
66 * @constructor
7 - * @param cells {Array}
 7+ * @param items {Array}
88 * @param attributes {Object}
9 - * @property cells {Array}
 9+ * @property items {Array}
1010 * @property attributes {Object}
1111 */
12 -es.TableBlockRowModel = function( cells, attributes ) {
13 - es.ModelContainerItem.call( this, 'table' );
 12+es.TableBlockRowModel = function( items, attributes ) {
 13+ es.ModelContainerItem.call( this );
1414 es.ModelContainer.call( this );
1515
16 - if ( $.isArray( cells ) ) {
17 - for ( var i = 0; i < cells.length; i++ ) {
18 - this.append( cells[i] );
 16+ if ( $.isArray( items ) ) {
 17+ for ( var i = 0; i < items.length; i++ ) {
 18+ this.append( items[i] );
1919 }
2020 }
2121
@@ -56,7 +56,7 @@
5757 * @returns {Integer} Length of all content
5858 */
5959 es.TableBlockRowModel.prototype.getContentLength = function() {
60 - return this.cells.getContentLength();
 60+ return this.items.getContentLength();
6161 };
6262
6363 /**
@@ -68,9 +68,9 @@
6969 es.TableBlockRowModel.prototype.getPlainObject = function() {
7070 /*
7171 var obj = {};
72 - if ( this.cells.length ) {
73 - obj.cells = $.map( this.cells, function( cell ) {
74 - return cell.getPlainObject();
 72+ if ( this.items.length ) {
 73+ obj.cells = $.map( this.items, function( item ) {
 74+ return item.getPlainObject();
7575 } );
7676 }
7777 if ( !$.isEmptyObject( this.attributes ) ) {
@@ -83,4 +83,4 @@
8484 /* Inheritance */
8585
8686 es.extend( es.TableBlockRowModel, es.ModelContainerItem );
87 -es.extend( es.TableBlockRowModel, es.ModelContainer );
\ No newline at end of file
 87+es.extend( es.TableBlockRowModel, es.ModelContainer );
Index: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
@@ -4,22 +4,17 @@
55 * @class
66 * @constructor
77 * @extends {es.EventEmitter}
8 - * @param containerName {String} Name of container type
9 - * @property [containerName] {Object} Reference to container, if attached
 8+ * @property container {Object} Reference to container, if attached
109 */
11 -es.ModelContainerItem = function( containerName ) {
 10+es.ModelContainerItem = function() {
1211 es.EventEmitter.call( this );
13 - if ( typeof containerName !== 'string' ) {
14 - containerName = 'container';
15 - }
16 - this._containerName = containerName;
17 - this[this._containerName] = null;
 12+ this.container = null;
1813 };
1914
2015 /* Methods */
2116
2217 es.ModelContainerItem.prototype.parent = function() {
23 - return this[this._containerName];
 18+ return this.container;
2419 };
2520
2621 /**
@@ -37,7 +32,7 @@
3833 * @emits "attach" with container argument
3934 */
4035 es.ModelContainerItem.prototype.attach = function( container ) {
41 - this[this._containerName] = container;
 36+ this.container = container;
4237 this.emit( 'attach', container );
4338 };
4439
@@ -48,8 +43,8 @@
4944 * @emits "detach" with container argument
5045 */
5146 es.ModelContainerItem.prototype.detach = function() {
52 - var container = this[this._containerName];
53 - this[this._containerName] = null;
 47+ var container = this.container;
 48+ this.container = null;
5449 this.emit( 'detach', container );
5550 };
5651
@@ -63,7 +58,7 @@
6459 */
6560 es.ModelContainerItem.prototype.getIndex = function() {
6661 try {
67 - var index = this[this._containerName].indexOf( this );
 62+ var index = this.container.indexOf( this );
6863 if ( index === -1 ) {
6964 throw 'Unknown item error. Can not get index of item that is not in a container. ' + e;
7065 }
@@ -82,7 +77,7 @@
8378 */
8479 es.ModelContainerItem.prototype.previous = function() {
8580 try {
86 - return this[this._containerName].get( this[this._containerName].indexOf( this ) - 1 );
 81+ return this.container.get( this.container.indexOf( this ) - 1 );
8782 } catch ( e ) {
8883 throw 'Missing container error. Can not get previous item in missing container. ' + e;
8984 }
@@ -97,7 +92,7 @@
9893 */
9994 es.ModelContainerItem.prototype.next = function() {
10095 try {
101 - return this[this._containerName].get( this[this._containerName].indexOf( this ) + 1 );
 96+ return this.container.get( this.container.indexOf( this ) + 1 );
10297 } catch ( e ) {
10398 throw 'Missing container error. Can not get next item in missing container. ' + e;
10499 }
@@ -112,7 +107,7 @@
113108 */
114109 es.ModelContainerItem.prototype.isFirst = function() {
115110 try {
116 - return this[this._containerName].indexOf( this ) === 0;
 111+ return this.container.indexOf( this ) === 0;
117112 } catch ( e ) {
118113 throw 'Missing container error. Can not get index of item in missing container. ' + e;
119114 }
@@ -127,8 +122,7 @@
128123 */
129124 es.ModelContainerItem.prototype.isLast = function() {
130125 try {
131 - return this[this._containerName].indexOf( this )
132 - === this[this._containerName].getLength() - 1;
 126+ return this.container.indexOf( this ) === this.container.getLength() - 1;
133127 } catch ( e ) {
134128 throw 'Missing container error. Can not get index of item in missing container. ' + e;
135129 }
Index: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js
@@ -6,16 +6,11 @@
77 * @class
88 * @constructor
99 * @extends {es.EventEmitter}
10 - * @param listName {String} Property name for list of items
11 - * @property [listName] {Array} list of items
 10+ * @property items {Array} list of items
1211 */
13 -es.ModelContainer = function( listName ) {
 12+es.ModelContainer = function() {
1413 es.EventEmitter.call( this );
15 - if ( typeof listName !== 'string' ) {
16 - listName = 'items';
17 - }
18 - this._listName = listName;
19 - this[this._listName] = new es.AggregateArray();
 14+ this.items = new es.AggregateArray();
2015 var container = this;
2116 this.relayUpdate = function() {
2217 container.emit( 'update' );
@@ -31,7 +26,7 @@
3227 * @returns {Object} Child object at index
3328 */
3429 es.ModelContainer.prototype.get = function( index ) {
35 - return this[this._listName][index] || null;
 30+ return this.items[index] || null;
3631 };
3732
3833 /**
@@ -41,7 +36,7 @@
4237 * @returns {Array} List of all items.
4338 */
4439 es.ModelContainer.prototype.all = function() {
45 - return this[this._listName];
 40+ return this.items;
4641 };
4742
4843 /**
@@ -51,7 +46,7 @@
5247 * @returns {Integer} Number of items in container
5348 */
5449 es.ModelContainer.prototype.getLength = function() {
55 - return this[this._listName].length
 50+ return this.items.length
5651 };
5752
5853 /**
@@ -61,7 +56,7 @@
6257 * @returns {Integer} Index of item, -1 if item is not in container
6358 */
6459 es.ModelContainer.prototype.indexOf = function( item ) {
65 - return this[this._listName].indexOf( item );
 60+ return this.items.indexOf( item );
6661 };
6762
6863 /**
@@ -71,7 +66,7 @@
7267 * @returns {Object} First item
7368 */
7469 es.ModelContainer.prototype.first = function() {
75 - return this[this._listName].length ? this[this._listName][0] : null;
 70+ return this.items.length ? this.items[0] : null;
7671 };
7772
7873 /**
@@ -81,8 +76,8 @@
8277 * @returns {Object} Last item
8378 */
8479 es.ModelContainer.prototype.last = function() {
85 - return this[this._listName].length
86 - ? this[this._listName][this[this._listName].length - 1] : null;
 80+ return this.items.length
 81+ ? this.items[this.items.length - 1] : null;
8782 };
8883
8984 /**
@@ -94,8 +89,8 @@
9590 * @param callback {Function} Function to call on each item which takes item and index arguments
9691 */
9792 es.ModelContainer.prototype.each = function( callback ) {
98 - for ( var i = 0; i < this[this._listName].length; i++ ) {
99 - if ( callback( this[this._listName][i], i ) === false ) {
 93+ for ( var i = 0; i < this.items.length; i++ ) {
 94+ if ( callback( this.items[i], i ) === false ) {
10095 break;
10196 }
10297 }
@@ -113,11 +108,11 @@
114109 es.ModelContainer.prototype.append = function( item ) {
115110 var parent = item.parent();
116111 if ( parent === this ) {
117 - this[this._listName].splice( this.indexOf( item ), 1 );
 112+ this.items.splice( this.indexOf( item ), 1 );
118113 } else if ( parent ) {
119114 parent.remove( item );
120115 }
121 - this[this._listName].push( item );
 116+ this.items.push( item );
122117 item.on( 'update', this.relayUpdate );
123118 item.attach( this );
124119 this.emit( 'append', item );
@@ -136,11 +131,11 @@
137132 es.ModelContainer.prototype.prepend = function( item ) {
138133 var parent = item.parent();
139134 if ( parent === this ) {
140 - this[this._listName].splice( this.indexOf( item ), 1 );
 135+ this.items.splice( this.indexOf( item ), 1 );
141136 } else if ( parent ) {
142137 parent.remove( item );
143138 }
144 - this[this._listName].unshift( item );
 139+ this.items.unshift( item );
145140 item.on( 'update', this.relayUpdate );
146141 item.attach( this );
147142 this.emit( 'prepend', item );
@@ -160,14 +155,14 @@
161156 es.ModelContainer.prototype.insertBefore = function( item, before ) {
162157 var parent = item.parent();
163158 if ( parent === this ) {
164 - this[this._listName].splice( this.indexOf( item ), 1 );
 159+ this.items.splice( this.indexOf( item ), 1 );
165160 } else if ( parent ) {
166161 parent.remove( item );
167162 }
168163 if ( before ) {
169 - this[this._listName].splice( this[this._listName].indexOf( before ), 0, item );
 164+ this.items.splice( this.items.indexOf( before ), 0, item );
170165 } else {
171 - this[this._listName].unshift( item );
 166+ this.items.unshift( item );
172167 }
173168 item.on( 'update', this.relayUpdate );
174169 item.attach( this );
@@ -188,14 +183,14 @@
189184 es.ModelContainer.prototype.insertAfter = function( item, after ) {
190185 var parent = item.parent();
191186 if ( parent === this ) {
192 - this[this._listName].splice( this.indexOf( item ), 1 );
 187+ this.items.splice( this.indexOf( item ), 1 );
193188 } else if ( parent ) {
194189 parent.remove( item );
195190 }
196191 if ( after ) {
197 - this[this._listName].splice( this[this._listName].indexOf( after ) + 1, 0, item );
 192+ this.items.splice( this.items.indexOf( after ) + 1, 0, item );
198193 } else {
199 - this[this._listName].push( item );
 194+ this.items.push( item );
200195 }
201196 item.on( 'update', this.relayUpdate );
202197 item.attach( this );
@@ -214,7 +209,7 @@
215210 */
216211 es.ModelContainer.prototype.remove = function( item ) {
217212 item.removeListener( 'update', this.relayUpdate );
218 - this[this._listName].splice( this.indexOf( item ), 1 );
 213+ this.items.splice( this.indexOf( item ), 1 );
219214 item.detach();
220215 this.emit( 'remove', item );
221216 this.emit( 'update' );
Index: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js
@@ -7,19 +7,19 @@
88 * @class
99 * @constructor
1010 * @extends {es.EventEmitter}
11 - * @param containerModel {es.ModelContainer} Property name for list of items
 11+ * @param model {es.ModelContainer} Model to follow
1212 * @param typeName {String} Name to use in CSS classes and HTML element data
1313 * @param tagName {String} HTML element name to use (optional, default: "div")
1414 * @property $ {jQuery} Container element
15 - * @property views {Array} List of views, correlating to models in the model container
 15+ * @property items {Array} List of views, correlating to models in the model container
1616 */
17 -es.ViewContainer = function( containerModel, typeName, tagName ) {
 17+es.ViewContainer = function( model, typeName, tagName ) {
1818 es.EventEmitter.call( this );
19 - this.containerModel = containerModel;
20 - if ( !this.containerModel ) {
 19+ this.model = model;
 20+ if ( !this.model ) {
2121 return;
2222 }
23 - this.views = new es.AggregateArray();
 23+ this.items = new es.AggregateArray();
2424 if ( typeof typeName !== 'string' ) {
2525 typeName = 'viewContainer';
2626 }
@@ -45,7 +45,7 @@
4646 }
4747 return itemView;
4848 }
49 - this.containerModel.on( 'prepend', function( itemModel ) {
 49+ this.model.on( 'prepend', function( itemModel ) {
5050 var itemView = recycleItemView( itemModel, true );
5151 itemView.on( 'update', container.relayUpdate );
5252 container.views.unshift( itemView );
@@ -53,7 +53,7 @@
5454 container.emit( 'prepend', itemView );
5555 container.emit( 'update' );
5656 } );
57 - this.containerModel.on( 'append', function( itemModel ) {
 57+ this.model.on( 'append', function( itemModel ) {
5858 var itemView = recycleItemView( itemModel, true );
5959 itemView.on( 'update', container.relayUpdate );
6060 container.views.push( itemView );
@@ -61,7 +61,7 @@
6262 container.emit( 'append', itemView );
6363 container.emit( 'update' );
6464 } );
65 - this.containerModel.on( 'insertBefore', function( itemModel, beforeModel ) {
 65+ this.model.on( 'insertBefore', function( itemModel, beforeModel ) {
6666 var beforeView = container.lookupItemView( beforeModel ),
6767 itemView = recycleItemView( itemModel, true );
6868 itemView.on( 'update', container.relayUpdate );
@@ -75,7 +75,7 @@
7676 container.emit( 'insertBefore', itemView, beforeView );
7777 container.emit( 'update' );
7878 } );
79 - this.containerModel.on( 'insertAfter', function( itemModel, afterModel ) {
 79+ this.model.on( 'insertAfter', function( itemModel, afterModel ) {
8080 var afterView = container.lookupItemView( afterModel ),
8181 itemView = recycleItemView( itemModel, true );
8282 itemView.on( 'update', container.relayUpdate );
@@ -89,26 +89,26 @@
9090 container.emit( 'insertAfter', itemView, afterView );
9191 container.emit( 'update' );
9292 } );
93 - this.containerModel.on( 'remove', function( itemModel ) {
 93+ this.model.on( 'remove', function( itemModel ) {
9494 var itemView = recycleItemView( itemModel );
9595 itemView.removeListener( 'update', container.relayUpdate );
9696 container.emit( 'remove', itemView );
9797 container.emit( 'update' );
9898 } );
9999 // Auto-add views for existing items
100 - var itemModels = this.containerModel.all();
 100+ var itemModels = this.model.all();
101101 for ( var i = 0; i < itemModels.length; i++ ) {
102102 var itemView = itemModels[i].createView();
103103 itemView.on( 'update', container.relayUpdate );
104 - this.views.push( itemView );
 104+ this.items.push( itemView );
105105 this.$.append( itemView.$ );
106106 }
107107 };
108108
109109 es.ViewContainer.prototype.lookupItemView = function( itemModel ) {
110 - for ( var i = 0; i < this.views.length; i++ ) {
111 - if ( this.views[i].getModel() === itemModel ) {
112 - return this.views[i];
 110+ for ( var i = 0; i < this.items.length; i++ ) {
 111+ if ( this.items[i].getModel() === itemModel ) {
 112+ return this.items[i];
113113 }
114114 }
115115 return null;
Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
@@ -17,8 +17,8 @@
1818 * Render content.
1919 */
2020 es.ListBlockView.prototype.renderContent = function() {
21 - for ( var i = 0; i < this.views.length; i++ ) {
22 - this.views[i].renderContent();
 21+ for ( var i = 0; i < this.items.length; i++ ) {
 22+ this.items[i].renderContent();
2323 }
2424 };
2525
@@ -26,14 +26,14 @@
2727 var itemLevel,
2828 levels = [];
2929
30 - for ( var i = 0; i < this.views.length; i++ ) {
31 - itemLevel = this.views[i].model.getLevel();
 30+ for ( var i = 0; i < this.items.length; i++ ) {
 31+ itemLevel = this.items[i].model.getLevel();
3232 levels = levels.slice(0, itemLevel + 1);
33 - if ( this.views[i].model.getStyle() === 'number' ) {
 33+ if ( this.items[i].model.getStyle() === 'number' ) {
3434 if ( !levels[itemLevel] ) {
3535 levels[itemLevel] = 0;
3636 }
37 - this.views[i].setNumber( ++levels[itemLevel] );
 37+ this.items[i].setNumber( ++levels[itemLevel] );
3838 }
3939 }
4040 };
@@ -64,7 +64,7 @@
6565 };
6666
6767 es.ListBlockView.prototype.drawSelection = function( range ) {
68 - var selectedViews = this.views.select( range );
 68+ var selectedViews = this.items.select( range );
6969 for ( var i = 0; i < selectedViews.length; i++ ) {
7070 selectedViews[i].item.drawSelection(
7171 new es.Range( selectedViews[i].from, selectedViews[i].to )
@@ -83,7 +83,7 @@
8484 return es.Html.makeTag(
8585 'div',
8686 { 'class': this.$.attr( 'class' ) },
87 - $.map( this.views, function( view ) {
 87+ $.map( this.items, function( view ) {
8888 return view.getHtml();
8989 } ).join( '' )
9090 );
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
@@ -19,17 +19,17 @@
2020 * Render content.
2121 */
2222 es.TableBlockRowView.prototype.renderContent = function() {
23 - for ( var i = 0; i < this.views.length; i++ ) {
24 - this.views[i].renderContent();
 23+ for ( var i = 0; i < this.items.length; i++ ) {
 24+ this.items[i].renderContent();
2525 }
2626 };
2727
2828 es.TableBlockRowView.prototype.getLength = function() {
29 - return this.views.getLengthOfItems();
 29+ return this.items.getLengthOfItems();
3030 };
3131
3232 es.TableBlockRowView.prototype.drawSelection = function( range ) {
33 - var selectedViews = this.views.select( range );
 33+ var selectedViews = this.items.select( range );
3434 for ( var i = 0; i < selectedViews.length; i++ ) {
3535 selectedViews[i].item.drawSelection(
3636 new es.Range( selectedViews[i].from, selectedViews[i].to )
@@ -45,7 +45,7 @@
4646 * @returns {String} HTML data
4747 */
4848 es.TableBlockRowView.prototype.getHtml = function( options ) {
49 - return es.Html.makeTag( 'tr', this.model.attributes, $.map( this.views, function( view ) {
 49+ return es.Html.makeTag( 'tr', this.model.attributes, $.map( this.items, function( view ) {
5050 return view.getHtml();
5151 } ).join( '' ) );
5252 };
Index: trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js
@@ -12,13 +12,13 @@
1313 * Render content.
1414 */
1515 es.DocumentView.prototype.renderContent = function() {
16 - for ( var i = 0; i < this.views.length; i++ ) {
17 - this.views[i].renderContent();
 16+ for ( var i = 0; i < this.items.length; i++ ) {
 17+ this.items[i].renderContent();
1818 }
1919 };
2020
2121 es.DocumentView.prototype.drawSelection = function( range ) {
22 - var selectedViews = this.views.select( range );
 22+ var selectedViews = this.items.select( range );
2323 for ( var i = 0; i < selectedViews.length; i++ ) {
2424 selectedViews[i].item.drawSelection(
2525 new es.Range( selectedViews[i].from, selectedViews[i].to )
@@ -27,7 +27,7 @@
2828 };
2929
3030 es.DocumentView.prototype.getLength = function( ) {
31 - return this.views.getLengthOfItems();
 31+ return this.items.getLengthOfItems();
3232 };
3333
3434 /**
@@ -37,11 +37,11 @@
3838 * @returns {String} HTML data
3939 */
4040 es.DocumentView.prototype.getHtml = function() {
41 - var views = this.views;
 41+ var views = this.items;
4242 return es.Html.makeTag(
4343 'div',
4444 { 'class': this.$.attr( 'class' ) },
45 - $.map( this.views, function( view, i ) {
 45+ $.map( this.items, function( view, i ) {
4646 return view.getHtml( { 'singular': i === 0 && views.length == 1 } );
4747 } ).join( '' )
4848 );
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js
@@ -19,17 +19,17 @@
2020 * Render content.
2121 */
2222 es.TableBlockView.prototype.renderContent = function() {
23 - for ( var i = 0; i < this.views.length; i++ ) {
24 - this.views[i].renderContent();
 23+ for ( var i = 0; i < this.items.length; i++ ) {
 24+ this.items[i].renderContent();
2525 }
2626 };
2727
2828 es.TableBlockView.prototype.getLength = function() {
29 - return this.views.getLengthOfItems();
 29+ return this.items.getLengthOfItems();
3030 };
3131
3232 es.TableBlockView.prototype.drawSelection = function( range ) {
33 - var selectedViews = this.views.select( range );
 33+ var selectedViews = this.items.select( range );
3434 for ( var i = 0; i < selectedViews.length; i++ ) {
3535 selectedViews[i].item.drawSelection(
3636 new es.Range( selectedViews[i].from, selectedViews[i].to )
@@ -45,7 +45,7 @@
4646 * @returns {String} HTML data
4747 */
4848 es.TableBlockView.prototype.getHtml = function( options ) {
49 - return es.Html.makeTag( 'table', this.model.attributes, $.map( this.views, function( view ) {
 49+ return es.Html.makeTag( 'table', this.model.attributes, $.map( this.items, function( view ) {
5050 return view.getHtml();
5151 } ).join( '' ) );
5252 };

Status & tagging log