Index: trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js |
— | — | @@ -9,6 +9,9 @@ |
10 | 10 | * @param {Array} data Model data to initialize with, such as data from es.DocumentModel.getData() |
11 | 11 | */ |
12 | 12 | es.DocumentModel = function( data ) { |
| 13 | + // Inheritance |
| 14 | + es.DocumentModelNode.call( this, length ); |
| 15 | + |
13 | 16 | this.data = $.isArray( data ) ? data : []; |
14 | 17 | }; |
15 | 18 | |
— | — | @@ -71,6 +74,16 @@ |
72 | 75 | /* Methods */ |
73 | 76 | |
74 | 77 | /** |
| 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 | +/** |
75 | 88 | * Gets copy of the document data. |
76 | 89 | * |
77 | 90 | * @method |
— | — | @@ -202,6 +215,10 @@ |
203 | 216 | // |
204 | 217 | }; |
205 | 218 | |
| 219 | +/* Inheritance */ |
| 220 | + |
| 221 | +es.extend( es.DocumentModel, es.DocumentModelNode ); |
| 222 | + |
206 | 223 | /* |
207 | 224 | * SCRATCH CODE |
208 | 225 | * |
Index: trunk/parsers/wikidom/lib/hype/models/es.ParagraphModel.js |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | */ |
8 | 8 | es.ParagraphModel = function( length ) { |
9 | 9 | // Inheritance |
10 | | - es.DocumentModelNode.call( length ); |
| 10 | + es.DocumentModelNode.call( this, length ); |
11 | 11 | }; |
12 | 12 | |
13 | 13 | /* Inheritance */ |