r97827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97826‎ | r97827 | r97828 >
Date:17:21, 22 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added transaction methods to all models (still empty, many will just delegate)
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.ContentModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.HeadingBlockModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.ParagraphBlockModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js
@@ -38,25 +38,37 @@
3939 /* Methods */
4040
4141 es.DocumentModel.prototype.commit = function( transaction ) {
42 - // commit transaction
 42+ // TODO
4343 };
4444
4545 es.DocumentModel.prototype.rollback = function( transaction ) {
46 - // rollback transaction
 46+ // TODO
4747 };
4848
4949 es.DocumentModel.prototype.prepareInsertContent = function( offset, content ) {
50 - // generate transaction
 50+ // TODO
5151 };
5252
5353 es.DocumentModel.prototype.prepareRemoveContent = function( range ) {
54 - // generate transaction
 54+ // TODO
5555 };
5656
5757 es.DocumentModel.prototype.prepareAnnotateContent = function( range, annotation ) {
58 - // generate transaction
 58+ // TODO
5959 };
6060
 61+es.DocumentModel.prototype.insertContent = function( offset, content ) {
 62+ // TODO
 63+};
 64+
 65+es.DocumentModel.prototype.removeContent = function( range ) {
 66+ // TODO
 67+};
 68+
 69+es.DocumentModel.prototype.annotateContent = function( range, annotation ) {
 70+ // TODO
 71+};
 72+
6173 es.DocumentModel.prototype.getPlainObject = function() {
6274 var obj = {};
6375 if ( this.items.length ) {
Index: trunk/parsers/wikidom/lib/synth/models/es.ParagraphBlockModel.js
@@ -70,6 +70,38 @@
7171 return { 'type': 'paragraph', 'content': this.content.getPlainObject() };
7272 };
7373
 74+es.ParagraphBlockModel.prototype.commit = function( transaction ) {
 75+ // TODO
 76+};
 77+
 78+es.ParagraphBlockModel.prototype.rollback = function( transaction ) {
 79+ // TODO
 80+};
 81+
 82+es.ParagraphBlockModel.prototype.prepareInsertContent = function( offset, content ) {
 83+ // TODO
 84+};
 85+
 86+es.ParagraphBlockModel.prototype.prepareRemoveContent = function( range ) {
 87+ // TODO
 88+};
 89+
 90+es.ParagraphBlockModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 91+ // TODO
 92+};
 93+
 94+es.ParagraphBlockModel.prototype.insertContent = function( offset, content ) {
 95+ // TODO
 96+};
 97+
 98+es.ParagraphBlockModel.prototype.removeContent = function( range ) {
 99+ // TODO
 100+};
 101+
 102+es.ParagraphBlockModel.prototype.annotateContent = function( range, annotation ) {
 103+ // TODO
 104+};
 105+
74106 // Register constructor
75107 es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel.newFromPlainObject;
76108
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
@@ -68,6 +68,38 @@
6969 */
7070 };
7171
 72+es.TableBlockCellModel.prototype.commit = function( transaction ) {
 73+ // TODO
 74+};
 75+
 76+es.TableBlockCellModel.prototype.rollback = function( transaction ) {
 77+ // TODO
 78+};
 79+
 80+es.TableBlockCellModel.prototype.prepareInsertContent = function( offset, content ) {
 81+ // TODO
 82+};
 83+
 84+es.TableBlockCellModel.prototype.prepareRemoveContent = function( range ) {
 85+ // TODO
 86+};
 87+
 88+es.TableBlockCellModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 89+ // TODO
 90+};
 91+
 92+es.TableBlockCellModel.prototype.insertContent = function( offset, content ) {
 93+ // TODO
 94+};
 95+
 96+es.TableBlockCellModel.prototype.removeContent = function( range ) {
 97+ // TODO
 98+};
 99+
 100+es.TableBlockCellModel.prototype.annotateContent = function( range, annotation ) {
 101+ // TODO
 102+};
 103+
72104 /* Inheritance */
73105
74106 es.extend( es.TableBlockCellModel, es.ModelListItem );
\ No newline at end of file
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
@@ -81,6 +81,38 @@
8282 */
8383 };
8484
 85+es.TableBlockModel.prototype.commit = function( transaction ) {
 86+ // TODO
 87+};
 88+
 89+es.TableBlockModel.prototype.rollback = function( transaction ) {
 90+ // TODO
 91+};
 92+
 93+es.TableBlockModel.prototype.prepareInsertContent = function( offset, content ) {
 94+ // TODO
 95+};
 96+
 97+es.TableBlockModel.prototype.prepareRemoveContent = function( range ) {
 98+ // TODO
 99+};
 100+
 101+es.TableBlockModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 102+ // TODO
 103+};
 104+
 105+es.TableBlockModel.prototype.insertContent = function( offset, content ) {
 106+ // TODO
 107+};
 108+
 109+es.TableBlockModel.prototype.removeContent = function( range ) {
 110+ // TODO
 111+};
 112+
 113+es.TableBlockModel.prototype.annotateContent = function( range, annotation ) {
 114+ // TODO
 115+};
 116+
85117 // Register constructor
86118 es.BlockModel.constructors['table'] = es.TableBlockModel.newFromPlainObject;
87119
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
@@ -55,6 +55,38 @@
5656 return { 'content': this.content.getPlainObject(), 'styles': this.styles.slice( 0 ) };
5757 };
5858
 59+es.ListBlockItemModel.prototype.commit = function( transaction ) {
 60+ // TODO
 61+};
 62+
 63+es.ListBlockItemModel.prototype.rollback = function( transaction ) {
 64+ // TODO
 65+};
 66+
 67+es.ListBlockItemModel.prototype.prepareInsertContent = function( offset, content ) {
 68+ // TODO
 69+};
 70+
 71+es.ListBlockItemModel.prototype.prepareRemoveContent = function( range ) {
 72+ // TODO
 73+};
 74+
 75+es.ListBlockItemModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 76+ // TODO
 77+};
 78+
 79+es.ListBlockItemModel.prototype.insertContent = function( offset, content ) {
 80+ // TODO
 81+};
 82+
 83+es.ListBlockItemModel.prototype.removeContent = function( range ) {
 84+ // TODO
 85+};
 86+
 87+es.ListBlockItemModel.prototype.annotateContent = function( range, annotation ) {
 88+ // TODO
 89+};
 90+
5991 /* Inheritance */
6092
6193 es.extend( es.ListBlockItemModel, es.ModelListItem );
\ No newline at end of file
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js
@@ -110,6 +110,38 @@
111111 return obj;
112112 };
113113
 114+es.ListBlockModel.prototype.commit = function( transaction ) {
 115+ // TODO
 116+};
 117+
 118+es.ListBlockModel.prototype.rollback = function( transaction ) {
 119+ // TODO
 120+};
 121+
 122+es.ListBlockModel.prototype.prepareInsertContent = function( offset, content ) {
 123+ // TODO
 124+};
 125+
 126+es.ListBlockModel.prototype.prepareRemoveContent = function( range ) {
 127+ // TODO
 128+};
 129+
 130+es.ListBlockModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 131+ // TODO
 132+};
 133+
 134+es.ListBlockModel.prototype.insertContent = function( offset, content ) {
 135+ // TODO
 136+};
 137+
 138+es.ListBlockModel.prototype.removeContent = function( range ) {
 139+ // TODO
 140+};
 141+
 142+es.ListBlockModel.prototype.annotateContent = function( range, annotation ) {
 143+ // TODO
 144+};
 145+
114146 // Register constructor
115147 es.BlockModel.constructors['list'] = es.ListBlockModel.newFromPlainObject
116148
Index: trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js
@@ -164,25 +164,37 @@
165165 };
166166
167167 es.BlockModel.prototype.commit = function( transaction ) {
168 - // commit transaction
 168+ // TODO
169169 };
170170
171171 es.BlockModel.prototype.rollback = function( transaction ) {
172 - // rollback transaction
 172+ // TODO
173173 };
174174
175175 es.BlockModel.prototype.prepareInsertContent = function( offset, content ) {
176 - // generate transaction
 176+ // TODO
177177 };
178178
179179 es.BlockModel.prototype.prepareRemoveContent = function( range ) {
180 - // generate transaction
 180+ // TODO
181181 };
182182
183183 es.BlockModel.prototype.prepareAnnotateContent = function( range, annotation ) {
184 - // generate transaction
 184+ // TODO
185185 };
186186
 187+es.BlockModel.prototype.insertContent = function( offset, content ) {
 188+ // TODO
 189+};
 190+
 191+es.BlockModel.prototype.removeContent = function( range ) {
 192+ // TODO
 193+};
 194+
 195+es.BlockModel.prototype.annotateContent = function( range, annotation ) {
 196+ // TODO
 197+};
 198+
187199 /**
188200 * Gets a plain object representation of block, for serialization.
189201 *
Index: trunk/parsers/wikidom/lib/synth/models/es.ContentModel.js
@@ -134,7 +134,6 @@
135135 this.attributes[name] = value;
136136 };
137137
138 -
139138 /**
140139 * Gets plain text version of the content within a specific range.
141140 *
@@ -258,26 +257,6 @@
259258 return new es.Range( start, end );
260259 };
261260
262 -es.ContentModel.prototype.commit = function( transaction ) {
263 - // commit transaction
264 -};
265 -
266 -es.ContentModel.prototype.rollback = function( transaction ) {
267 - // rollback transaction
268 -};
269 -
270 -es.ContentModel.prototype.prepareInsertContent = function( offset, content ) {
271 - // generate transaction
272 -};
273 -
274 -es.ContentModel.prototype.prepareRemoveContent = function( range ) {
275 - // generate transaction
276 -};
277 -
278 -es.ContentModel.prototype.prepareAnnotateContent = function( range, annotation ) {
279 - // generate transaction
280 -};
281 -
282261 /**
283262 * Get a plain content object.
284263 *
@@ -422,6 +401,26 @@
423402 return -1;
424403 };
425404
 405+es.ContentModel.prototype.commit = function( transaction ) {
 406+ // TODO
 407+};
 408+
 409+es.ContentModel.prototype.rollback = function( transaction ) {
 410+ // TODO
 411+};
 412+
 413+es.ContentModel.prototype.prepareInsertContent = function( offset, content ) {
 414+ // TODO
 415+};
 416+
 417+es.ContentModel.prototype.prepareRemoveContent = function( range ) {
 418+ // TODO
 419+};
 420+
 421+es.ContentModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 422+ // TODO
 423+};
 424+
426425 /**
427426 * Inserts content data at a specific position.
428427 *
@@ -433,7 +432,7 @@
434433 * @emits "insert" with offset and content data properties
435434 * @emits "change" with type:"insert" data property
436435 */
437 -es.ContentModel.prototype.insert = function( offset, content, autoAnnotate ) {
 436+es.ContentModel.prototype.insertContent = function( offset, content, autoAnnotate ) {
438437 if ( autoAnnotate ) {
439438 // TODO: Prefer to not take annotations from a neighbor that's a space character
440439 var neighbor = this.data[Math.max( offset - 1, 0 )];
@@ -464,7 +463,7 @@
465464 * @emits "remove" with range data property
466465 * @emits "change" with type:"remove" data property
467466 */
468 -es.ContentModel.prototype.remove = function( range ) {
 467+es.ContentModel.prototype.removeContent = function( range ) {
469468 range.normalize();
470469 this.data.splice( range.start, range.getLength() );
471470 this.emit( 'remove', {
@@ -502,7 +501,7 @@
503502 * @emits "annotate" with method, annotation and range data properties
504503 * @emits "change" with type:"annotate" data property
505504 */
506 -es.ContentModel.prototype.annotate = function( method, annotation, range ) {
 505+es.ContentModel.prototype.annotateContent = function( method, annotation, range ) {
507506 // Support calling without a range argument, using the full content range as default
508507 if ( !range ) {
509508 range = new es.Range( 0, this.data.length );
@@ -591,4 +590,6 @@
592591 this.emit( 'update', { 'type': 'annotate' } );
593592 };
594593
 594+/* Inheritance */
 595+
595596 es.extend( es.ContentModel, es.EventEmitter );
Index: trunk/parsers/wikidom/lib/synth/models/es.HeadingBlockModel.js
@@ -56,6 +56,38 @@
5757 return { 'type': 'heading', 'content': this.content.getPlainObject(), 'level': this.level };
5858 };
5959
 60+es.HeadingBlockModel.prototype.commit = function( transaction ) {
 61+ // TODO
 62+};
 63+
 64+es.HeadingBlockModel.prototype.rollback = function( transaction ) {
 65+ // TODO
 66+};
 67+
 68+es.HeadingBlockModel.prototype.prepareInsertContent = function( offset, content ) {
 69+ // TODO
 70+};
 71+
 72+es.HeadingBlockModel.prototype.prepareRemoveContent = function( range ) {
 73+ // TODO
 74+};
 75+
 76+es.HeadingBlockModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 77+ // TODO
 78+};
 79+
 80+es.HeadingBlockModel.prototype.insertContent = function( offset, content ) {
 81+ // TODO
 82+};
 83+
 84+es.HeadingBlockModel.prototype.removeContent = function( range ) {
 85+ // TODO
 86+};
 87+
 88+es.HeadingBlockModel.prototype.annotateContent = function( range, annotation ) {
 89+ // TODO
 90+};
 91+
6092 // Register constructor
6193 es.BlockModel.constructors['heading'] = es.HeadingBlockModel;
6294
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
@@ -80,6 +80,38 @@
8181 */
8282 };
8383
 84+es.TableBlockRowModel.prototype.commit = function( transaction ) {
 85+ // TODO
 86+};
 87+
 88+es.TableBlockRowModel.prototype.rollback = function( transaction ) {
 89+ // TODO
 90+};
 91+
 92+es.TableBlockRowModel.prototype.prepareInsertContent = function( offset, content ) {
 93+ // TODO
 94+};
 95+
 96+es.TableBlockRowModel.prototype.prepareRemoveContent = function( range ) {
 97+ // TODO
 98+};
 99+
 100+es.TableBlockRowModel.prototype.prepareAnnotateContent = function( range, annotation ) {
 101+ // TODO
 102+};
 103+
 104+es.TableBlockRowModel.prototype.insertContent = function( offset, content ) {
 105+ // TODO
 106+};
 107+
 108+es.TableBlockRowModel.prototype.removeContent = function( range ) {
 109+ // TODO
 110+};
 111+
 112+es.TableBlockRowModel.prototype.annotateContent = function( range, annotation ) {
 113+ // TODO
 114+};
 115+
84116 /* Inheritance */
85117
86118 es.extend( es.TableBlockRowModel, es.ModelListItem );

Status & tagging log