r93362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93361‎ | r93362 | r93363 >
Date:05:40, 28 July 2011
Author:tparscal
Status:ok
Tags:
Comment:
Documentation and cleanup
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Block.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Block.js
@@ -19,6 +19,8 @@
2020 /**
2121 * Association between block type-name and block constructor
2222 *
 23+ * @static
 24+ * @member
2325 * @example "paragraph" => es.ParagraphBlock
2426 */
2527 es.Block.models = {};
@@ -28,6 +30,8 @@
2931 /**
3032 * Creates a new block object from Wikidom data.
3133 *
 34+ * @static
 35+ * @method
3236 * @param wikidomBlock {Object} Wikidom data to convert from
3337 */
3438 es.Block.newFromWikidom = function( wikidomBlock ) {
@@ -43,6 +47,7 @@
4448 /**
4549 * Gets the index of the block within it's document.
4650 *
 51+ * @method
4752 * @returns {Integer} Index of block
4853 */
4954 es.Block.prototype.getIndex = function() {
@@ -55,6 +60,7 @@
5661 /**
5762 * Gets the next block in the document.
5863 *
 64+ * @method
5965 * @returns {es.Block|Null} Block directly proceeding this one, or null if none exists
6066 */
6167 es.Block.prototype.nextBlock = function() {
@@ -68,6 +74,7 @@
6975 /**
7076 * Gets the previous block in the document.
7177 *
 78+ * @method
7279 * @returns {es.Block|Null} Block directly preceding this one, or null if none exists
7380 */
7481 es.Block.prototype.previousBlock = function() {
@@ -80,6 +87,9 @@
8188
8289 /**
8390 * Gets the length of all block content.
 91+ *
 92+ * @method
 93+ * @returns {Integer} Length of block content
8494 */
8595 es.Block.prototype.getLength = function() {
8696 throw 'Block.getLength not implemented in this subclass.';
@@ -88,6 +98,7 @@
8999 /**
90100 * Inserts content into a block at an offset.
91101 *
 102+ * @method
92103 * @param offset {Integer} Position to insert content at
93104 * @param content {Object} Content to insert
94105 */
@@ -98,6 +109,7 @@
99110 /**
100111 * Deletes content in a block within a range.
101112 *
 113+ * @method
102114 * @param range {es.Range} Range of content to remove
103115 */
104116 es.Block.prototype.deleteContent = function( range ) {
@@ -109,6 +121,7 @@
110122 *
111123 * If a range arguments are not provided, all content will be annotated.
112124 *
 125+ * @method
113126 * @param method {String} Way to apply annotation ("toggle", "add" or "remove")
114127 * @param annotation {Object} Annotation to apply
115128 * @param range {es.Range} Range of content to annotate
@@ -120,17 +133,21 @@
121134 /**
122135 * Gets content within a range.
123136 *
 137+ * @method
124138 * @param range {es.Range} Range of content to get
 139+ * @returns {es.Content} Content within range
125140 */
126 -es.Block.prototype.getContent = function( range) {
 141+es.Block.prototype.getContent = function( range ) {
127142 throw 'Block.getContent not implemented in this subclass.';
128143 };
129144
130145 /**
131146 * Gets content as plain text within a range.
132147 *
 148+ * @method
133149 * @param range {es.Range} Range of text to get
134150 * @param render {Boolean} If annotations should have any influence on output
 151+ * @returns {String} Text within range
135152 */
136153 es.Block.prototype.getText = function( range, render ) {
137154 throw 'Block.getText not implemented in this subclass.';
@@ -138,6 +155,9 @@
139156
140157 /**
141158 * Renders content into a container.
 159+ *
 160+ * @method
 161+ * @returns {String} Rendered content in HTML format
142162 */
143163 es.Block.prototype.renderContent = function() {
144164 throw 'Block.renderContent not implemented in this subclass.';
@@ -146,7 +166,9 @@
147167 /**
148168 * Gets the offset of a position.
149169 *
150 - * @param position {Integer} Offset to translate
 170+ * @method
 171+ * @param position {es.Position} Position to translate
 172+ * @returns {Integer} Offset of position
151173 */
152174 es.Block.prototype.getOffset = function( position ) {
153175 throw 'Block.getOffset not implemented in this subclass.';
@@ -155,7 +177,9 @@
156178 /**
157179 * Gets the position of an offset.
158180 *
 181+ * @method
159182 * @param offset {Integer} Offset to translate
 183+ * @returns {es.Position} Position of offset
160184 */
161185 es.Block.prototype.getPosition = function( offset ) {
162186 throw 'Block.getPosition not implemented in this subclass.';
@@ -164,8 +188,9 @@
165189 /**
166190 * Gets the start and end points of the word closest a given offset.
167191 *
 192+ * @method
168193 * @param offset {Integer} Offset to find word nearest to
169 - * @return {Object} Range object of boundaries
 194+ * @return {es.Range} Range object of boundaries
170195 */
171196 es.Block.prototype.getWordBoundaries = function( offset ) {
172197 throw 'Block.getWordBoundaries not implemented in this subclass.';
@@ -174,8 +199,9 @@
175200 /**
176201 * Gets the start and end points of the section closest a given offset.
177202 *
 203+ * @method
178204 * @param offset {Integer} Offset to find section nearest to
179 - * @return {Object} Range object of boundaries
 205+ * @return {es.Range} Range object of boundaries
180206 */
181207 es.Block.prototype.getSectionBoundaries = function( offset ) {
182208 throw 'Block.getSectionBoundaries not implemented in this subclass.';

Status & tagging log