Index: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js |
— | — | @@ -38,25 +38,37 @@ |
39 | 39 | /* Methods */ |
40 | 40 | |
41 | 41 | es.DocumentModel.prototype.commit = function( transaction ) { |
42 | | - // commit transaction |
| 42 | + // TODO |
43 | 43 | }; |
44 | 44 | |
45 | 45 | es.DocumentModel.prototype.rollback = function( transaction ) { |
46 | | - // rollback transaction |
| 46 | + // TODO |
47 | 47 | }; |
48 | 48 | |
49 | 49 | es.DocumentModel.prototype.prepareInsertContent = function( offset, content ) { |
50 | | - // generate transaction |
| 50 | + // TODO |
51 | 51 | }; |
52 | 52 | |
53 | 53 | es.DocumentModel.prototype.prepareRemoveContent = function( range ) { |
54 | | - // generate transaction |
| 54 | + // TODO |
55 | 55 | }; |
56 | 56 | |
57 | 57 | es.DocumentModel.prototype.prepareAnnotateContent = function( range, annotation ) { |
58 | | - // generate transaction |
| 58 | + // TODO |
59 | 59 | }; |
60 | 60 | |
| 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 | + |
61 | 73 | es.DocumentModel.prototype.getPlainObject = function() { |
62 | 74 | var obj = {}; |
63 | 75 | if ( this.items.length ) { |
Index: trunk/parsers/wikidom/lib/synth/models/es.ParagraphBlockModel.js |
— | — | @@ -70,6 +70,38 @@ |
71 | 71 | return { 'type': 'paragraph', 'content': this.content.getPlainObject() }; |
72 | 72 | }; |
73 | 73 | |
| 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 | + |
74 | 106 | // Register constructor |
75 | 107 | es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel.newFromPlainObject; |
76 | 108 | |
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js |
— | — | @@ -68,6 +68,38 @@ |
69 | 69 | */ |
70 | 70 | }; |
71 | 71 | |
| 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 | + |
72 | 104 | /* Inheritance */ |
73 | 105 | |
74 | 106 | 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 @@ |
82 | 82 | */ |
83 | 83 | }; |
84 | 84 | |
| 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 | + |
85 | 117 | // Register constructor |
86 | 118 | es.BlockModel.constructors['table'] = es.TableBlockModel.newFromPlainObject; |
87 | 119 | |
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js |
— | — | @@ -55,6 +55,38 @@ |
56 | 56 | return { 'content': this.content.getPlainObject(), 'styles': this.styles.slice( 0 ) }; |
57 | 57 | }; |
58 | 58 | |
| 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 | + |
59 | 91 | /* Inheritance */ |
60 | 92 | |
61 | 93 | 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 @@ |
111 | 111 | return obj; |
112 | 112 | }; |
113 | 113 | |
| 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 | + |
114 | 146 | // Register constructor |
115 | 147 | es.BlockModel.constructors['list'] = es.ListBlockModel.newFromPlainObject |
116 | 148 | |
Index: trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js |
— | — | @@ -164,25 +164,37 @@ |
165 | 165 | }; |
166 | 166 | |
167 | 167 | es.BlockModel.prototype.commit = function( transaction ) { |
168 | | - // commit transaction |
| 168 | + // TODO |
169 | 169 | }; |
170 | 170 | |
171 | 171 | es.BlockModel.prototype.rollback = function( transaction ) { |
172 | | - // rollback transaction |
| 172 | + // TODO |
173 | 173 | }; |
174 | 174 | |
175 | 175 | es.BlockModel.prototype.prepareInsertContent = function( offset, content ) { |
176 | | - // generate transaction |
| 176 | + // TODO |
177 | 177 | }; |
178 | 178 | |
179 | 179 | es.BlockModel.prototype.prepareRemoveContent = function( range ) { |
180 | | - // generate transaction |
| 180 | + // TODO |
181 | 181 | }; |
182 | 182 | |
183 | 183 | es.BlockModel.prototype.prepareAnnotateContent = function( range, annotation ) { |
184 | | - // generate transaction |
| 184 | + // TODO |
185 | 185 | }; |
186 | 186 | |
| 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 | + |
187 | 199 | /** |
188 | 200 | * Gets a plain object representation of block, for serialization. |
189 | 201 | * |
Index: trunk/parsers/wikidom/lib/synth/models/es.ContentModel.js |
— | — | @@ -134,7 +134,6 @@ |
135 | 135 | this.attributes[name] = value; |
136 | 136 | }; |
137 | 137 | |
138 | | - |
139 | 138 | /** |
140 | 139 | * Gets plain text version of the content within a specific range. |
141 | 140 | * |
— | — | @@ -258,26 +257,6 @@ |
259 | 258 | return new es.Range( start, end ); |
260 | 259 | }; |
261 | 260 | |
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 | | - |
282 | 261 | /** |
283 | 262 | * Get a plain content object. |
284 | 263 | * |
— | — | @@ -422,6 +401,26 @@ |
423 | 402 | return -1; |
424 | 403 | }; |
425 | 404 | |
| 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 | + |
426 | 425 | /** |
427 | 426 | * Inserts content data at a specific position. |
428 | 427 | * |
— | — | @@ -433,7 +432,7 @@ |
434 | 433 | * @emits "insert" with offset and content data properties |
435 | 434 | * @emits "change" with type:"insert" data property |
436 | 435 | */ |
437 | | -es.ContentModel.prototype.insert = function( offset, content, autoAnnotate ) { |
| 436 | +es.ContentModel.prototype.insertContent = function( offset, content, autoAnnotate ) { |
438 | 437 | if ( autoAnnotate ) { |
439 | 438 | // TODO: Prefer to not take annotations from a neighbor that's a space character |
440 | 439 | var neighbor = this.data[Math.max( offset - 1, 0 )]; |
— | — | @@ -464,7 +463,7 @@ |
465 | 464 | * @emits "remove" with range data property |
466 | 465 | * @emits "change" with type:"remove" data property |
467 | 466 | */ |
468 | | -es.ContentModel.prototype.remove = function( range ) { |
| 467 | +es.ContentModel.prototype.removeContent = function( range ) { |
469 | 468 | range.normalize(); |
470 | 469 | this.data.splice( range.start, range.getLength() ); |
471 | 470 | this.emit( 'remove', { |
— | — | @@ -502,7 +501,7 @@ |
503 | 502 | * @emits "annotate" with method, annotation and range data properties |
504 | 503 | * @emits "change" with type:"annotate" data property |
505 | 504 | */ |
506 | | -es.ContentModel.prototype.annotate = function( method, annotation, range ) { |
| 505 | +es.ContentModel.prototype.annotateContent = function( method, annotation, range ) { |
507 | 506 | // Support calling without a range argument, using the full content range as default |
508 | 507 | if ( !range ) { |
509 | 508 | range = new es.Range( 0, this.data.length ); |
— | — | @@ -591,4 +590,6 @@ |
592 | 591 | this.emit( 'update', { 'type': 'annotate' } ); |
593 | 592 | }; |
594 | 593 | |
| 594 | +/* Inheritance */ |
| 595 | + |
595 | 596 | es.extend( es.ContentModel, es.EventEmitter ); |
Index: trunk/parsers/wikidom/lib/synth/models/es.HeadingBlockModel.js |
— | — | @@ -56,6 +56,38 @@ |
57 | 57 | return { 'type': 'heading', 'content': this.content.getPlainObject(), 'level': this.level }; |
58 | 58 | }; |
59 | 59 | |
| 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 | + |
60 | 92 | // Register constructor |
61 | 93 | es.BlockModel.constructors['heading'] = es.HeadingBlockModel; |
62 | 94 | |
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js |
— | — | @@ -80,6 +80,38 @@ |
81 | 81 | */ |
82 | 82 | }; |
83 | 83 | |
| 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 | + |
84 | 116 | /* Inheritance */ |
85 | 117 | |
86 | 118 | es.extend( es.TableBlockRowModel, es.ModelListItem ); |