Index: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js |
— | — | @@ -9,9 +9,8 @@ |
10 | 10 | * @property attributes {Object} |
11 | 11 | */ |
12 | 12 | es.DocumentModel = function( blocks, attributes ) { |
13 | | - es.EventEmitter.call( this ); |
14 | | - es.Container.call( this, 'blocks' ); |
15 | | - this.blocks = new es.ContentSeries( blocks || [] ); |
| 13 | + es.ModelContainer.call( this, 'blocks' ); |
| 14 | + this.blocks = new es.AggregateArray( blocks || [] ); |
16 | 15 | this.attributes = attributes || {}; |
17 | 16 | }; |
18 | 17 | |
— | — | @@ -61,5 +60,4 @@ |
62 | 61 | return this.blocks.getContentLength(); |
63 | 62 | }; |
64 | 63 | |
65 | | -es.extend( es.DocumentModel, es.EventEmitter ); |
66 | | -es.extend( es.DocumentModel, es.Container ); |
| 64 | +es.extend( es.DocumentModel, es.ModelContainer ); |
Index: trunk/parsers/wikidom/lib/synth/models/es.ParagraphBlockModel.js |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | * @param obj {Object} |
23 | 23 | */ |
24 | 24 | es.ParagraphBlockModel.newFromPlainObject = function( obj ) { |
25 | | - return new es.ParagraphBlockModel( es.ContentModel.newFromPlainObject( obj ) ); |
| 25 | + return new es.ParagraphBlockModel( es.ContentModel.newFromPlainObject( obj.content ) ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Methods */ |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | }; |
56 | 56 | |
57 | 57 | // Register constructor |
58 | | -es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel; |
| 58 | +es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel.newFromPlainObject; |
59 | 59 | |
60 | 60 | /* Inheritance */ |
61 | 61 | |
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js |
— | — | @@ -3,13 +3,13 @@ |
4 | 4 | * |
5 | 5 | * @class |
6 | 6 | * @constructor |
7 | | - * @param doc {es.DocumentModel} |
| 7 | + * @param documentModel {es.DocumentModel} |
8 | 8 | * @param attributes {Object} |
9 | | - * @property document {es.DocumentModel} |
| 9 | + * @property documentModel {es.DocumentModel} |
10 | 10 | * @property attributes {Object} |
11 | 11 | */ |
12 | | -es.TableBlockCellModel = function( doc, attributes ) { |
13 | | - this.document = doc || null; |
| 12 | +es.TableBlockCellModel = function( documentModel, attributes ) { |
| 13 | + this.documentModel = documentModel || null; |
14 | 14 | this.attributes = attributes || {}; |
15 | 15 | }; |
16 | 16 | |
— | — | @@ -49,8 +49,8 @@ |
50 | 50 | */ |
51 | 51 | es.TableBlockRowModel.prototype.getPlainObject = function() { |
52 | 52 | var obj = {}; |
53 | | - if ( this.document ) { |
54 | | - obj.document = this.document; |
| 53 | + if ( this.documentModel ) { |
| 54 | + obj.document = this.documentModel; |
55 | 55 | } |
56 | 56 | if ( !$.isEmptyObject( this.attributes ) ) { |
57 | 57 | obj.attributes = $.extend( true, {}, this.attributes ); |
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | styles.push( obj.style || 'bullet' ); |
36 | 36 | var items = []; |
37 | 37 | if ( $.isArray( obj.items ) ) { |
38 | | - $.each( obj.items, function( item ) { |
| 38 | + $.each( obj.items, function( i, item ) { |
39 | 39 | if ( $.isPlainObject( item.content ) ) { |
40 | 40 | items.push( |
41 | 41 | new es.ListBlockItemModel( |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | ); |
46 | 46 | } |
47 | 47 | if ( $.isArray( item.lists ) ) { |
48 | | - $.each( item.lists, function( list ) { |
| 48 | + $.each( item.lists, function( i, list ) { |
49 | 49 | items = items.concat( es.ListBlockList.flattenList( list, styles ) ); |
50 | 50 | } ); |
51 | 51 | } |
Index: trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | */ |
12 | 12 | es.BlockModel = function( traits ) { |
13 | 13 | es.EventEmitter.call( this ); |
14 | | - es.ContainerItem.call( this, 'document' ); |
| 14 | + es.ModelContainerItem.call( this, 'document' ); |
15 | 15 | this.traits = traits || []; |
16 | 16 | }; |
17 | 17 | |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | */ |
39 | 39 | es.BlockModel.newFromPlainObject = function( obj ) { |
40 | 40 | if ( obj.type in es.BlockModel.constructors ) { |
41 | | - return new es.BlockModel.constructors[obj.type]( obj ); |
| 41 | + return es.BlockModel.constructors[obj.type]( obj ); |
42 | 42 | } |
43 | 43 | return null; |
44 | 44 | }; |
— | — | @@ -174,4 +174,4 @@ |
175 | 175 | }; |
176 | 176 | |
177 | 177 | es.extend( es.BlockModel, es.EventEmitter ); |
178 | | -es.extend( es.BlockModel, es.ContainerItem ); |
| 178 | +es.extend( es.BlockModel, es.ModelContainerItem ); |
Index: trunk/parsers/wikidom/lib/synth/models/es.ContentModel.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | * @param text {String} Text to convert |
26 | 26 | * @returns {es.ContentModel} Content object containing converted text |
27 | 27 | */ |
28 | | -es.Content.newFromText = function( text ) { |
| 28 | +es.ContentModel.newFromText = function( text ) { |
29 | 29 | return new es.ContentModel( text.split('') ); |
30 | 30 | }; |
31 | 31 | |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | attributes = !$.isPlainObject( obj.attributes ) ? {} : $.extend( true, {}, obj.attributes ); |
75 | 75 | // Render annotations |
76 | 76 | if ( $.isArray( obj.annotations ) ) { |
77 | | - $.each( obj.annotations, function( src ) { |
| 77 | + $.each( obj.annotations, function( i, src ) { |
78 | 78 | // Build simplified annotation object |
79 | 79 | var dst = { 'type': src.type }; |
80 | 80 | if ( 'data' in src ) { |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | * @method |
110 | 110 | * @returns {Integer} Length of content data |
111 | 111 | */ |
112 | | -es.Content.prototype.getLength = function() { |
| 112 | +es.ContentModel.prototype.getLength = function() { |
113 | 113 | return this.data.length; |
114 | 114 | }; |
115 | 115 | |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | * @param name {String} Name of attribute to get value for |
121 | 121 | * @returns {Mixed} Value of attribute, or undefined if attribute does not exist |
122 | 122 | */ |
123 | | -es.Content.prototype.getAttribute = function( name ) { |
| 123 | +es.ContentModel.prototype.getAttribute = function( name ) { |
124 | 124 | return this.attributes[name]; |
125 | 125 | }; |
126 | 126 | |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | * @param name {String} Name of attribute to set value for |
132 | 132 | * @param value {Mixed} Value to set attribute to |
133 | 133 | */ |
134 | | -es.Content.prototype.setAttribute = function( name, value ) { |
| 134 | +es.ContentModel.prototype.setAttribute = function( name, value ) { |
135 | 135 | this.attributes[name] = value; |
136 | 136 | }; |
137 | 137 | |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | * @param render {Boolean} If annotations should have any influence on output |
152 | 152 | * @returns {String} Text within given range |
153 | 153 | */ |
154 | | -es.Content.prototype.getText = function( range, render ) { |
| 154 | +es.ContentModel.prototype.getText = function( range, render ) { |
155 | 155 | if ( !range ) { |
156 | 156 | range = new es.Range( 0, this.data.length ); |
157 | 157 | } else { |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | * @param range {es.Range} Range of content to get |
177 | 177 | * @returns {es.ContentModel} Content object containing data within range |
178 | 178 | */ |
179 | | -es.Content.prototype.getContent = function( range ) { |
| 179 | +es.ContentModel.prototype.getContent = function( range ) { |
180 | 180 | if ( !range ) { |
181 | 181 | range = new es.Range( 0, this.data.length ); |
182 | 182 | } |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | * @param range {es.Range} Range of data to get |
192 | 192 | * @returns {Array} Array of plain text and/or annotated characters within range |
193 | 193 | */ |
194 | | -es.Content.prototype.getData = function( range ) { |
| 194 | +es.ContentModel.prototype.getData = function( range ) { |
195 | 195 | if ( !range ) { |
196 | 196 | range = new es.Range( 0, this.data.length ); |
197 | 197 | } |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | * @param range {es.Range} Range of content to check |
207 | 207 | * @returns {Boolean} If there's any floating objects in range |
208 | 208 | */ |
209 | | -es.Content.prototype.hasFloatingObjects = function( range ) { |
| 209 | +es.ContentModel.prototype.hasFloatingObjects = function( range ) { |
210 | 210 | if ( !range ) { |
211 | 211 | range = new es.Range( 0, this.data.length ); |
212 | 212 | } |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | for ( var i = 0; i < this.data.length; i++ ) { |
215 | 215 | if ( this.data[i].length > 1 ) { |
216 | 216 | for ( var j = 1; j < this.data[i].length; j++ ) { |
217 | | - var isFloating = es.Content.annotationRenderers[this.data[i][j].type].float; |
| 217 | + var isFloating = es.ContentModel.annotationRenderers[this.data[i][j].type].float; |
218 | 218 | if ( isFloating && typeof isFloating === 'function' ) { |
219 | 219 | isFloating = isFloating( this.data[i][j].data ); |
220 | 220 | } |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | * @param offset {Integer} Offset to find word nearest to |
235 | 235 | * @returns {Object} Range object of boundaries |
236 | 236 | */ |
237 | | -es.Content.prototype.getWordBoundaries = function( offset ) { |
| 237 | +es.ContentModel.prototype.getWordBoundaries = function( offset ) { |
238 | 238 | if ( offset < 0 || offset > this.data.length ) { |
239 | 239 | throw 'Out of bounds error. Offset expected to be >= 0 and <= to ' + this.data.length; |
240 | 240 | } |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | * @method |
266 | 266 | * @returns {Object} |
267 | 267 | */ |
268 | | -es.Content.prototype.getPlainObject = function() { |
| 268 | +es.ContentModel.prototype.getPlainObject = function() { |
269 | 269 | var stack = []; |
270 | 270 | // Text and annotations |
271 | 271 | function start( offset, annotation ) { |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | * @param strict {Boolean} Optionally compare annotation data as well as type |
352 | 352 | * @returns {Array} List of indexes of covered characters within content data |
353 | 353 | */ |
354 | | -es.Content.prototype.coverageOfAnnotation = function( range, annotation, strict ) { |
| 354 | +es.ContentModel.prototype.coverageOfAnnotation = function( range, annotation, strict ) { |
355 | 355 | var coverage = []; |
356 | 356 | var i, index; |
357 | 357 | for ( i = range.start; i < range.end; i++ ) { |
— | — | @@ -383,7 +383,7 @@ |
384 | 384 | * @param strict {Boolean} Optionally compare annotation data as well as type |
385 | 385 | * @returns {Integer} Index of first instance of annotation in content |
386 | 386 | */ |
387 | | -es.Content.prototype.indexOfAnnotation = function( offset, annotation, strict ) { |
| 387 | +es.ContentModel.prototype.indexOfAnnotation = function( offset, annotation, strict ) { |
388 | 388 | var annotatedChar = this.data[offset]; |
389 | 389 | var i; |
390 | 390 | if ( typeof annotatedChar !== 'string' ) { |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | * @emits "insert" with offset and content data properties |
415 | 415 | * @emits "change" with type:"insert" data property |
416 | 416 | */ |
417 | | -es.Content.prototype.insert = function( offset, content, autoAnnotate ) { |
| 417 | +es.ContentModel.prototype.insert = function( offset, content, autoAnnotate ) { |
418 | 418 | if ( autoAnnotate ) { |
419 | 419 | // TODO: Prefer to not take annotations from a neighbor that's a space character |
420 | 420 | var neighbor = this.data[Math.max( offset - 1, 0 )]; |
— | — | @@ -444,7 +444,7 @@ |
445 | 445 | * @emits "remove" with range data property |
446 | 446 | * @emits "change" with type:"remove" data property |
447 | 447 | */ |
448 | | -es.Content.prototype.remove = function( range ) { |
| 448 | +es.ContentModel.prototype.remove = function( range ) { |
449 | 449 | range.normalize(); |
450 | 450 | this.data.splice( range.start, range.getLength() ); |
451 | 451 | this.emit( 'remove', { |
— | — | @@ -460,7 +460,7 @@ |
461 | 461 | * @emits "clear" |
462 | 462 | * @emits "change" with type:"clear" data property |
463 | 463 | */ |
464 | | -es.Content.prototype.clear = function() { |
| 464 | +es.ContentModel.prototype.clear = function() { |
465 | 465 | this.data = []; |
466 | 466 | this.emit( 'clear' ); |
467 | 467 | this.emit( 'change', { 'type': 'clear' } ); |
— | — | @@ -482,7 +482,7 @@ |
483 | 483 | * @emits "annotate" with method, annotation and range data properties |
484 | 484 | * @emits "change" with type:"annotate" data property |
485 | 485 | */ |
486 | | -es.Content.prototype.annotate = function( method, annotation, range ) { |
| 486 | +es.ContentModel.prototype.annotate = function( method, annotation, range ) { |
487 | 487 | // Support calling without a range argument, using the full content range as default |
488 | 488 | if ( !range ) { |
489 | 489 | range = new es.Range( 0, this.data.length ); |
Index: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js |
— | — | @@ -16,6 +16,9 @@ |
17 | 17 | es.ViewContainer = function( containerModel, typeName, tagName ) { |
18 | 18 | es.EventEmitter.call( this ); |
19 | 19 | this.containerModel = containerModel; |
| 20 | + if ( !this.containerModel ) { |
| 21 | + return; |
| 22 | + } |
20 | 23 | this.views = []; |
21 | 24 | if ( typeof typeName !== 'string' ) { |
22 | 25 | typeName = 'viewContainer'; |
— | — | @@ -86,7 +89,9 @@ |
87 | 90 | // Auto-add views for existing items |
88 | 91 | var itemModels = this.containerModel.all(); |
89 | 92 | for ( var i = 0; i < itemModels.length; i++ ) { |
90 | | - this.views.push( itemModels[i].createView() ); |
| 93 | + var itemView = itemModels[i].createView(); |
| 94 | + this.views.push( itemView ); |
| 95 | + this.$.append( itemView.$ ); |
91 | 96 | } |
92 | 97 | }; |
93 | 98 | |
Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +/** |
| 3 | + * Creates an es.SurfaceView object. |
| 4 | + */ |
| 5 | +es.SurfaceView = function( $container, documentModel ) { |
| 6 | + this.$ = $container.addClass( 'editSurface' ); |
| 7 | + this.documentModel = documentModel; |
| 8 | + this.documentView = new es.DocumentView( this.documentModel ); |
| 9 | + this.$.append( this.documentView.$ ); |
| 10 | + this.width = null; |
| 11 | + |
| 12 | + var surface = this; |
| 13 | + $(window).resize( function() { |
| 14 | + var width = surface.$.width(); |
| 15 | + if ( surface.width !== width ) { |
| 16 | + surface.width = width; |
| 17 | + surface.documentView.renderContent(); |
| 18 | + } |
| 19 | + } ); |
| 20 | + |
| 21 | + // First render |
| 22 | + this.documentView.renderContent(); |
| 23 | +}; |
Index: trunk/parsers/wikidom/lib/synth/views/es.BlockView.js |
— | — | @@ -8,8 +8,9 @@ |
9 | 9 | * @param typeName {String} Name of block type (optional, default: "block") |
10 | 10 | * @param tagName {String} HTML tag name to use in rendering (optional, default: "div") |
11 | 11 | */ |
12 | | -es.BlockView = function( typeName, tagName ) { |
13 | | - es.ViewContainerItem.call( this, 'document', typeName || 'block', tagName || 'div' ); |
| 12 | +es.BlockView = function( blockModel, typeName, tagName ) { |
| 13 | + es.ViewContainerItem.call( this, blockModel, typeName || 'block', tagName || 'div' ); |
| 14 | + this.$.addClass( 'editSurface-block' ); |
14 | 15 | }; |
15 | 16 | |
16 | 17 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js |
— | — | @@ -1,7 +1,16 @@ |
2 | 2 | es.DocumentView = function( documentModel ) { |
3 | | - es.ViewContainer.call( this, documentModel, 'blocks' ); |
| 3 | + es.ViewContainer.call( this, documentModel, 'document' ); |
4 | 4 | }; |
5 | 5 | |
| 6 | +/** |
| 7 | + * Render content. |
| 8 | + */ |
| 9 | +es.DocumentView.prototype.renderContent = function() { |
| 10 | + for ( var i = 0; i < this.views.length; i++ ) { |
| 11 | + this.views[i].renderContent(); |
| 12 | + } |
| 13 | +}; |
| 14 | + |
6 | 15 | /* Inheritance */ |
7 | 16 | |
8 | 17 | es.extend( es.DocumentView, es.ViewContainer ); |
Index: trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js |
— | — | @@ -1,9 +1,37 @@ |
2 | 2 | /** |
3 | | - * |
| 3 | + * Creates an es.ParagraphBlockView object. |
4 | 4 | */ |
5 | 5 | es.ParagraphBlockView = function( model ) { |
6 | | - es.BlockView.call( this, 'paragraph' ); |
7 | | - this.model = model; |
| 6 | + es.BlockView.call( this, model, 'paragraph' ); |
| 7 | + this.contentView = new es.ContentView( this.$, this.model.content ); |
8 | 8 | }; |
9 | 9 | |
| 10 | +/** |
| 11 | + * Render content. |
| 12 | + */ |
| 13 | +es.ParagraphBlockView.prototype.renderContent = function() { |
| 14 | + this.contentView.render(); |
| 15 | +}; |
| 16 | + |
| 17 | +/** |
| 18 | + * Gets offset within content of position. |
| 19 | + */ |
| 20 | +es.ParagraphBlockView.getContentOffset = function( position ) { |
| 21 | + return this.contentView.getOffset( position ); |
| 22 | +}; |
| 23 | + |
| 24 | +/** |
| 25 | + * Gets rendered position of offset within content. |
| 26 | + */ |
| 27 | +es.ParagraphBlockView.getRenderedPosition = function( offset ) { |
| 28 | + return this.contentView.getPosition( position ); |
| 29 | +}; |
| 30 | + |
| 31 | +/** |
| 32 | + * Gets rendered line index of offset within content. |
| 33 | + */ |
| 34 | +es.ParagraphBlockView.getRenderedLineIndex = function( offset ) { |
| 35 | + return this.contentView.getLineIndex( position ); |
| 36 | +}; |
| 37 | + |
10 | 38 | es.extend( es.ParagraphBlockView, es.BlockView ); |
Index: trunk/parsers/wikidom/demos/synth/es.js |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +$(document).ready( function() { |
| 3 | + var doc = es.DocumentModel.newFromPlainObject( { 'blocks': [ |
| 4 | + { |
| 5 | + 'type': 'paragraph', |
| 6 | + 'content': { |
| 7 | + 'text': 'In text display, line wrap is the feature of continuing on a new line when a line is full, such that each line fits in the viewable window, allowing text to be read from top to bottom without any horizontal scrolling.\nWord wrap is the additional feature of most text editors, word processors, and web browsers, of breaking lines between and not within words, except when a single word is longer than a line.', |
| 8 | + 'annotations': [ |
| 9 | + // 'In text display' should be bold |
| 10 | + { 'type': 'bold', 'range': { 'start': 0, 'end': 15 } }, |
| 11 | + // 'line wrap' should be italic |
| 12 | + { 'type': 'italic', 'range': { 'start': 17, 'end': 26 } }, |
| 13 | + // 'wrap is' should be a link to '#' |
| 14 | + { |
| 15 | + 'type': 'xlink', |
| 16 | + 'data': { 'href': '#' }, |
| 17 | + 'range': { 'start': 22, 'end': 29 } |
| 18 | + }, |
| 19 | + ] |
| 20 | + } |
| 21 | + }, |
| 22 | + { |
| 23 | + 'type': 'paragraph', |
| 24 | + 'content': { |
| 25 | + 'text': 'It is usually done on the fly when viewing or printing a document, so no line break code is manually entered, or stored. If the user changes the margins, the editor will either automatically reposition the line breaks to ensure that all the text will "flow" within the margins and remain visible, or provide the typist some convenient way to reposition the line breaks.\nA soft return is the break resulting from line wrap or word wrap, whereas a hard return is an intentional break, creating a new paragraph.', |
| 26 | + 'annotations': [ |
| 27 | + // '[citation needed]' should be super |
| 28 | + { |
| 29 | + 'type': 'template', |
| 30 | + 'data': { |
| 31 | + 'html': '<sup><small><a href="#">[citation needed]</a></small></sup>' |
| 32 | + }, |
| 33 | + 'range': { 'start': 120, 'end': 121 } |
| 34 | + } |
| 35 | + ] |
| 36 | + } |
| 37 | + }, |
| 38 | + { |
| 39 | + 'type': 'paragraph', |
| 40 | + 'content': { 'text': 'The soft returns are usually placed after the ends of complete words, or after the punctuation that follows complete words. However, word wrap may also occur following a hyphen.\nWord wrap following hyphens is sometimes not desired, and can be avoided by using a so-called non-breaking hyphen instead of a regular hyphen. On the other hand, when using word processors, invisible hyphens, called soft hyphens, can also be inserted inside words so that word wrap can occur following the soft hyphens.\nSometimes, word wrap is not desirable between words. In such cases, word wrap can usually be avoided by using a hard space or non-breaking space between the words, instead of regular spaces.\nOccasionallyThereAreWordsThatAreSoLongTheyExceedTheWidthOfTheLineAndEndUpWrappingBetweenMultipleLines.\nText might have\ttabs\tin it too. Not all text will end in a line breaking character' } |
| 41 | + } |
| 42 | + ] } ); |
| 43 | + var surface = new es.SurfaceView( $('#es-editor'), doc ); |
| 44 | +} ); |
Property changes on: trunk/parsers/wikidom/demos/synth/es.js |
___________________________________________________________________ |
Added: svn:mime-type |
1 | 45 | + text/plain |
Added: svn:eol-style |
2 | 46 | + native |
Index: trunk/parsers/wikidom/demos/synth/images/link.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/link.png |
___________________________________________________________________ |
Added: svn:mime-type |
3 | 47 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/super.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/super.png |
___________________________________________________________________ |
Added: svn:mime-type |
4 | 48 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/big.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/big.png |
___________________________________________________________________ |
Added: svn:mime-type |
5 | 49 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/fade-down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/fade-down.png |
___________________________________________________________________ |
Added: svn:mime-type |
6 | 50 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/html.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/parsers/wikidom/demos/synth/images/html.png |
___________________________________________________________________ |
Added: svn:mime-type |
7 | 51 | + application/octet-stream |
Index: trunk/parsers/wikidom/demos/synth/images/italic.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/italic.png |
___________________________________________________________________ |
Added: svn:mime-type |
8 | 52 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/wikitext.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/wikitext.png |
___________________________________________________________________ |
Added: svn:mime-type |
9 | 53 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/small.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/small.png |
___________________________________________________________________ |
Added: svn:mime-type |
10 | 54 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/data.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/data.png |
___________________________________________________________________ |
Added: svn:mime-type |
11 | 55 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/json.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/json.png |
___________________________________________________________________ |
Added: svn:mime-type |
12 | 56 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/bullet-icon.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/parsers/wikidom/demos/synth/images/bullet-icon.png |
___________________________________________________________________ |
Added: svn:mime-type |
13 | 57 | + application/octet-stream |
Index: trunk/parsers/wikidom/demos/synth/images/render.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/parsers/wikidom/demos/synth/images/render.png |
___________________________________________________________________ |
Added: svn:mime-type |
14 | 58 | + application/octet-stream |
Index: trunk/parsers/wikidom/demos/synth/images/bold.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/bold.png |
___________________________________________________________________ |
Added: svn:mime-type |
15 | 59 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/fade-up.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/fade-up.png |
___________________________________________________________________ |
Added: svn:mime-type |
16 | 60 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/indent.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/indent.png |
___________________________________________________________________ |
Added: svn:mime-type |
17 | 61 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/outdent.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/outdent.png |
___________________________________________________________________ |
Added: svn:mime-type |
18 | 62 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/clear.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/clear.png |
___________________________________________________________________ |
Added: svn:mime-type |
19 | 63 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/bullet.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/bullet.png |
___________________________________________________________________ |
Added: svn:mime-type |
20 | 64 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/number.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/number.png |
___________________________________________________________________ |
Added: svn:mime-type |
21 | 65 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/images/sub.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/parsers/wikidom/demos/synth/images/sub.png |
___________________________________________________________________ |
Added: svn:mime-type |
22 | 66 | + image/png |
Index: trunk/parsers/wikidom/demos/synth/index.html |
— | — | @@ -0,0 +1,78 @@ |
| 2 | +<!doctype html> |
| 3 | + |
| 4 | +<html> |
| 5 | + <head> |
| 6 | + <title>EditSurface Demo</title> |
| 7 | + <link rel="stylesheet" href="../../lib/es/es.Surface.css"> |
| 8 | + <link rel="stylesheet" href="es.css"> |
| 9 | + </head> |
| 10 | + <body> |
| 11 | + <div id="es-base"> |
| 12 | + <div id="es-toolbar" class="es-toolbar"> |
| 13 | + <div class="es-toolbarGroup"> |
| 14 | + <div class="es-toolbarLabel">Text</div> |
| 15 | + <div class="es-toolbarTool" id="es-toolbar-bold"><img src="images/bold.png"></div> |
| 16 | + <div class="es-toolbarTool" id="es-toolbar-italic"><img src="images/italic.png"></div> |
| 17 | + <div class="es-toolbarTool" id="es-toolbar-link"><img src="images/link.png"></div> |
| 18 | + <div class="es-toolbarTool" id="es-toolbar-small"><img src="images/small.png"></div> |
| 19 | + <div class="es-toolbarTool" id="es-toolbar-big"><img src="images/big.png"></div> |
| 20 | + <div class="es-toolbarTool" id="es-toolbar-sub"><img src="images/sub.png"></div> |
| 21 | + <div class="es-toolbarTool" id="es-toolbar-super"><img src="images/super.png"></div> |
| 22 | + <div class="es-toolbarTool" id="es-toolbar-clear"><img src="images/clear.png"></div> |
| 23 | + <div style="clear:both"></div> |
| 24 | + </div> |
| 25 | + <div class="es-toolbarDivider"></div> |
| 26 | + <div class="es-toolbarGroup"> |
| 27 | + <div class="es-toolbarLabel">Lists</div> |
| 28 | + <div class="es-toolbarTool" id="es-toolbar-bullet"><img src="images/bullet.png"></div> |
| 29 | + <div class="es-toolbarTool" id="es-toolbar-number"><img src="images/number.png"></div> |
| 30 | + <div class="es-toolbarTool" id="es-toolbar-indent"><img src="images/indent.png"></div> |
| 31 | + <div class="es-toolbarTool" id="es-toolbar-outdent"><img src="images/outdent.png"></div> |
| 32 | + <div style="clear:both"></div> |
| 33 | + </div> |
| 34 | + <div class="es-toolbarGroup es-toolbarGroup-preview"> |
| 35 | + <div class="es-toolbarTool" id="es-toolbar-json" rel="json"><img src="images/json.png"></div> |
| 36 | + <div class="es-toolbarTool" id="es-toolbar-wikitext" rel="wikitext"><img src="images/wikitext.png"></div> |
| 37 | + <div class="es-toolbarTool" id="es-toolbar-html" rel="html"><img src="images/html.png"></div> |
| 38 | + <div class="es-toolbarTool" id="es-toolbar-render" rel="render"><img src="images/render.png"></div> |
| 39 | + </div> |
| 40 | + <div style="clear:both"></div> |
| 41 | + </div> |
| 42 | + <div id="es-panes"> |
| 43 | + <div id="es-visual"> |
| 44 | + <div id="es-editor"></div> |
| 45 | + </div> |
| 46 | + <div id="es-previews"> |
| 47 | + <div id="es-preview-wikitext" class="es-preview es-code"></div> |
| 48 | + <div id="es-preview-json" class="es-preview es-code"></div> |
| 49 | + <div id="es-preview-html" class="es-preview es-code"></div> |
| 50 | + <div id="es-preview-render" class="es-preview es-render"></div> |
| 51 | + </div> |
| 52 | + <div style="clear:both"></div> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + |
| 56 | + <!-- EditSurface --> |
| 57 | + <script src="../../lib/jquery.js"></script> |
| 58 | + <script src="../../lib/synth/es.js"></script> |
| 59 | + <script src="../../lib/synth/es.Range.js"></script> |
| 60 | + <script src="../../lib/synth/bases/es.EventEmitter.js"></script> |
| 61 | + <script src="../../lib/synth/bases/es.AggregateArray.js"></script> |
| 62 | + <script src="../../lib/synth/bases/es.ModelContainer.js"></script> |
| 63 | + <script src="../../lib/synth/bases/es.ModelContainerItem.js"></script> |
| 64 | + <script src="../../lib/synth/bases/es.ViewContainer.js"></script> |
| 65 | + <script src="../../lib/synth/bases/es.ViewContainerItem.js"></script> |
| 66 | + <script src="../../lib/synth/models/es.DocumentModel.js"></script> |
| 67 | + <script src="../../lib/synth/models/es.BlockModel.js"></script> |
| 68 | + <script src="../../lib/synth/models/es.ContentModel.js"></script> |
| 69 | + <script src="../../lib/synth/models/es.ParagraphBlockModel.js"></script> |
| 70 | + <script src="../../lib/synth/views/es.BlockView.js"></script> |
| 71 | + <script src="../../lib/synth/views/es.ContentView.js"></script> |
| 72 | + <script src="../../lib/synth/views/es.DocumentView.js"></script> |
| 73 | + <script src="../../lib/synth/views/es.ParagraphBlockView.js"></script> |
| 74 | + <script src="../../lib/synth/views/es.SurfaceView.js"></script> |
| 75 | + |
| 76 | + <!-- Demo --> |
| 77 | + <script src="es.js"></script> |
| 78 | + </body> |
| 79 | +</html> |
Property changes on: trunk/parsers/wikidom/demos/synth/index.html |
___________________________________________________________________ |
Added: svn:mime-type |
1 | 80 | + text/plain |
Added: svn:eol-style |
2 | 81 | + native |
Index: trunk/parsers/wikidom/demos/synth/es.css |
— | — | @@ -0,0 +1,132 @@ |
| 2 | +body { |
| 3 | + font-family: "Arial"; |
| 4 | + font-size: 1em; |
| 5 | + width: 100%; |
| 6 | + margin: 1em 0; |
| 7 | + padding: 0; |
| 8 | + overflow-y: scroll; |
| 9 | + -webkit-user-select: none; |
| 10 | + background-color: white; |
| 11 | +} |
| 12 | +#es-base { |
| 13 | + margin: 2em; |
| 14 | + -webkit-box-shadow: 0 0.25em 1.5em 0 #dddddd; |
| 15 | + -moz-box-shadow: 0 0.25em 1.5em 0 #dddddd; |
| 16 | + box-shadow: 0 0.25em 1.5em 0 #dddddd; |
| 17 | + -webkit-border-radius: 0.5em; |
| 18 | + -moz-border-radius: 0.5em; |
| 19 | + -o-border-radius: 0.5em; |
| 20 | + border-radius: 0.5em; |
| 21 | +} |
| 22 | +#es-toolbar, |
| 23 | +#es-panes { |
| 24 | + border: solid 1px #dddddd; |
| 25 | +} |
| 26 | +#es-toolbar { |
| 27 | + border-bottom: none; |
| 28 | + -webkit-border-top-right-radius: 0.25em; |
| 29 | + -moz-border-top-right-radius: 0.25em; |
| 30 | + -o-border-top-right-radius: 0.25em; |
| 31 | + border-top-right-radius: 0.25em; |
| 32 | + -webkit-border-top-left-radius: 0.25em; |
| 33 | + -moz-border-top-left-radius: 0.25em; |
| 34 | + -o-border-top-left-radius: 0.25em; |
| 35 | + border-top-left-radius: 0.25em; |
| 36 | + background-image: url(images/fade-up.png); |
| 37 | + background-position: bottom left; |
| 38 | + background-repeat: repeat-x; |
| 39 | +} |
| 40 | +.es-showData #es-visual, |
| 41 | +.es-showData #es-previews { |
| 42 | + width: 50%; |
| 43 | + float: left; |
| 44 | + overflow: hidden; |
| 45 | +} |
| 46 | +.es-showData #es-editor { |
| 47 | + border-right: solid 1px #dddddd; |
| 48 | +} |
| 49 | +.es-toolbarGroup { |
| 50 | + float: left; |
| 51 | + padding: 0.25em; |
| 52 | +} |
| 53 | +.es-toolbarGroup-preview { |
| 54 | + float: right; |
| 55 | +} |
| 56 | +.es-toolbarDivider { |
| 57 | + float: left; |
| 58 | + width: 1px; |
| 59 | + height: 24px; |
| 60 | + margin: 0.5em 0 0.5em 0.5em; |
| 61 | + background-color: #dddddd; |
| 62 | +} |
| 63 | +.es-toolbarLabel { |
| 64 | + float: left; |
| 65 | + padding: 0.5em 0.75em; |
| 66 | + line-height: 22px; |
| 67 | + font-size: 0.8em; |
| 68 | + color: #555555; |
| 69 | +} |
| 70 | +.es-toolbarTool { |
| 71 | + float: left; |
| 72 | + padding: 0.25em; |
| 73 | + border: solid 1px transparent; |
| 74 | + border-radius: 0.125em; |
| 75 | + -webkit-border-radius: 0.125em; |
| 76 | + -moz-border-radius: 0.125em; |
| 77 | + -o-border-radius: 0.125em; |
| 78 | + cursor: pointer; |
| 79 | +} |
| 80 | +.es-toolbarTool:hover, |
| 81 | +.es-toolbarTool-down:hover { |
| 82 | + border-color: #eeeeee; |
| 83 | +} |
| 84 | +.es-toolbarTool:active, |
| 85 | +.es-toolbarTool-down { |
| 86 | + border-color: #dddddd; |
| 87 | + background-image: url(images/fade-down.png); |
| 88 | + background-position: top left; |
| 89 | + background-repeat: repeat-x; |
| 90 | +} |
| 91 | +.es-toolbarTool img { |
| 92 | + display: block; |
| 93 | + width: 22px; |
| 94 | + height: 22px; |
| 95 | +} |
| 96 | +#es-previews { |
| 97 | + display: none; |
| 98 | +} |
| 99 | +.es-showData #es-previews { |
| 100 | + display: block; |
| 101 | +} |
| 102 | +.es-preview { |
| 103 | + margin: 0; |
| 104 | + padding: 1em; |
| 105 | +} |
| 106 | +.es-code { |
| 107 | + white-space: pre-wrap; |
| 108 | + font-family: "Droid Sans Mono", "Courier New", monospace; |
| 109 | + font-size: 0.8em; |
| 110 | +} |
| 111 | +.es-render { |
| 112 | + line-height: 1.5em; |
| 113 | + padding-top: 0; |
| 114 | +} |
| 115 | + |
| 116 | +/* General MediaWiki Styles */ |
| 117 | + |
| 118 | +.es-render ul { |
| 119 | + line-height: 1.5em; |
| 120 | + list-style-type: square; |
| 121 | + margin: .3em 0 0 1.5em; |
| 122 | + padding: 0; |
| 123 | + list-style-image: url(images/bullet-icon.png); |
| 124 | +} |
| 125 | +.es-render ol { |
| 126 | + line-height: 1.5em; |
| 127 | + margin: .3em 0 0 3.2em; |
| 128 | + padding: 0; |
| 129 | + list-style-image: none; |
| 130 | +} |
| 131 | +.es-render li { |
| 132 | + margin-bottom: .1em; |
| 133 | +} |
Property changes on: trunk/parsers/wikidom/demos/synth/es.css |
___________________________________________________________________ |
Added: svn:mime-type |
1 | 134 | + text/plain |
Added: svn:eol-style |
2 | 135 | + native |