http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96624
Revision: 96624
Author: inez
Date: 2011-09-08 22:28:01 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Almost working lists (still not added in DOM)
Modified Paths:
--------------
trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
Modified: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
2011-09-08 22:27:37 UTC (rev 96623)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
2011-09-08 22:28:01 UTC (rev 96624)
@@ -26,7 +26,7 @@
* Creates a view for this model
*/
es.ModelContainerItem.prototype.createView = function() {
- return new es.ViewContainerItem( this );
+ throw 'ModelContainerItem.createView not implemented in this subclass.';
};
/**
Modified: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
2011-09-08 22:27:37 UTC (rev 96623)
+++ trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
2011-09-08 22:28:01 UTC (rev 96624)
@@ -17,13 +17,20 @@
/* Methods */
/**
+ * Creates a view for this model
+ */
+es.ListBlockItemModel.prototype.createView = function() {
+ return new es.ListBlockItemView( this );
+};
+
+/**
* Gets the length of all content.
*
* @method
* @returns {Integer} Length of all content
*/
es.ListBlockItemModel.prototype.getContentLength = function() {
- return content.getLength();
+ return this.content.getLength();
};
/**
@@ -36,16 +43,6 @@
return { 'content': this.content.getPlainObject(), 'styles':
this.styles.slice( 0 ) };
};
-/**
- * Gets a sum of cell content lengths.
- *
- * @method
- * @returns {Integer}
- */
-es.ListBlockItemModel.prototype.getLength = function() {
- return this.cells.getLength();
-};
-
/* Inheritance */
es.extend( es.ListBlockItemModel, es.ModelContainerItem );
\ No newline at end of file
Modified: trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
2011-09-08 22:27:37 UTC (rev 96623)
+++ trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
2011-09-08 22:28:01 UTC (rev 96624)
@@ -2,7 +2,7 @@
* Creates an es.ParagraphBlockView object.
*/
es.ListBlockItemView = function( model ) {
- es.BlockView.call( this, model, 'item' );
+ es.ViewContainerItem.call( this, model, 'listItem' );
this.contentView = new es.ContentView( this.$, this.model.content );
};
@@ -34,4 +34,4 @@
return this.contentView.getLineIndex( position );
};
-es.extend( es.ListBlockItemView, es.BlockView );
+es.extend( es.ListBlockItemView, es.ViewContainerItem );
Modified: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js 2011-09-08
22:27:37 UTC (rev 96623)
+++ trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js 2011-09-08
22:28:01 UTC (rev 96624)
@@ -2,38 +2,39 @@
* Creates an es.ParagraphBlockView object.
*/
es.ListBlockView = function( model ) {
- es.ViewContainer.call( this, model, 'list' );
- es.ViewContainerItem.call( this, model, 'list' );
- this.contentView = new es.ContentView( this.$, this.model.content );
+ es.ViewContainer.call( this, model, 'items' );
+ es.BlockView.call( this, model, 'list' );
};
/**
* Render content.
*/
es.ListBlockView.prototype.renderContent = function() {
- this.contentView.render();
+ for ( var i = 0; i < this.views.length; i++ ) {
+ this.views[i].renderContent();
+ }
};
/**
* Gets offset within content of position.
*/
es.ListBlockView.getContentOffset = function( position ) {
- return this.contentView.getOffset( position );
+ //return this.contentView.getOffset( position );
};
/**
* Gets rendered position of offset within content.
*/
es.ListBlockView.getRenderedPosition = function( offset ) {
- return this.contentView.getPosition( position );
+ //return this.contentView.getPosition( position );
};
/**
* Gets rendered line index of offset within content.
*/
es.ListBlockView.getRenderedLineIndex = function( offset ) {
- return this.contentView.getLineIndex( position );
+ //return this.contentView.getLineIndex( position );
};
es.extend( es.ListBlockView, es.ViewContainer );
-es.extend( es.ListBlockView, es.ViewContainerItem );
+es.extend( es.ListBlockView, es.BlockView );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs