r92774 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92773‎ | r92774 | r92775 >
Date:19:03, 21 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Change the way how Document and Blocks are initialized. Implement many static class constructors.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Document.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Document.js
@@ -9,6 +9,18 @@
1010 this.width = null;
1111 }
1212
 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+
1325 es.Document.prototype.renderBlocks = function() {
1426 // Bypass rendering when width has not changed
1527 var width = this.$.innerWidth();

Status & tagging log