http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97571
Revision: 97571
Author: inez
Date: 2011-09-19 23:07:57 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Refactoring, switch from.. to..
ModelContainerItem -> ModelListItem
ModelContainer -> ModelList
ViewContainerItem -> ViewListItem
ViewContainer -> ViewList
Modified Paths:
--------------
trunk/parsers/wikidom/demos/synth/index.html
trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js
trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js
trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js
trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
trunk/parsers/wikidom/lib/synth/views/es.BlockView.js
trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js
trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js
Added Paths:
-----------
trunk/parsers/wikidom/lib/synth/bases/es.ModelList.js
trunk/parsers/wikidom/lib/synth/bases/es.ModelListItem.js
trunk/parsers/wikidom/lib/synth/bases/es.ViewList.js
trunk/parsers/wikidom/lib/synth/bases/es.ViewListItem.js
Removed Paths:
-------------
trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js
trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js
trunk/parsers/wikidom/lib/synth/bases/es.ViewContainerItem.js
Modified: trunk/parsers/wikidom/demos/synth/index.html
===================================================================
--- trunk/parsers/wikidom/demos/synth/index.html 2011-09-19 22:52:45 UTC
(rev 97570)
+++ trunk/parsers/wikidom/demos/synth/index.html 2011-09-19 23:07:57 UTC
(rev 97571)
@@ -60,10 +60,11 @@
<script src="../../lib/synth/es.Selection.js"></script>
<script src="../../lib/synth/bases/es.EventEmitter.js"></script>
<script
src="../../lib/synth/bases/es.AggregateArray.js"></script>
- <script
src="../../lib/synth/bases/es.ModelContainer.js"></script>
- <script
src="../../lib/synth/bases/es.ModelContainerItem.js"></script>
- <script
src="../../lib/synth/bases/es.ViewContainer.js"></script>
- <script
src="../../lib/synth/bases/es.ViewContainerItem.js"></script>
+
+ <script src="../../lib/synth/bases/es.ModelList.js"></script>
+ <script
src="../../lib/synth/bases/es.ModelListItem.js"></script>
+ <script src="../../lib/synth/bases/es.ViewList.js"></script>
+ <script src="../../lib/synth/bases/es.ViewListItem.js"></script>
<!-- Controllers -->
<script
src="../../lib/synth/controllers/es.SurfaceController.js"></script>
Deleted: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -1,220 +0,0 @@
-/**
- * Creates an es.ModelContainer object.
- *
- * Child objects must extend es.ModelContainerItem.
- *
- * @class
- * @constructor
- * @extends {es.EventEmitter}
- * @property items {Array} list of items
- */
-es.ModelContainer = function() {
- es.EventEmitter.call( this );
- this.items = new es.AggregateArray();
- var container = this;
- this.relayUpdate = function() {
- container.emit( 'update' );
- };
-};
-
-/* Methods */
-
-/**
- * Gets an item at a specific index.
- *
- * @method
- * @returns {Object} Child object at index
- */
-es.ModelContainer.prototype.get = function( index ) {
- return this.items[index] || null;
-};
-
-/**
- * Gets all items.
- *
- * @method
- * @returns {Array} List of all items.
- */
-es.ModelContainer.prototype.all = function() {
- return this.items;
-};
-
-/**
- * Gets the number of items in container.
- *
- * @method
- * @returns {Integer} Number of items in container
- */
-es.ModelContainer.prototype.getLength = function() {
- return this.items.length
-};
-
-/**
- * Gets the index of an item.
- *
- * @method
- * @returns {Integer} Index of item, -1 if item is not in container
- */
-es.ModelContainer.prototype.indexOf = function( item ) {
- return this.items.indexOf( item );
-};
-
-/**
- * Gets the first item in the container.
- *
- * @method
- * @returns {Object} First item
- */
-es.ModelContainer.prototype.first = function() {
- return this.items.length ? this.items[0] : null;
-};
-
-/**
- * Gets the last item in the container.
- *
- * @method
- * @returns {Object} Last item
- */
-es.ModelContainer.prototype.last = function() {
- return this.items.length
- ? this.items[this.items.length - 1] : null;
-};
-
-/**
- * Iterates over items, executing a callback for each.
- *
- * Returning false in the callback will stop iteration.
- *
- * @method
- * @param callback {Function} Function to call on each item which takes item
and index arguments
- */
-es.ModelContainer.prototype.each = function( callback ) {
- for ( var i = 0; i < this.items.length; i++ ) {
- if ( callback( this.items[i], i ) === false ) {
- break;
- }
- }
-};
-
-/**
- * Adds an item to the end of the container.
- *
- * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
- *
- * @method
- * @param item {Object} Item to append
- * @emits "update"
- */
-es.ModelContainer.prototype.append = function( item ) {
- var parent = item.parent();
- if ( parent === this ) {
- this.items.splice( this.indexOf( item ), 1 );
- } else if ( parent ) {
- parent.remove( item );
- }
- this.items.push( item );
- item.on( 'update', this.relayUpdate );
- item.attach( this );
- this.emit( 'append', item );
- this.emit( 'update' );
-};
-
-/**
- * Adds an item to the beginning of the container.
- *
- * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
- *
- * @method
- * @param item {Object} Item to prepend
- * @emits "update"
- */
-es.ModelContainer.prototype.prepend = function( item ) {
- var parent = item.parent();
- if ( parent === this ) {
- this.items.splice( this.indexOf( item ), 1 );
- } else if ( parent ) {
- parent.remove( item );
- }
- this.items.unshift( item );
- item.on( 'update', this.relayUpdate );
- item.attach( this );
- this.emit( 'prepend', item );
- this.emit( 'update' );
-};
-
-/**
- * Adds an item to the container after an existing item.
- *
- * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
- *
- * @method
- * @param item {Object} Item to insert
- * @param before {Object} Item to insert before, if null then item will be
inserted at the end
- * @emits "update"
- */
-es.ModelContainer.prototype.insertBefore = function( item, before ) {
- var parent = item.parent();
- if ( parent === this ) {
- this.items.splice( this.indexOf( item ), 1 );
- } else if ( parent ) {
- parent.remove( item );
- }
- if ( before ) {
- this.items.splice( this.items.indexOf( before ), 0, item );
- } else {
- this.items.unshift( item );
- }
- item.on( 'update', this.relayUpdate );
- item.attach( this );
- this.emit( 'insertBefore', item, before );
- this.emit( 'update' );
-};
-
-/**
- * Adds an item to the container after an existing item.
- *
- * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
- *
- * @method
- * @param item {Object} Item to insert
- * @param after {Object} Item to insert after, if null item will be inserted
at the end
- * @emits "update"
- */
-es.ModelContainer.prototype.insertAfter = function( item, after ) {
- var parent = item.parent();
- if ( parent === this ) {
- this.items.splice( this.indexOf( item ), 1 );
- } else if ( parent ) {
- parent.remove( item );
- }
- if ( after ) {
- this.items.splice( this.items.indexOf( after ) + 1, 0, item );
- } else {
- this.items.push( item );
- }
- item.on( 'update', this.relayUpdate );
- item.attach( this );
- this.emit( 'insertAfter', item, after );
- this.emit( 'update' );
-};
-
-/**
- * Removes an item from the container.
- *
- * Also detaches item's Element object to the DOM and removes all listeners
its "update" events.
- *
- * @method
- * @param item {Object} Item to remove
- * @emits "update"
- */
-es.ModelContainer.prototype.remove = function( item ) {
- item.removeListener( 'update', this.relayUpdate );
- this.items.splice( this.indexOf( item ), 1 );
- item.detach();
- this.emit( 'remove', item );
- this.emit( 'update' );
-};
-
-/* Inheritance */
-
-es.extend( es.ModelContainer, es.EventEmitter );
Deleted: trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -1,133 +0,0 @@
-/**
- * Creates an es.ModelContainerItem object.
- *
- * @class
- * @constructor
- * @extends {es.EventEmitter}
- * @property container {Object} Reference to container, if attached
- */
-es.ModelContainerItem = function() {
- es.EventEmitter.call( this );
- this.container = null;
-};
-
-/* Methods */
-
-es.ModelContainerItem.prototype.parent = function() {
- return this.container;
-};
-
-/**
- * Creates a view for this model
- */
-es.ModelContainerItem.prototype.createView = function() {
- throw 'ModelContainerItem.createView not implemented in this subclass.';
-};
-
-/**
- * Attaches item to a container.
- *
- * @method
- * @param container {es.Container} Container to attach to
- * @emits "attach" with container argument
- */
-es.ModelContainerItem.prototype.attach = function( container ) {
- this.container = container;
- this.emit( 'attach', container );
-};
-
-/**
- * Detaches item from a container.
- *
- * @method
- * @emits "detach" with container argument
- */
-es.ModelContainerItem.prototype.detach = function() {
- var container = this.container;
- this.container = null;
- this.emit( 'detach', container );
-};
-
-/**
- * Gets the index of this item within it's container.
- *
- * @method
- * @returns {Integer} Index of item in it's container
- * @throws Unknown item error if this item is not in it's container
- * @throws Missing container error if this container can't be accessed.
- */
-es.ModelContainerItem.prototype.getIndex = function() {
- try {
- var index = this.container.indexOf( this );
- if ( index === -1 ) {
- throw 'Unknown item error. Can not get index of item
that is not in a container. ' + e;
- }
- return index;
- } catch ( e ) {
- throw 'Missing container error. Can not get index of item in
missing container. ' + e;
- }
-};
-
-/**
- * Gets the previous item in container.
- *
- * @method
- * @returns {Object} Previous item, or null if none exists
- * @throws Missing container error if getting the previous item item failed
- */
-es.ModelContainerItem.prototype.previous = function() {
- try {
- return this.container.get( this.container.indexOf( this ) - 1 );
- } catch ( e ) {
- throw 'Missing container error. Can not get previous item in
missing container. ' + e;
- }
-};
-
-/**
- * Gets the next item in container.
- *
- * @method
- * @returns {Object} Next item, or null if none exists
- * @throws Missing container error if getting the next item item failed
- */
-es.ModelContainerItem.prototype.next = function() {
- try {
- return this.container.get( this.container.indexOf( this ) + 1 );
- } catch ( e ) {
- throw 'Missing container error. Can not get next item in
missing container. ' + e;
- }
-};
-
-/**
- * Checks if this item is the first in it's container.
- *
- * @method
- * @returns {Boolean} If item is the first in it's container
- * @throws Missing container error if getting the index of this item failed
- */
-es.ModelContainerItem.prototype.isFirst = function() {
- try {
- return this.container.indexOf( this ) === 0;
- } catch ( e ) {
- throw 'Missing container error. Can not get index of item in
missing container. ' + e;
- }
-};
-
-/**
- * Checks if this item is the last in it's container.
- *
- * @method
- * @returns {Boolean} If item is the last in it's container
- * @throws Missing container error if getting the index of this item failed
- */
-es.ModelContainerItem.prototype.isLast = function() {
- try {
- return this.container.indexOf( this ) ===
this.container.getLength() - 1;
- } catch ( e ) {
- throw 'Missing container error. Can not get index of item in
missing container. ' + e;
- }
-};
-
-/* Inheritance */
-
-es.extend( es.ModelContainerItem, es.EventEmitter );
Copied: trunk/parsers/wikidom/lib/synth/bases/es.ModelList.js (from rev 97527,
trunk/parsers/wikidom/lib/synth/bases/es.ModelContainer.js)
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ModelList.js
(rev 0)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ModelList.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -0,0 +1,220 @@
+/**
+ * Creates an es.ModelList object.
+ *
+ * Child objects must extend es.ModelListItem.
+ *
+ * @class
+ * @constructor
+ * @extends {es.EventEmitter}
+ * @property items {Array} list of items
+ */
+es.ModelList = function() {
+ es.EventEmitter.call( this );
+ this.items = new es.AggregateArray();
+ var container = this;
+ this.relayUpdate = function() {
+ container.emit( 'update' );
+ };
+};
+
+/* Methods */
+
+/**
+ * Gets an item at a specific index.
+ *
+ * @method
+ * @returns {Object} Child object at index
+ */
+es.ModelList.prototype.get = function( index ) {
+ return this.items[index] || null;
+};
+
+/**
+ * Gets all items.
+ *
+ * @method
+ * @returns {Array} List of all items.
+ */
+es.ModelList.prototype.all = function() {
+ return this.items;
+};
+
+/**
+ * Gets the number of items in container.
+ *
+ * @method
+ * @returns {Integer} Number of items in container
+ */
+es.ModelList.prototype.getLength = function() {
+ return this.items.length
+};
+
+/**
+ * Gets the index of an item.
+ *
+ * @method
+ * @returns {Integer} Index of item, -1 if item is not in container
+ */
+es.ModelList.prototype.indexOf = function( item ) {
+ return this.items.indexOf( item );
+};
+
+/**
+ * Gets the first item in the container.
+ *
+ * @method
+ * @returns {Object} First item
+ */
+es.ModelList.prototype.first = function() {
+ return this.items.length ? this.items[0] : null;
+};
+
+/**
+ * Gets the last item in the container.
+ *
+ * @method
+ * @returns {Object} Last item
+ */
+es.ModelList.prototype.last = function() {
+ return this.items.length
+ ? this.items[this.items.length - 1] : null;
+};
+
+/**
+ * Iterates over items, executing a callback for each.
+ *
+ * Returning false in the callback will stop iteration.
+ *
+ * @method
+ * @param callback {Function} Function to call on each item which takes item
and index arguments
+ */
+es.ModelList.prototype.each = function( callback ) {
+ for ( var i = 0; i < this.items.length; i++ ) {
+ if ( callback( this.items[i], i ) === false ) {
+ break;
+ }
+ }
+};
+
+/**
+ * Adds an item to the end of the container.
+ *
+ * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
+ *
+ * @method
+ * @param item {Object} Item to append
+ * @emits "update"
+ */
+es.ModelList.prototype.append = function( item ) {
+ var parent = item.parent();
+ if ( parent === this ) {
+ this.items.splice( this.indexOf( item ), 1 );
+ } else if ( parent ) {
+ parent.remove( item );
+ }
+ this.items.push( item );
+ item.on( 'update', this.relayUpdate );
+ item.attach( this );
+ this.emit( 'append', item );
+ this.emit( 'update' );
+};
+
+/**
+ * Adds an item to the beginning of the container.
+ *
+ * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
+ *
+ * @method
+ * @param item {Object} Item to prepend
+ * @emits "update"
+ */
+es.ModelList.prototype.prepend = function( item ) {
+ var parent = item.parent();
+ if ( parent === this ) {
+ this.items.splice( this.indexOf( item ), 1 );
+ } else if ( parent ) {
+ parent.remove( item );
+ }
+ this.items.unshift( item );
+ item.on( 'update', this.relayUpdate );
+ item.attach( this );
+ this.emit( 'prepend', item );
+ this.emit( 'update' );
+};
+
+/**
+ * Adds an item to the container after an existing item.
+ *
+ * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
+ *
+ * @method
+ * @param item {Object} Item to insert
+ * @param before {Object} Item to insert before, if null then item will be
inserted at the end
+ * @emits "update"
+ */
+es.ModelList.prototype.insertBefore = function( item, before ) {
+ var parent = item.parent();
+ if ( parent === this ) {
+ this.items.splice( this.indexOf( item ), 1 );
+ } else if ( parent ) {
+ parent.remove( item );
+ }
+ if ( before ) {
+ this.items.splice( this.items.indexOf( before ), 0, item );
+ } else {
+ this.items.unshift( item );
+ }
+ item.on( 'update', this.relayUpdate );
+ item.attach( this );
+ this.emit( 'insertBefore', item, before );
+ this.emit( 'update' );
+};
+
+/**
+ * Adds an item to the container after an existing item.
+ *
+ * Also inserts item's Element object to the DOM and adds a listener to its
"update" events.
+ *
+ * @method
+ * @param item {Object} Item to insert
+ * @param after {Object} Item to insert after, if null item will be inserted
at the end
+ * @emits "update"
+ */
+es.ModelList.prototype.insertAfter = function( item, after ) {
+ var parent = item.parent();
+ if ( parent === this ) {
+ this.items.splice( this.indexOf( item ), 1 );
+ } else if ( parent ) {
+ parent.remove( item );
+ }
+ if ( after ) {
+ this.items.splice( this.items.indexOf( after ) + 1, 0, item );
+ } else {
+ this.items.push( item );
+ }
+ item.on( 'update', this.relayUpdate );
+ item.attach( this );
+ this.emit( 'insertAfter', item, after );
+ this.emit( 'update' );
+};
+
+/**
+ * Removes an item from the container.
+ *
+ * Also detaches item's Element object to the DOM and removes all listeners
its "update" events.
+ *
+ * @method
+ * @param item {Object} Item to remove
+ * @emits "update"
+ */
+es.ModelList.prototype.remove = function( item ) {
+ item.removeListener( 'update', this.relayUpdate );
+ this.items.splice( this.indexOf( item ), 1 );
+ item.detach();
+ this.emit( 'remove', item );
+ this.emit( 'update' );
+};
+
+/* Inheritance */
+
+es.extend( es.ModelList, es.EventEmitter );
Property changes on: trunk/parsers/wikidom/lib/synth/bases/es.ModelList.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Copied: trunk/parsers/wikidom/lib/synth/bases/es.ModelListItem.js (from rev
97527, trunk/parsers/wikidom/lib/synth/bases/es.ModelContainerItem.js)
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ModelListItem.js
(rev 0)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ModelListItem.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -0,0 +1,133 @@
+/**
+ * Creates an es.ModelListItem object.
+ *
+ * @class
+ * @constructor
+ * @extends {es.EventEmitter}
+ * @property container {Object} Reference to container, if attached
+ */
+es.ModelListItem = function() {
+ es.EventEmitter.call( this );
+ this.container = null;
+};
+
+/* Methods */
+
+es.ModelListItem.prototype.parent = function() {
+ return this.container;
+};
+
+/**
+ * Creates a view for this model
+ */
+es.ModelListItem.prototype.createView = function() {
+ throw 'ModelListItem.createView not implemented in this subclass.';
+};
+
+/**
+ * Attaches item to a container.
+ *
+ * @method
+ * @param container {es.Container} Container to attach to
+ * @emits "attach" with container argument
+ */
+es.ModelListItem.prototype.attach = function( container ) {
+ this.container = container;
+ this.emit( 'attach', container );
+};
+
+/**
+ * Detaches item from a container.
+ *
+ * @method
+ * @emits "detach" with container argument
+ */
+es.ModelListItem.prototype.detach = function() {
+ var container = this.container;
+ this.container = null;
+ this.emit( 'detach', container );
+};
+
+/**
+ * Gets the index of this item within it's container.
+ *
+ * @method
+ * @returns {Integer} Index of item in it's container
+ * @throws Unknown item error if this item is not in it's container
+ * @throws Missing container error if this container can't be accessed.
+ */
+es.ModelListItem.prototype.getIndex = function() {
+ try {
+ var index = this.container.indexOf( this );
+ if ( index === -1 ) {
+ throw 'Unknown item error. Can not get index of item
that is not in a container. ' + e;
+ }
+ return index;
+ } catch ( e ) {
+ throw 'Missing container error. Can not get index of item in
missing container. ' + e;
+ }
+};
+
+/**
+ * Gets the previous item in container.
+ *
+ * @method
+ * @returns {Object} Previous item, or null if none exists
+ * @throws Missing container error if getting the previous item item failed
+ */
+es.ModelListItem.prototype.previous = function() {
+ try {
+ return this.container.get( this.container.indexOf( this ) - 1 );
+ } catch ( e ) {
+ throw 'Missing container error. Can not get previous item in
missing container. ' + e;
+ }
+};
+
+/**
+ * Gets the next item in container.
+ *
+ * @method
+ * @returns {Object} Next item, or null if none exists
+ * @throws Missing container error if getting the next item item failed
+ */
+es.ModelListItem.prototype.next = function() {
+ try {
+ return this.container.get( this.container.indexOf( this ) + 1 );
+ } catch ( e ) {
+ throw 'Missing container error. Can not get next item in
missing container. ' + e;
+ }
+};
+
+/**
+ * Checks if this item is the first in it's container.
+ *
+ * @method
+ * @returns {Boolean} If item is the first in it's container
+ * @throws Missing container error if getting the index of this item failed
+ */
+es.ModelListItem.prototype.isFirst = function() {
+ try {
+ return this.container.indexOf( this ) === 0;
+ } catch ( e ) {
+ throw 'Missing container error. Can not get index of item in
missing container. ' + e;
+ }
+};
+
+/**
+ * Checks if this item is the last in it's container.
+ *
+ * @method
+ * @returns {Boolean} If item is the last in it's container
+ * @throws Missing container error if getting the index of this item failed
+ */
+es.ModelListItem.prototype.isLast = function() {
+ try {
+ return this.container.indexOf( this ) ===
this.container.getLength() - 1;
+ } catch ( e ) {
+ throw 'Missing container error. Can not get index of item in
missing container. ' + e;
+ }
+};
+
+/* Inheritance */
+
+es.extend( es.ModelListItem, es.EventEmitter );
Property changes on: trunk/parsers/wikidom/lib/synth/bases/es.ModelListItem.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Deleted: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -1,119 +0,0 @@
-/**
- * Creates an es.ViewContainer object.
- *
- * View containers follow the operations performed on a model container and
keep a list of views,
- * each correlating to a model in the model container.
- *
- * @class
- * @constructor
- * @extends {es.EventEmitter}
- * @param model {es.ModelContainer} Model to follow
- * @param typeName {String} Name to use in CSS classes and HTML element data
- * @param tagName {String} HTML element name to use (optional, default: "div")
- * @property $ {jQuery} Container element
- * @property items {Array} List of views, correlating to models in the model
container
- */
-es.ViewContainer = function( model, typeName, tagName ) {
- es.EventEmitter.call( this );
- this.model = model;
- if ( !this.model ) {
- return;
- }
- this.items = new es.AggregateArray();
- if ( typeof typeName !== 'string' ) {
- typeName = 'viewContainer';
- }
- if ( typeof tagName !== 'string' ) {
- tagName = 'div';
- }
- if ( !this.$ ) {
- this.$ = $( '<' + tagName + '/>' );
- }
- this.$.addClass( 'editSurface-' + typeName ).data( typeName, this );
- var container = this;
- this.relayUpdate = function() {
- container.emit( 'update' );
- };
- function recycleItemView( itemModel, autoCreate ) {
- var itemView = container.lookupItemView( itemModel );
- if ( itemView ) {
- container.views.splice( container.views.indexOf(
itemView ), 1 );
- itemView.$.detach();
- }
- if ( autoCreate && itemView === null ) {
- itemView = itemModel.createView();
- }
- return itemView;
- }
- this.model.on( 'prepend', function( itemModel ) {
- var itemView = recycleItemView( itemModel, true );
- itemView.on( 'update', container.relayUpdate );
- container.views.unshift( itemView );
- container.$.prepend( itemView.$ );
- container.emit( 'prepend', itemView );
- container.emit( 'update' );
- } );
- this.model.on( 'append', function( itemModel ) {
- var itemView = recycleItemView( itemModel, true );
- itemView.on( 'update', container.relayUpdate );
- container.views.push( itemView );
- container.$.append( itemView.$ );
- container.emit( 'append', itemView );
- container.emit( 'update' );
- } );
- this.model.on( 'insertBefore', function( itemModel, beforeModel ) {
- var beforeView = container.lookupItemView( beforeModel ),
- itemView = recycleItemView( itemModel, true );
- itemView.on( 'update', container.relayUpdate );
- if ( beforeView ) {
- container.views.splice( container.views.indexOf(
beforeView ), 0, itemView );
- itemView.$.insertBefore( beforeView.$ );
- } else {
- container.views.unshift( itemView );
- container.$.prepend( itemView.$ );
- }
- container.emit( 'insertBefore', itemView, beforeView );
- container.emit( 'update' );
- } );
- this.model.on( 'insertAfter', function( itemModel, afterModel ) {
- var afterView = container.lookupItemView( afterModel ),
- itemView = recycleItemView( itemModel, true );
- itemView.on( 'update', container.relayUpdate );
- if ( afterView ) {
- container.views.splice( container.views.indexOf(
afterView ) + 1, 0, itemView );
- itemView.$.insertAfter( afterView.$ );
- } else {
- container.views.push( itemView );
- container.$.append( itemView.$ );
- }
- container.emit( 'insertAfter', itemView, afterView );
- container.emit( 'update' );
- } );
- this.model.on( 'remove', function( itemModel ) {
- var itemView = recycleItemView( itemModel );
- itemView.removeListener( 'update', container.relayUpdate );
- container.emit( 'remove', itemView );
- container.emit( 'update' );
- } );
- // Auto-add views for existing items
- var itemModels = this.model.all();
- for ( var i = 0; i < itemModels.length; i++ ) {
- var itemView = itemModels[i].createView();
- itemView.on( 'update', container.relayUpdate );
- this.items.push( itemView );
- this.$.append( itemView.$ );
- }
-};
-
-es.ViewContainer.prototype.lookupItemView = function( itemModel ) {
- for ( var i = 0; i < this.items.length; i++ ) {
- if ( this.items[i].getModel() === itemModel ) {
- return this.items[i];
- }
- }
- return null;
-};
-
-/* Inheritance */
-
-es.extend( es.ViewContainer, es.EventEmitter );
Deleted: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainerItem.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ViewContainerItem.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ViewContainerItem.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -1,45 +0,0 @@
-/**
- * Generic synchronized Object/Element container item.
- *
- * @class
- * @constructor
- * @extends {es.EventEmitter}
- * @param typeName {String} Name to use in CSS classes and HTML element data
- * @param tagName {String} HTML element name to use (optional, default: "div")
- * @property $ {jQuery} Container element
- */
-es.ViewContainerItem = function( model, typeName, tagName ) {
- es.EventEmitter.call( this );
- this.model = model;
- if ( typeof typeName !== 'string' ) {
- typeName = 'viewContainerItem';
- }
- if ( typeof tagName !== 'string' ) {
- tagName = 'div';
- }
-
- if ( !this.$ ) {
- this.$ = $( '<' + tagName + '/>' );
- }
- this.$.addClass( 'editSurface-' + typeName ).data( typeName, this );
-};
-
-es.ViewContainerItem.prototype.getModel = function() {
- return this.model;
-};
-
-/**
- * Gets the index of this item within it's container.
- *
- * This method simply delegates to the model.
- *
- * @method
- * @returns {Integer} Index of item in it's container
- */
-es.ViewContainerItem.prototype.getIndex = function() {
- return this.model.getIndex();
-};
-
-/* Inheritance */
-
-es.extend( es.ViewContainerItem, es.EventEmitter );
Copied: trunk/parsers/wikidom/lib/synth/bases/es.ViewList.js (from rev 97527,
trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js)
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ViewList.js
(rev 0)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ViewList.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -0,0 +1,119 @@
+/**
+ * Creates an es.ViewList object.
+ *
+ * View containers follow the operations performed on a model container and
keep a list of views,
+ * each correlating to a model in the model container.
+ *
+ * @class
+ * @constructor
+ * @extends {es.EventEmitter}
+ * @param model {es.ModelList} Model to follow
+ * @param typeName {String} Name to use in CSS classes and HTML element data
+ * @param tagName {String} HTML element name to use (optional, default: "div")
+ * @property $ {jQuery} Container element
+ * @property items {Array} List of views, correlating to models in the model
container
+ */
+es.ViewList = function( model, typeName, tagName ) {
+ es.EventEmitter.call( this );
+ this.model = model;
+ if ( !this.model ) {
+ return;
+ }
+ this.items = new es.AggregateArray();
+ if ( typeof typeName !== 'string' ) {
+ typeName = 'viewList';
+ }
+ if ( typeof tagName !== 'string' ) {
+ tagName = 'div';
+ }
+ if ( !this.$ ) {
+ this.$ = $( '<' + tagName + '/>' );
+ }
+ this.$.addClass( 'editSurface-' + typeName ).data( typeName, this );
+ var container = this;
+ this.relayUpdate = function() {
+ container.emit( 'update' );
+ };
+ function recycleItemView( itemModel, autoCreate ) {
+ var itemView = container.lookupItemView( itemModel );
+ if ( itemView ) {
+ container.views.splice( container.views.indexOf(
itemView ), 1 );
+ itemView.$.detach();
+ }
+ if ( autoCreate && itemView === null ) {
+ itemView = itemModel.createView();
+ }
+ return itemView;
+ }
+ this.model.on( 'prepend', function( itemModel ) {
+ var itemView = recycleItemView( itemModel, true );
+ itemView.on( 'update', container.relayUpdate );
+ container.views.unshift( itemView );
+ container.$.prepend( itemView.$ );
+ container.emit( 'prepend', itemView );
+ container.emit( 'update' );
+ } );
+ this.model.on( 'append', function( itemModel ) {
+ var itemView = recycleItemView( itemModel, true );
+ itemView.on( 'update', container.relayUpdate );
+ container.views.push( itemView );
+ container.$.append( itemView.$ );
+ container.emit( 'append', itemView );
+ container.emit( 'update' );
+ } );
+ this.model.on( 'insertBefore', function( itemModel, beforeModel ) {
+ var beforeView = container.lookupItemView( beforeModel ),
+ itemView = recycleItemView( itemModel, true );
+ itemView.on( 'update', container.relayUpdate );
+ if ( beforeView ) {
+ container.views.splice( container.views.indexOf(
beforeView ), 0, itemView );
+ itemView.$.insertBefore( beforeView.$ );
+ } else {
+ container.views.unshift( itemView );
+ container.$.prepend( itemView.$ );
+ }
+ container.emit( 'insertBefore', itemView, beforeView );
+ container.emit( 'update' );
+ } );
+ this.model.on( 'insertAfter', function( itemModel, afterModel ) {
+ var afterView = container.lookupItemView( afterModel ),
+ itemView = recycleItemView( itemModel, true );
+ itemView.on( 'update', container.relayUpdate );
+ if ( afterView ) {
+ container.views.splice( container.views.indexOf(
afterView ) + 1, 0, itemView );
+ itemView.$.insertAfter( afterView.$ );
+ } else {
+ container.views.push( itemView );
+ container.$.append( itemView.$ );
+ }
+ container.emit( 'insertAfter', itemView, afterView );
+ container.emit( 'update' );
+ } );
+ this.model.on( 'remove', function( itemModel ) {
+ var itemView = recycleItemView( itemModel );
+ itemView.removeListener( 'update', container.relayUpdate );
+ container.emit( 'remove', itemView );
+ container.emit( 'update' );
+ } );
+ // Auto-add views for existing items
+ var itemModels = this.model.all();
+ for ( var i = 0; i < itemModels.length; i++ ) {
+ var itemView = itemModels[i].createView();
+ itemView.on( 'update', container.relayUpdate );
+ this.items.push( itemView );
+ this.$.append( itemView.$ );
+ }
+};
+
+es.ViewList.prototype.lookupItemView = function( itemModel ) {
+ for ( var i = 0; i < this.items.length; i++ ) {
+ if ( this.items[i].getModel() === itemModel ) {
+ return this.items[i];
+ }
+ }
+ return null;
+};
+
+/* Inheritance */
+
+es.extend( es.ViewList, es.EventEmitter );
Property changes on: trunk/parsers/wikidom/lib/synth/bases/es.ViewList.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Copied: trunk/parsers/wikidom/lib/synth/bases/es.ViewListItem.js (from rev
97527, trunk/parsers/wikidom/lib/synth/bases/es.ViewContainerItem.js)
===================================================================
--- trunk/parsers/wikidom/lib/synth/bases/es.ViewListItem.js
(rev 0)
+++ trunk/parsers/wikidom/lib/synth/bases/es.ViewListItem.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -0,0 +1,45 @@
+/**
+ * Generic synchronized Object/Element container item.
+ *
+ * @class
+ * @constructor
+ * @extends {es.EventEmitter}
+ * @param typeName {String} Name to use in CSS classes and HTML element data
+ * @param tagName {String} HTML element name to use (optional, default: "div")
+ * @property $ {jQuery} Container element
+ */
+es.ViewListItem = function( model, typeName, tagName ) {
+ es.EventEmitter.call( this );
+ this.model = model;
+ if ( typeof typeName !== 'string' ) {
+ typeName = 'viewListItem';
+ }
+ if ( typeof tagName !== 'string' ) {
+ tagName = 'div';
+ }
+
+ if ( !this.$ ) {
+ this.$ = $( '<' + tagName + '/>' );
+ }
+ this.$.addClass( 'editSurface-' + typeName ).data( typeName, this );
+};
+
+es.ViewListItem.prototype.getModel = function() {
+ return this.model;
+};
+
+/**
+ * Gets the index of this item within it's container.
+ *
+ * This method simply delegates to the model.
+ *
+ * @method
+ * @returns {Integer} Index of item in it's container
+ */
+es.ViewListItem.prototype.getIndex = function() {
+ return this.model.getIndex();
+};
+
+/* Inheritance */
+
+es.extend( es.ViewListItem, es.EventEmitter );
Property changes on: trunk/parsers/wikidom/lib/synth/bases/es.ViewListItem.js
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -2,14 +2,14 @@
* Creates an es.BlockModel object.
*
* @class
- * @extends {es.ModelContainerItem}
+ * @extends {es.ModelListItem}
* @abstract
* @constructor
* @param traits {Array} List of trait names
* @property traits {Array} List of trait names
*/
es.BlockModel = function( traits ) {
- es.ModelContainerItem.call( this, 'document' );
+ es.ModelListItem.call( this, 'document' );
this.traits = traits || [];
};
@@ -173,4 +173,4 @@
throw 'BlockModel.getPlainObject not implemented in this subclass.';
};
-es.extend( es.BlockModel, es.ModelContainerItem );
+es.extend( es.BlockModel, es.ModelListItem );
Modified: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -9,7 +9,7 @@
* @property attributes {Object}
*/
es.DocumentModel = function( blocks, attributes ) {
- es.ModelContainer.call( this );
+ es.ModelList.call( this );
this.items = new es.AggregateArray( blocks || [] );
this.attributes = attributes || {};
};
@@ -60,4 +60,4 @@
return this.items.getContentLength();
};
-es.extend( es.DocumentModel, es.ModelContainer );
+es.extend( es.DocumentModel, es.ModelList );
Modified: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -9,7 +9,7 @@
* @property styles {Array}
*/
es.ListBlockItemModel = function( content, styles ) {
- es.ModelContainerItem.call( this );
+ es.ModelListItem.call( this );
this.content = content || null;
this.styles = styles || ['bullet'];
};
@@ -57,4 +57,4 @@
/* Inheritance */
-es.extend( es.ListBlockItemModel, es.ModelContainerItem );
\ No newline at end of file
+es.extend( es.ListBlockItemModel, es.ModelListItem );
\ No newline at end of file
Modified: trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -8,7 +8,7 @@
*/
es.ListBlockModel = function( items ) {
es.BlockModel.call( this, ['hasContent', 'isAnnotatable',
'isAggregate'] );
- es.ModelContainer.call( this );
+ es.ModelList.call( this );
if ( $.isArray( items ) ) {
for ( var i = 0; i < items.length; i++ ) {
this.append( items[i] );
@@ -116,4 +116,4 @@
/* Inheritance */
es.extend( es.ListBlockModel, es.BlockModel );
-es.extend( es.ListBlockModel, es.ModelContainer );
+es.extend( es.ListBlockModel, es.ModelList );
Modified: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -9,7 +9,7 @@
* @property attributes {Object}
*/
es.TableBlockCellModel = function( documentModel, attributes ) {
- es.ModelContainerItem.call( this );
+ es.ModelListItem.call( this );
this.documentModel = documentModel || null;
this.attributes = attributes || {};
};
@@ -70,4 +70,4 @@
/* Inheritance */
-es.extend( es.TableBlockCellModel, es.ModelContainerItem );
\ No newline at end of file
+es.extend( es.TableBlockCellModel, es.ModelListItem );
\ No newline at end of file
Modified: trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -10,7 +10,7 @@
*/
es.TableBlockModel = function( rows, attributes ) {
es.BlockModel.call( this, ['isDocumentContainer', 'isAggregate'] );
- es.ModelContainer.call( this );
+ es.ModelList.call( this );
if ( $.isArray( rows ) ) {
for ( var i = 0; i < rows.length; i++ ) {
@@ -87,4 +87,4 @@
/* Inheritance */
es.extend( es.TableBlockModel, es.BlockModel );
-es.extend( es.TableBlockModel, es.ModelContainer );
+es.extend( es.TableBlockModel, es.ModelList );
Modified: trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -9,8 +9,8 @@
* @property attributes {Object}
*/
es.TableBlockRowModel = function( items, attributes ) {
- es.ModelContainerItem.call( this );
- es.ModelContainer.call( this );
+ es.ModelListItem.call( this );
+ es.ModelList.call( this );
if ( $.isArray( items ) ) {
for ( var i = 0; i < items.length; i++ ) {
@@ -82,5 +82,5 @@
/* Inheritance */
-es.extend( es.TableBlockRowModel, es.ModelContainerItem );
-es.extend( es.TableBlockRowModel, es.ModelContainer );
+es.extend( es.TableBlockRowModel, es.ModelListItem );
+es.extend( es.TableBlockRowModel, es.ModelList );
Modified: trunk/parsers/wikidom/lib/synth/views/es.BlockView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.BlockView.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.BlockView.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -9,7 +9,7 @@
* @param tagName {String} HTML tag name to use in rendering (optional,
default: "div")
*/
es.BlockView = function( blockModel, typeName, tagName ) {
- es.ViewContainerItem.call( this, blockModel, typeName || 'block',
tagName || 'div' );
+ es.ViewListItem.call( this, blockModel, typeName || 'block', tagName ||
'div' );
this.$.addClass( 'editSurface-block' );
};
@@ -50,4 +50,4 @@
/* Inheritance */
-es.extend( es.BlockView, es.ViewContainerItem );
+es.extend( es.BlockView, es.ViewListItem );
Modified: trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -5,7 +5,7 @@
* @constructor
*/
es.DocumentView = function( documentModel ) {
- es.ViewContainer.call( this, documentModel, 'document' );
+ es.ViewList.call( this, documentModel, 'document' );
};
/**
@@ -49,4 +49,4 @@
/* Inheritance */
-es.extend( es.DocumentView, es.ViewContainer );
+es.extend( es.DocumentView, es.ViewList );
Modified: trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -5,7 +5,7 @@
* @constructor
*/
es.ListBlockItemView = function( model ) {
- es.ViewContainerItem.call( this, model, 'listItem' );
+ es.ViewListItem.call( this, model, 'listItem' );
this.$icon = $( '<div class="editSurface-listItem-icon"></div>' );
this.$content = $( '<div class="editSurface-listItem-content"></div>' );
this.$
@@ -77,4 +77,4 @@
/* Inheritance */
-es.extend( es.ListBlockItemView, es.ViewContainerItem );
+es.extend( es.ListBlockItemView, es.ViewListItem );
Modified: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -5,7 +5,7 @@
* @constructor
*/
es.ListBlockView = function( model ) {
- es.ViewContainer.call( this, model, 'list' );
+ es.ViewList.call( this, model, 'list' );
es.BlockView.call( this, model, 'list' );
var view = this;
this.on( 'update', function() {
@@ -91,5 +91,5 @@
/* Inheritance */
-es.extend( es.ListBlockView, es.ViewContainer );
+es.extend( es.ListBlockView, es.ViewList );
es.extend( es.ListBlockView, es.BlockView );
Modified: trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -5,7 +5,7 @@
* @constructor
*/
es.TableBlockCellView = function( model ) {
- es.ViewContainerItem.call( this, model, 'cell', 'td' );
+ es.ViewListItem.call( this, model, 'cell', 'td' );
this.documentView = new es.DocumentView( this.model.documentModel );
this.$.append( this.documentView.$ );
@@ -45,4 +45,4 @@
/* Inheritance */
-es.extend( es.TableBlockCellView, es.ViewContainerItem );
+es.extend( es.TableBlockCellView, es.ViewListItem );
Modified: trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
2011-09-19 22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
2011-09-19 23:07:57 UTC (rev 97571)
@@ -5,8 +5,8 @@
* @constructor
*/
es.TableBlockRowView = function( model ) {
- es.ViewContainer.call( this, model, 'row', 'tr' )
- es.ViewContainerItem.call( this, model, 'tr' );
+ es.ViewList.call( this, model, 'row', 'tr' )
+ es.ViewListItem.call( this, model, 'tr' );
var classes = this.$.attr('class');
for ( var name in this.model.attributes ) {
@@ -52,5 +52,5 @@
/* Inheritance */
-es.extend( es.TableBlockRowView, es.ViewContainer );
-es.extend( es.TableBlockRowView, es.ViewContainerItem );
+es.extend( es.TableBlockRowView, es.ViewList );
+es.extend( es.TableBlockRowView, es.ViewListItem );
Modified: trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js
===================================================================
--- trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js 2011-09-19
22:52:45 UTC (rev 97570)
+++ trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js 2011-09-19
23:07:57 UTC (rev 97571)
@@ -5,7 +5,7 @@
* @constructor
*/
es.TableBlockView = function( model ) {
- es.ViewContainer.call( this, model, 'table', 'table' );
+ es.ViewList.call( this, model, 'table', 'table' );
es.BlockView.call( this, model, 'table', 'table' );
var classes = this.$.attr('class');
@@ -52,5 +52,5 @@
/* Inheritance */
-es.extend( es.TableBlockView, es.ViewContainer );
+es.extend( es.TableBlockView, es.ViewList );
es.extend( es.TableBlockView, es.BlockView );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs