Index: trunk/parsers/wikidom/lib/es/es.ListBlock.js |
— | — | @@ -1,3 +1,6 @@ |
| 2 | +/**
|
| 3 | + * es.ListBlockList
|
| 4 | + */
|
2 | 5 | es.ListBlockList = function( style, items ) {
|
3 | 6 | // Convert items to es.ListBlockItem objects
|
4 | 7 | var listItems = [];
|
— | — | @@ -58,6 +61,9 @@ |
59 | 62 |
|
60 | 63 | es.extend( es.ListBlockList, es.Container );
|
61 | 64 |
|
| 65 | +/**
|
| 66 | + * es.ListBlockItem
|
| 67 | + */
|
62 | 68 | es.ListBlockItem = function( line, lists ) {
|
63 | 69 | // Convert items to es.ListBlockItem objects
|
64 | 70 | var itemLists = [];
|
— | — | @@ -84,6 +90,16 @@ |
85 | 91 | } );
|
86 | 92 | }
|
87 | 93 |
|
| 94 | +es.ListBlockItem.prototype.getLength = function() {
|
| 95 | + var length = this.content.getLength();
|
| 96 | + for ( var i = 0; i < this.lists.length; i++ ) {
|
| 97 | + length += this.lists[i].getLength();
|
| 98 | + }
|
| 99 | + return length;
|
| 100 | +};
|
| 101 | +
|
| 102 | +
|
| 103 | +
|
88 | 104 | es.ListBlockList.prototype.getLocation = function( offset ) {
|
89 | 105 | if ( offset < this.content.length ) {
|
90 | 106 | return {
|
— | — | @@ -102,14 +118,6 @@ |
103 | 119 | }
|
104 | 120 | };
|
105 | 121 |
|
106 | | -es.ListBlockList.prototype.getLength = function() {
|
107 | | - var length = this.content.getLength();
|
108 | | - for ( var i = 0; i < this.lists.length; i++ ) {
|
109 | | - length += this.lists[i].getLength();
|
110 | | - }
|
111 | | - return length;
|
112 | | -};
|
113 | | -
|
114 | 122 | es.ListBlockItem.prototype.renderContent = function( offset ) {
|
115 | 123 | // TODO: Abstract offset and use it when rendering
|
116 | 124 | this.flow.render();
|
— | — | @@ -120,6 +128,9 @@ |
121 | 129 |
|
122 | 130 | es.extend( es.ListBlockItem, es.Container );
|
123 | 131 |
|
| 132 | +/**
|
| 133 | + * es.ListBlock |
| 134 | + */
|
124 | 135 | es.ListBlock = function( style, items ) {
|
125 | 136 | es.Block.call( this );
|
126 | 137 | this.list = new es.ListBlockList( style, items );
|