Index: trunk/parsers/wikidom/lib/es/es.Block.js |
— | — | @@ -19,6 +19,8 @@ |
20 | 20 | /** |
21 | 21 | * Association between block type-name and block constructor |
22 | 22 | * |
| 23 | + * @static |
| 24 | + * @member |
23 | 25 | * @example "paragraph" => es.ParagraphBlock |
24 | 26 | */ |
25 | 27 | es.Block.models = {}; |
— | — | @@ -28,6 +30,8 @@ |
29 | 31 | /** |
30 | 32 | * Creates a new block object from Wikidom data. |
31 | 33 | * |
| 34 | + * @static |
| 35 | + * @method |
32 | 36 | * @param wikidomBlock {Object} Wikidom data to convert from |
33 | 37 | */ |
34 | 38 | es.Block.newFromWikidom = function( wikidomBlock ) { |
— | — | @@ -43,6 +47,7 @@ |
44 | 48 | /** |
45 | 49 | * Gets the index of the block within it's document. |
46 | 50 | * |
| 51 | + * @method |
47 | 52 | * @returns {Integer} Index of block |
48 | 53 | */ |
49 | 54 | es.Block.prototype.getIndex = function() { |
— | — | @@ -55,6 +60,7 @@ |
56 | 61 | /** |
57 | 62 | * Gets the next block in the document. |
58 | 63 | * |
| 64 | + * @method |
59 | 65 | * @returns {es.Block|Null} Block directly proceeding this one, or null if none exists |
60 | 66 | */ |
61 | 67 | es.Block.prototype.nextBlock = function() { |
— | — | @@ -68,6 +74,7 @@ |
69 | 75 | /** |
70 | 76 | * Gets the previous block in the document. |
71 | 77 | * |
| 78 | + * @method |
72 | 79 | * @returns {es.Block|Null} Block directly preceding this one, or null if none exists |
73 | 80 | */ |
74 | 81 | es.Block.prototype.previousBlock = function() { |
— | — | @@ -80,6 +87,9 @@ |
81 | 88 | |
82 | 89 | /** |
83 | 90 | * Gets the length of all block content. |
| 91 | + * |
| 92 | + * @method |
| 93 | + * @returns {Integer} Length of block content |
84 | 94 | */ |
85 | 95 | es.Block.prototype.getLength = function() { |
86 | 96 | throw 'Block.getLength not implemented in this subclass.'; |
— | — | @@ -88,6 +98,7 @@ |
89 | 99 | /** |
90 | 100 | * Inserts content into a block at an offset. |
91 | 101 | * |
| 102 | + * @method |
92 | 103 | * @param offset {Integer} Position to insert content at |
93 | 104 | * @param content {Object} Content to insert |
94 | 105 | */ |
— | — | @@ -98,6 +109,7 @@ |
99 | 110 | /** |
100 | 111 | * Deletes content in a block within a range. |
101 | 112 | * |
| 113 | + * @method |
102 | 114 | * @param range {es.Range} Range of content to remove |
103 | 115 | */ |
104 | 116 | es.Block.prototype.deleteContent = function( range ) { |
— | — | @@ -109,6 +121,7 @@ |
110 | 122 | * |
111 | 123 | * If a range arguments are not provided, all content will be annotated. |
112 | 124 | * |
| 125 | + * @method |
113 | 126 | * @param method {String} Way to apply annotation ("toggle", "add" or "remove") |
114 | 127 | * @param annotation {Object} Annotation to apply |
115 | 128 | * @param range {es.Range} Range of content to annotate |
— | — | @@ -120,17 +133,21 @@ |
121 | 134 | /** |
122 | 135 | * Gets content within a range. |
123 | 136 | * |
| 137 | + * @method |
124 | 138 | * @param range {es.Range} Range of content to get |
| 139 | + * @returns {es.Content} Content within range |
125 | 140 | */ |
126 | | -es.Block.prototype.getContent = function( range) { |
| 141 | +es.Block.prototype.getContent = function( range ) { |
127 | 142 | throw 'Block.getContent not implemented in this subclass.'; |
128 | 143 | }; |
129 | 144 | |
130 | 145 | /** |
131 | 146 | * Gets content as plain text within a range. |
132 | 147 | * |
| 148 | + * @method |
133 | 149 | * @param range {es.Range} Range of text to get |
134 | 150 | * @param render {Boolean} If annotations should have any influence on output |
| 151 | + * @returns {String} Text within range |
135 | 152 | */ |
136 | 153 | es.Block.prototype.getText = function( range, render ) { |
137 | 154 | throw 'Block.getText not implemented in this subclass.'; |
— | — | @@ -138,6 +155,9 @@ |
139 | 156 | |
140 | 157 | /** |
141 | 158 | * Renders content into a container. |
| 159 | + * |
| 160 | + * @method |
| 161 | + * @returns {String} Rendered content in HTML format |
142 | 162 | */ |
143 | 163 | es.Block.prototype.renderContent = function() { |
144 | 164 | throw 'Block.renderContent not implemented in this subclass.'; |
— | — | @@ -146,7 +166,9 @@ |
147 | 167 | /** |
148 | 168 | * Gets the offset of a position. |
149 | 169 | * |
150 | | - * @param position {Integer} Offset to translate |
| 170 | + * @method |
| 171 | + * @param position {es.Position} Position to translate |
| 172 | + * @returns {Integer} Offset of position |
151 | 173 | */ |
152 | 174 | es.Block.prototype.getOffset = function( position ) { |
153 | 175 | throw 'Block.getOffset not implemented in this subclass.'; |
— | — | @@ -155,7 +177,9 @@ |
156 | 178 | /** |
157 | 179 | * Gets the position of an offset. |
158 | 180 | * |
| 181 | + * @method |
159 | 182 | * @param offset {Integer} Offset to translate |
| 183 | + * @returns {es.Position} Position of offset |
160 | 184 | */ |
161 | 185 | es.Block.prototype.getPosition = function( offset ) { |
162 | 186 | throw 'Block.getPosition not implemented in this subclass.'; |
— | — | @@ -164,8 +188,9 @@ |
165 | 189 | /** |
166 | 190 | * Gets the start and end points of the word closest a given offset. |
167 | 191 | * |
| 192 | + * @method |
168 | 193 | * @param offset {Integer} Offset to find word nearest to |
169 | | - * @return {Object} Range object of boundaries |
| 194 | + * @return {es.Range} Range object of boundaries |
170 | 195 | */ |
171 | 196 | es.Block.prototype.getWordBoundaries = function( offset ) { |
172 | 197 | throw 'Block.getWordBoundaries not implemented in this subclass.'; |
— | — | @@ -174,8 +199,9 @@ |
175 | 200 | /** |
176 | 201 | * Gets the start and end points of the section closest a given offset. |
177 | 202 | * |
| 203 | + * @method |
178 | 204 | * @param offset {Integer} Offset to find section nearest to |
179 | | - * @return {Object} Range object of boundaries |
| 205 | + * @return {es.Range} Range object of boundaries |
180 | 206 | */ |
181 | 207 | es.Block.prototype.getSectionBoundaries = function( offset ) { |
182 | 208 | throw 'Block.getSectionBoundaries not implemented in this subclass.'; |