r98546 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98545‎ | r98546 | r98547 >
Date:18:36, 30 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
* Made es.DocumentModel inherit es.DocumentModelNode
* Fixed broken inheritance call in es.ParagraphModel
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/models/es.ParagraphModel.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js
@@ -9,6 +9,9 @@
1010 * @param {Array} data Model data to initialize with, such as data from es.DocumentModel.getData()
1111 */
1212 es.DocumentModel = function( data ) {
 13+ // Inheritance
 14+ es.DocumentModelNode.call( this, length );
 15+
1316 this.data = $.isArray( data ) ? data : [];
1417 };
1518
@@ -71,6 +74,16 @@
7275 /* Methods */
7376
7477 /**
 78+ * Gets the length of all document content.
 79+ *
 80+ * @method
 81+ * @returns {Integer} Length of document content
 82+ */
 83+es.DocumentModel.getContentLength = function() {
 84+ return this.data.length;
 85+};
 86+
 87+/**
7588 * Gets copy of the document data.
7689 *
7790 * @method
@@ -202,6 +215,10 @@
203216 //
204217 };
205218
 219+/* Inheritance */
 220+
 221+es.extend( es.DocumentModel, es.DocumentModelNode );
 222+
206223 /*
207224 * SCRATCH CODE
208225 *
Index: trunk/parsers/wikidom/lib/hype/models/es.ParagraphModel.js
@@ -6,7 +6,7 @@
77 */
88 es.ParagraphModel = function( length ) {
99 // Inheritance
10 - es.DocumentModelNode.call( length );
 10+ es.DocumentModelNode.call( this, length );
1111 };
1212
1313 /* Inheritance */

Status & tagging log