r96584 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96583‎ | r96584 | r96585 >
Date:16:45, 8 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Got synth (the great refactoring of 2011) working!
Modified paths:
  • /trunk/parsers/wikidom/demos/synth (added) (history)
  • /trunk/parsers/wikidom/demos/synth/es.js (modified) (history)
  • /trunk/parsers/wikidom/demos/synth/index.html (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js (modified) (history)
  • /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.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/views/es.BlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js (added) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js
@@ -9,9 +9,8 @@
1010 * @property attributes {Object}
1111 */
1212 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 || [] );
1615 this.attributes = attributes || {};
1716 };
1817
@@ -61,5 +60,4 @@
6261 return this.blocks.getContentLength();
6362 };
6463
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 @@
2222 * @param obj {Object}
2323 */
2424 es.ParagraphBlockModel.newFromPlainObject = function( obj ) {
25 - return new es.ParagraphBlockModel( es.ContentModel.newFromPlainObject( obj ) );
 25+ return new es.ParagraphBlockModel( es.ContentModel.newFromPlainObject( obj.content ) );
2626 };
2727
2828 /* Methods */
@@ -54,7 +54,7 @@
5555 };
5656
5757 // Register constructor
58 -es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel;
 58+es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel.newFromPlainObject;
5959
6060 /* Inheritance */
6161
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
@@ -3,13 +3,13 @@
44 *
55 * @class
66 * @constructor
7 - * @param doc {es.DocumentModel}
 7+ * @param documentModel {es.DocumentModel}
88 * @param attributes {Object}
9 - * @property document {es.DocumentModel}
 9+ * @property documentModel {es.DocumentModel}
1010 * @property attributes {Object}
1111 */
12 -es.TableBlockCellModel = function( doc, attributes ) {
13 - this.document = doc || null;
 12+es.TableBlockCellModel = function( documentModel, attributes ) {
 13+ this.documentModel = documentModel || null;
1414 this.attributes = attributes || {};
1515 };
1616
@@ -49,8 +49,8 @@
5050 */
5151 es.TableBlockRowModel.prototype.getPlainObject = function() {
5252 var obj = {};
53 - if ( this.document ) {
54 - obj.document = this.document;
 53+ if ( this.documentModel ) {
 54+ obj.document = this.documentModel;
5555 }
5656 if ( !$.isEmptyObject( this.attributes ) ) {
5757 obj.attributes = $.extend( true, {}, this.attributes );
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js
@@ -34,7 +34,7 @@
3535 styles.push( obj.style || 'bullet' );
3636 var items = [];
3737 if ( $.isArray( obj.items ) ) {
38 - $.each( obj.items, function( item ) {
 38+ $.each( obj.items, function( i, item ) {
3939 if ( $.isPlainObject( item.content ) ) {
4040 items.push(
4141 new es.ListBlockItemModel(
@@ -44,7 +44,7 @@
4545 );
4646 }
4747 if ( $.isArray( item.lists ) ) {
48 - $.each( item.lists, function( list ) {
 48+ $.each( item.lists, function( i, list ) {
4949 items = items.concat( es.ListBlockList.flattenList( list, styles ) );
5050 } );
5151 }
Index: trunk/parsers/wikidom/lib/synth/models/es.BlockModel.js
@@ -10,7 +10,7 @@
1111 */
1212 es.BlockModel = function( traits ) {
1313 es.EventEmitter.call( this );
14 - es.ContainerItem.call( this, 'document' );
 14+ es.ModelContainerItem.call( this, 'document' );
1515 this.traits = traits || [];
1616 };
1717
@@ -37,7 +37,7 @@
3838 */
3939 es.BlockModel.newFromPlainObject = function( obj ) {
4040 if ( obj.type in es.BlockModel.constructors ) {
41 - return new es.BlockModel.constructors[obj.type]( obj );
 41+ return es.BlockModel.constructors[obj.type]( obj );
4242 }
4343 return null;
4444 };
@@ -174,4 +174,4 @@
175175 };
176176
177177 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 @@
2525 * @param text {String} Text to convert
2626 * @returns {es.ContentModel} Content object containing converted text
2727 */
28 -es.Content.newFromText = function( text ) {
 28+es.ContentModel.newFromText = function( text ) {
2929 return new es.ContentModel( text.split('') );
3030 };
3131
@@ -73,7 +73,7 @@
7474 attributes = !$.isPlainObject( obj.attributes ) ? {} : $.extend( true, {}, obj.attributes );
7575 // Render annotations
7676 if ( $.isArray( obj.annotations ) ) {
77 - $.each( obj.annotations, function( src ) {
 77+ $.each( obj.annotations, function( i, src ) {
7878 // Build simplified annotation object
7979 var dst = { 'type': src.type };
8080 if ( 'data' in src ) {
@@ -108,7 +108,7 @@
109109 * @method
110110 * @returns {Integer} Length of content data
111111 */
112 -es.Content.prototype.getLength = function() {
 112+es.ContentModel.prototype.getLength = function() {
113113 return this.data.length;
114114 };
115115
@@ -119,7 +119,7 @@
120120 * @param name {String} Name of attribute to get value for
121121 * @returns {Mixed} Value of attribute, or undefined if attribute does not exist
122122 */
123 -es.Content.prototype.getAttribute = function( name ) {
 123+es.ContentModel.prototype.getAttribute = function( name ) {
124124 return this.attributes[name];
125125 };
126126
@@ -130,7 +130,7 @@
131131 * @param name {String} Name of attribute to set value for
132132 * @param value {Mixed} Value to set attribute to
133133 */
134 -es.Content.prototype.setAttribute = function( name, value ) {
 134+es.ContentModel.prototype.setAttribute = function( name, value ) {
135135 this.attributes[name] = value;
136136 };
137137
@@ -150,7 +150,7 @@
151151 * @param render {Boolean} If annotations should have any influence on output
152152 * @returns {String} Text within given range
153153 */
154 -es.Content.prototype.getText = function( range, render ) {
 154+es.ContentModel.prototype.getText = function( range, render ) {
155155 if ( !range ) {
156156 range = new es.Range( 0, this.data.length );
157157 } else {
@@ -175,7 +175,7 @@
176176 * @param range {es.Range} Range of content to get
177177 * @returns {es.ContentModel} Content object containing data within range
178178 */
179 -es.Content.prototype.getContent = function( range ) {
 179+es.ContentModel.prototype.getContent = function( range ) {
180180 if ( !range ) {
181181 range = new es.Range( 0, this.data.length );
182182 }
@@ -190,7 +190,7 @@
191191 * @param range {es.Range} Range of data to get
192192 * @returns {Array} Array of plain text and/or annotated characters within range
193193 */
194 -es.Content.prototype.getData = function( range ) {
 194+es.ContentModel.prototype.getData = function( range ) {
195195 if ( !range ) {
196196 range = new es.Range( 0, this.data.length );
197197 }
@@ -205,7 +205,7 @@
206206 * @param range {es.Range} Range of content to check
207207 * @returns {Boolean} If there's any floating objects in range
208208 */
209 -es.Content.prototype.hasFloatingObjects = function( range ) {
 209+es.ContentModel.prototype.hasFloatingObjects = function( range ) {
210210 if ( !range ) {
211211 range = new es.Range( 0, this.data.length );
212212 }
@@ -213,7 +213,7 @@
214214 for ( var i = 0; i < this.data.length; i++ ) {
215215 if ( this.data[i].length > 1 ) {
216216 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;
218218 if ( isFloating && typeof isFloating === 'function' ) {
219219 isFloating = isFloating( this.data[i][j].data );
220220 }
@@ -233,7 +233,7 @@
234234 * @param offset {Integer} Offset to find word nearest to
235235 * @returns {Object} Range object of boundaries
236236 */
237 -es.Content.prototype.getWordBoundaries = function( offset ) {
 237+es.ContentModel.prototype.getWordBoundaries = function( offset ) {
238238 if ( offset < 0 || offset > this.data.length ) {
239239 throw 'Out of bounds error. Offset expected to be >= 0 and <= to ' + this.data.length;
240240 }
@@ -264,7 +264,7 @@
265265 * @method
266266 * @returns {Object}
267267 */
268 -es.Content.prototype.getPlainObject = function() {
 268+es.ContentModel.prototype.getPlainObject = function() {
269269 var stack = [];
270270 // Text and annotations
271271 function start( offset, annotation ) {
@@ -350,7 +350,7 @@
351351 * @param strict {Boolean} Optionally compare annotation data as well as type
352352 * @returns {Array} List of indexes of covered characters within content data
353353 */
354 -es.Content.prototype.coverageOfAnnotation = function( range, annotation, strict ) {
 354+es.ContentModel.prototype.coverageOfAnnotation = function( range, annotation, strict ) {
355355 var coverage = [];
356356 var i, index;
357357 for ( i = range.start; i < range.end; i++ ) {
@@ -383,7 +383,7 @@
384384 * @param strict {Boolean} Optionally compare annotation data as well as type
385385 * @returns {Integer} Index of first instance of annotation in content
386386 */
387 -es.Content.prototype.indexOfAnnotation = function( offset, annotation, strict ) {
 387+es.ContentModel.prototype.indexOfAnnotation = function( offset, annotation, strict ) {
388388 var annotatedChar = this.data[offset];
389389 var i;
390390 if ( typeof annotatedChar !== 'string' ) {
@@ -413,7 +413,7 @@
414414 * @emits "insert" with offset and content data properties
415415 * @emits "change" with type:"insert" data property
416416 */
417 -es.Content.prototype.insert = function( offset, content, autoAnnotate ) {
 417+es.ContentModel.prototype.insert = function( offset, content, autoAnnotate ) {
418418 if ( autoAnnotate ) {
419419 // TODO: Prefer to not take annotations from a neighbor that's a space character
420420 var neighbor = this.data[Math.max( offset - 1, 0 )];
@@ -444,7 +444,7 @@
445445 * @emits "remove" with range data property
446446 * @emits "change" with type:"remove" data property
447447 */
448 -es.Content.prototype.remove = function( range ) {
 448+es.ContentModel.prototype.remove = function( range ) {
449449 range.normalize();
450450 this.data.splice( range.start, range.getLength() );
451451 this.emit( 'remove', {
@@ -460,7 +460,7 @@
461461 * @emits "clear"
462462 * @emits "change" with type:"clear" data property
463463 */
464 -es.Content.prototype.clear = function() {
 464+es.ContentModel.prototype.clear = function() {
465465 this.data = [];
466466 this.emit( 'clear' );
467467 this.emit( 'change', { 'type': 'clear' } );
@@ -482,7 +482,7 @@
483483 * @emits "annotate" with method, annotation and range data properties
484484 * @emits "change" with type:"annotate" data property
485485 */
486 -es.Content.prototype.annotate = function( method, annotation, range ) {
 486+es.ContentModel.prototype.annotate = function( method, annotation, range ) {
487487 // Support calling without a range argument, using the full content range as default
488488 if ( !range ) {
489489 range = new es.Range( 0, this.data.length );
Index: trunk/parsers/wikidom/lib/synth/bases/es.ViewContainer.js
@@ -16,6 +16,9 @@
1717 es.ViewContainer = function( containerModel, typeName, tagName ) {
1818 es.EventEmitter.call( this );
1919 this.containerModel = containerModel;
 20+ if ( !this.containerModel ) {
 21+ return;
 22+ }
2023 this.views = [];
2124 if ( typeof typeName !== 'string' ) {
2225 typeName = 'viewContainer';
@@ -86,7 +89,9 @@
8790 // Auto-add views for existing items
8891 var itemModels = this.containerModel.all();
8992 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.$ );
9196 }
9297 };
9398
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 @@
99 * @param typeName {String} Name of block type (optional, default: "block")
1010 * @param tagName {String} HTML tag name to use in rendering (optional, default: "div")
1111 */
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' );
1415 };
1516
1617 /**
Index: trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js
@@ -1,7 +1,16 @@
22 es.DocumentView = function( documentModel ) {
3 - es.ViewContainer.call( this, documentModel, 'blocks' );
 3+ es.ViewContainer.call( this, documentModel, 'document' );
44 };
55
 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+
615 /* Inheritance */
716
817 es.extend( es.DocumentView, es.ViewContainer );
Index: trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js
@@ -1,9 +1,37 @@
22 /**
3 - *
 3+ * Creates an es.ParagraphBlockView object.
44 */
55 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 );
88 };
99
 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+
1038 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
145 + text/plain
Added: svn:eol-style
246 + 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
347 + 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
448 + 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
549 + 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
650 + 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
751 + 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
852 + 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
953 + 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
1054 + 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
1155 + 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
1256 + 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
1357 + 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
1458 + 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
1559 + 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
1660 + 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
1761 + 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
1862 + 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
1963 + 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
2064 + 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
2165 + 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
2266 + 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
180 + text/plain
Added: svn:eol-style
281 + 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
1134 + text/plain
Added: svn:eol-style
2135 + native

Status & tagging log