Index: trunk/parsers/wikidom/lib/es/es.Document.js |
— | — | @@ -9,6 +9,18 @@ |
10 | 10 | this.width = null; |
11 | 11 | } |
12 | 12 | |
| 13 | +es.Document.newFromWikidom = function( wikidomBlocks ) { |
| 14 | + var blocks = []; |
| 15 | + var block; |
| 16 | + for ( var i = 0; i < wikidomBlocks.length; i++ ) { |
| 17 | + block = es.Block.newFromWikidom( wikidomBlocks[i] ); |
| 18 | + if ( block ) { |
| 19 | + blocks.push( block ); |
| 20 | + } |
| 21 | + } |
| 22 | + return new es.Document( blocks ); |
| 23 | +} |
| 24 | + |
13 | 25 | es.Document.prototype.renderBlocks = function() { |
14 | 26 | // Bypass rendering when width has not changed |
15 | 27 | var width = this.$.innerWidth(); |