r97187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97186‎ | r97187 | r97188 >
Date:18:26, 15 September 2011
Author:tparscal
Status:deferred
Tags:
Comment:
* Started with serialization migration, directly into models
* Fixed CSS for list highlighting
* Migrated stylesheet from es
* Added some comments
Modified paths:
  • /trunk/parsers/wikidom/demos/synth/es.js (modified) (history)
  • /trunk/parsers/wikidom/demos/synth/index.html (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/es.AnnotationSerializer.js (added) (history)
  • /trunk/parsers/wikidom/lib/synth/es.JsonSerializer.js (added) (history)
  • /trunk/parsers/wikidom/lib/synth/es.Surface.css (added) (history)
  • /trunk/parsers/wikidom/lib/synth/images (added) (history)
  • /trunk/parsers/wikidom/lib/synth/images/bullet.png (added) (history)
  • /trunk/parsers/wikidom/lib/synth/models/es.CommentBlockModel.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.HorizontalRuleBlockModel.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)
  • /trunk/parsers/wikidom/lib/synth/views/es.BlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ContentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/models/es.CommentBlockModel.js
@@ -44,6 +44,16 @@
4545 };
4646
4747 /**
 48+ * Gets text content.
 49+ *
 50+ * @method
 51+ * @returns {String} Plain text content
 52+ */
 53+es.CommentBlockModel.prototype.getText = function() {
 54+ return this.text;
 55+};
 56+
 57+/**
4858 * Gets a plain comment block object.
4959 *
5060 * @method
@@ -53,6 +63,24 @@
5464 return { 'type': 'comment', 'text': this.text };
5565 };
5666
 67+/**
 68+ * Gets HTML serialization of block.
 69+ *
 70+ * @method
 71+ * @returns {String} HTML data
 72+ */
 73+es.CommentBlockModel.prototype.getHtml = function() {
 74+ return '<!--' + comment.text + '-->';
 75+};
 76+
 77+/**
 78+ * Gets Wikitext serialization of block.
 79+ *
 80+ * @method
 81+ * @returns {String} Wikitext data
 82+ */
 83+es.CommentBlockModel.prototype.getWikitext = es.CommentBlockModel.prototype.getHtml;
 84+
5785 // Register constructor
5886 es.BlockModel.constructors['comment'] = es.CommentBlockModel;
5987
Index: trunk/parsers/wikidom/lib/synth/models/es.DocumentModel.js
@@ -51,6 +51,30 @@
5252 };
5353
5454 /**
 55+ * Gets HTML serialization of document.
 56+ *
 57+ * @method
 58+ * @returns {String} HTML data
 59+ */
 60+es.DocumentModel.prototype.getHtml = function() {
 61+ return $.map( this.blocks, function( i, block ) {
 62+ return block.getHtml( { 'index': i } );
 63+ } ).join( '\n' );
 64+};
 65+
 66+/**
 67+ * Gets Wikitext serialization of document.
 68+ *
 69+ * @method
 70+ * @returns {String} Wikitext data
 71+ */
 72+es.DocumentModel.prototype.getWikitext = function() {
 73+ return $.map( this.blocks, function( i, block ) {
 74+ return block.getWikitext( { 'index': i } );
 75+ } ).join( '\n' );
 76+};
 77+
 78+/**
5579 * Gets the size of the of the contents of all blocks.
5680 *
5781 * @method
Index: trunk/parsers/wikidom/lib/synth/models/es.ParagraphBlockModel.js
@@ -15,6 +15,19 @@
1616 } );
1717 };
1818
 19+/* Static Members */
 20+
 21+/**
 22+ * Registry of serializers, mapping symbolic format type names to serialization functions.
 23+ *
 24+ * Functions added to this object should accept block and options arguments.
 25+ *
 26+ * @member
 27+ * @static
 28+ * @type {Object}
 29+ */
 30+es.ParagraphBlockModel.serializers = {};
 31+
1932 /* Static Methods */
2033
2134 /**
@@ -57,6 +70,30 @@
5871 return { 'type': 'paragraph', 'content': this.content.getPlainObject() };
5972 };
6073
 74+/**
 75+ * Gets HTML serialization of block.
 76+ *
 77+ * @method
 78+ * @returns {String} HTML data
 79+ */
 80+es.ParagraphBlockModel.prototype.getHtml = function( index ) {
 81+ var html = this.content.getWikitext();;
 82+ if ( index === 0 ) {
 83+ html = es.AnnotationSerializer.buildXmlTag( 'p', {}, html );
 84+ }
 85+ return html;
 86+};
 87+
 88+/**
 89+ * Gets Wikitext serialization of block.
 90+ *
 91+ * @method
 92+ * @returns {String} Wikitext data
 93+ */
 94+es.ParagraphBlockModel.prototype.getWikitext = function() {
 95+ return this.content.getWikitext();
 96+};
 97+
6198 // Register constructor
6299 es.BlockModel.constructors['paragraph'] = es.ParagraphBlockModel.newFromPlainObject;
63100
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockCellModel.js
@@ -68,6 +68,26 @@
6969 */
7070 };
7171
 72+/**
 73+ * Gets HTML serialization of cell.
 74+ *
 75+ * @method
 76+ * @returns {String} HTML data
 77+ */
 78+es.TableBlockCellModel.prototype.getHtml = function() {
 79+
 80+};
 81+
 82+/**
 83+ * Gets Wikitext serialization of cell.
 84+ *
 85+ * @method
 86+ * @returns {String} Wikitext data
 87+ */
 88+es.TableBlockCellModel.prototype.getWikitext = function() {
 89+
 90+};
 91+
7292 /* Inheritance */
7393
7494 es.extend( es.TableBlockCellModel, es.ModelContainerItem );
\ No newline at end of file
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockModel.js
@@ -81,6 +81,26 @@
8282 */
8383 };
8484
 85+/**
 86+ * Gets HTML serialization of block.
 87+ *
 88+ * @method
 89+ * @returns {String} HTML data
 90+ */
 91+es.TableBlockModel.prototype.getHtml = function() {
 92+
 93+};
 94+
 95+/**
 96+ * Gets Wikitext serialization of block.
 97+ *
 98+ * @method
 99+ * @returns {String} Wikitext data
 100+ */
 101+es.TableBlockModel.prototype.getWikitext = function() {
 102+
 103+};
 104+
85105 // Register constructor
86106 es.BlockModel.constructors['table'] = es.TableBlockModel.newFromPlainObject;
87107
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockItemModel.js
@@ -55,6 +55,26 @@
5656 return { 'content': this.content.getPlainObject(), 'styles': this.styles.slice( 0 ) };
5757 };
5858
 59+/**
 60+ * Gets HTML serialization of item.
 61+ *
 62+ * @method
 63+ * @returns {String} HTML data
 64+ */
 65+es.ListBlockItemModel.prototype.getHtml = function() {
 66+
 67+};
 68+
 69+/**
 70+ * Gets Wikitext serialization of item.
 71+ *
 72+ * @method
 73+ * @returns {String} Wikitext data
 74+ */
 75+es.ListBlockItemModel.prototype.getWikitext = function() {
 76+
 77+};
 78+
5979 /* Inheritance */
6080
6181 es.extend( es.ListBlockItemModel, es.ModelContainerItem );
\ No newline at end of file
Index: trunk/parsers/wikidom/lib/synth/models/es.ListBlockModel.js
@@ -110,6 +110,26 @@
111111 return obj;
112112 };
113113
 114+/**
 115+ * Gets HTML serialization of block.
 116+ *
 117+ * @method
 118+ * @returns {String} HTML data
 119+ */
 120+es.ListBlockModel.prototype.getHtml = function() {
 121+
 122+};
 123+
 124+/**
 125+ * Gets Wikitext serialization of block.
 126+ *
 127+ * @method
 128+ * @returns {String} Wikitext data
 129+ */
 130+es.ListBlockModel.prototype.getWikitext = function() {
 131+
 132+};
 133+
114134 // Register constructor
115135 es.BlockModel.constructors['list'] = es.ListBlockModel.newFromPlainObject
116136
Index: trunk/parsers/wikidom/lib/synth/models/es.ContentModel.js
@@ -335,6 +335,26 @@
336336 };
337337
338338 /**
 339+ * Gets HTML serialization of content.
 340+ *
 341+ * @method
 342+ * @returns {String} HTML data
 343+ */
 344+es.ContentModel.prototype.getHtml = function() {
 345+ //
 346+};
 347+
 348+/**
 349+ * Gets Wikitext serialization of content.
 350+ *
 351+ * @method
 352+ * @returns {String} Wikitext data
 353+ */
 354+es.ContentModel.prototype.getWikitext = function() {
 355+
 356+};
 357+
 358+/**
339359 * Gets a list of indexes of annotated characters which have a given annotation applied to them.
340360 *
341361 * Comparison is done first by type, and optionally also by data values (strict), not by reference
Index: trunk/parsers/wikidom/lib/synth/models/es.HeadingBlockModel.js
@@ -56,6 +56,27 @@
5757 return { 'type': 'heading', 'content': this.content.getPlainObject(), 'level': this.level };
5858 };
5959
 60+/**
 61+ * Gets HTML serialization of block.
 62+ *
 63+ * @method
 64+ * @returns {String} HTML data
 65+ */
 66+es.HeadingBlockModel.prototype.getHtml = function() {
 67+ return es.AnnotationSerializer.buildXmlTag( 'h' + this.level, {}, this.content.getHtml() );
 68+};
 69+
 70+/**
 71+ * Gets Wikitext serialization of block.
 72+ *
 73+ * @method
 74+ * @returns {String} Wikitext data
 75+ */
 76+es.HeadingBlockModel.prototype.getWikitext = function() {
 77+ var symbols = es.AnnotationSerializer.repeatString( '=', this.level );
 78+ return symbols + this.content.getHtml() + symbols;
 79+};
 80+
6081 // Register constructor
6182 es.BlockModel.constructors['heading'] = es.HeadingBlockModel;
6283
Index: trunk/parsers/wikidom/lib/synth/models/es.TableBlockRowModel.js
@@ -80,6 +80,26 @@
8181 */
8282 };
8383
 84+/**
 85+ * Gets HTML serialization of row.
 86+ *
 87+ * @method
 88+ * @returns {String} HTML data
 89+ */
 90+es.TableBlockRowModel.prototype.getHtml = function() {
 91+
 92+};
 93+
 94+/**
 95+ * Gets Wikitext serialization of row.
 96+ *
 97+ * @method
 98+ * @returns {String} Wikitext data
 99+ */
 100+es.TableBlockRowModel.prototype.getWikitext = function() {
 101+
 102+};
 103+
84104 /* Inheritance */
85105
86106 es.extend( es.TableBlockRowModel, es.ModelContainerItem );
Index: trunk/parsers/wikidom/lib/synth/models/es.HorizontalRuleBlockModel.js
@@ -50,6 +50,26 @@
5151 return { 'type': 'horizontal-rule' };
5252 };
5353
 54+/**
 55+ * Gets HTML serialization of block.
 56+ *
 57+ * @method
 58+ * @returns {String} HTML data
 59+ */
 60+es.CommentBlockModel.prototype.getHtml = function() {
 61+ return es.AnnotationSerializer.buildXmlTag( 'hr', {}, false );
 62+};
 63+
 64+/**
 65+ * Gets Wikitext serialization of block.
 66+ *
 67+ * @method
 68+ * @returns {String} Wikitext data
 69+ */
 70+es.CommentBlockModel.prototype.getWikitext = function() {
 71+ return '----';
 72+};
 73+
5474 // Register constructor
5575 es.BlockModel.constructors['horizontal-rule'] = es.HorizontalRuleBlockModel;
5676
Index: trunk/parsers/wikidom/lib/synth/es.JsonSerializer.js
@@ -0,0 +1,100 @@
 2+/**
 3+ * Serializes a WikiDom into JSON.
 4+ *
 5+ * @class
 6+ * @constructor
 7+ * @extends {es.Serializer}
 8+ * @property options {Object} List of options for serialization
 9+ * @property options.indentWith {String} Text to use as indentation, such as \t or 4 spaces
 10+ */
 11+es.JsonSerializer = function( options ) {
 12+ es.Serializer.call( this );
 13+ this.options = $.extend( {
 14+ 'indentWith': '\t'
 15+ }, options || {} );
 16+};
 17+
 18+/* Static Methods */
 19+
 20+es.JsonSerializer.typeOf = function( value ) {
 21+ if ( typeof value === 'object' ) {
 22+ if ( value === null ) {
 23+ return 'null';
 24+ }
 25+ switch ( value.constructor ) {
 26+ case ( new Array ).constructor:
 27+ return 'array';
 28+ case ( new Date ).constructor:
 29+ return 'date';
 30+ case ( new RegExp ).constructor:
 31+ return 'regex';
 32+ default:
 33+ return 'object';
 34+ }
 35+ }
 36+ return typeof value;
 37+};
 38+
 39+es.JsonSerializer.prototype.encode = function( data, indention ) {
 40+ if ( indention === undefined ) {
 41+ indention = '';
 42+ }
 43+ var type = es.JsonSerializer.typeOf( data );
 44+
 45+ // Open object/array
 46+ var json = '';
 47+ if ( type === 'array' ) {
 48+ if (data.length === 0) {
 49+ // Empty array
 50+ return '[]';
 51+ }
 52+ json += '[';
 53+ } else {
 54+ var empty = true;
 55+ for ( var i in data ) {
 56+ if ( data.hasOwnProperty( i ) ) {
 57+ empty = false;
 58+ break;
 59+ }
 60+ }
 61+ if ( empty ) {
 62+ return '{}';
 63+ }
 64+ json += '{';
 65+ }
 66+
 67+ // Iterate over items
 68+ var comma = false;
 69+ for ( var i in data ) {
 70+ if ( data.hasOwnProperty( i ) ) {
 71+ json += ( comma ? ',' : '' ) + '\n' + indention + this.options.indentWith
 72+ + ( type === 'array' ? '' : '"' + i + '"' + ': ' );
 73+ switch ( es.JsonSerializer.typeOf( data[i] ) ) {
 74+ case 'array':
 75+ case 'object':
 76+ json += this.encode( data[i], indention + this.options.indentWith );
 77+ break;
 78+ case 'boolean':
 79+ case 'number':
 80+ json += data[i].toString();
 81+ break;
 82+ case 'null':
 83+ json += 'null';
 84+ break;
 85+ case 'string':
 86+ json += '"' + data[i]
 87+ .replace(/[\n]/g, '\\n')
 88+ .replace(/[\t]/g, '\\t')
 89+ + '"';
 90+ break;
 91+ // Skip other types
 92+ }
 93+ comma = true;
 94+ }
 95+ }
 96+
 97+ // Close object/array
 98+ json += '\n' + indention + ( type === 'array' ? ']' : '}' );
 99+
 100+ return json;
 101+};
Index: trunk/parsers/wikidom/lib/synth/es.AnnotationSerializer.js
@@ -0,0 +1,113 @@
 2+/**
 3+ * Creates an annotation renderer object.
 4+ *
 5+ * @class
 6+ * @constructor
 7+ * @property annotations {Object} List of annotations to be applied
 8+ */
 9+es.AnnotationSerializer = function() {
 10+ this.annotations = {};
 11+};
 12+
 13+/* Static Methods */
 14+
 15+es.AnnotationSerializer.repeatString = function( pattern, count ) {
 16+ if ( count < 1 ) {
 17+ return '';
 18+ }
 19+ var result = '';
 20+ while ( count > 0 ) {
 21+ if ( count & 1 ) { result += pattern; }
 22+ count >>= 1;
 23+ pattern += pattern;
 24+ }
 25+ return result;
 26+};
 27+
 28+es.AnnotationSerializer.escapeXmlText = function( text ) {
 29+ return text
 30+ .replace( /&/g, '&amp;' )
 31+ .replace( /</g, '&lt;' )
 32+ .replace( />/g, '&gt;' )
 33+ .replace( /"/g, '&quot;' )
 34+ .replace( /'/g, '&#039;' );
 35+};
 36+
 37+es.AnnotationSerializer.buildXmlAttributes = function( attributes, prespace ) {
 38+ var attr = [];
 39+ var name;
 40+ if ( attributes ) {
 41+ for ( name in attributes ) {
 42+ attr.push( name + '="' + attributes[name] + '"' );
 43+ }
 44+ }
 45+ return ( prespace && attr.length ? ' ' : '' ) + attr.join( ' ' );
 46+};
 47+
 48+es.AnnotationSerializer.buildXmlOpeningTag = function( tag, attributes ) {
 49+ return '<' + tag + es.Document.Serializer.buildXmlAttributes( attributes, true ) + '>';
 50+};
 51+
 52+es.AnnotationSerializer.buildXmlClosingTag = function( tag ) {
 53+ return '</' + tag + '>';
 54+};
 55+
 56+es.AnnotationSerializer.buildXmlTag = function( tag, attributes, value, escape ) {
 57+ if ( value === false ) {
 58+ return '<' + tag + es.Document.Serializer.buildXmlAttributes( attributes, true ) + ' />';
 59+ } else {
 60+ if ( escape ) {
 61+ value = wiki.util.xml.esc( value );
 62+ }
 63+ return '<' + tag + es.Document.Serializer.buildXmlAttributes( attributes, true ) + '>'
 64+ + value + '</' + tag + '>';
 65+ }
 66+};
 67+
 68+/**
 69+ * Adds a set of annotations to be inserted around a range of text.
 70+ *
 71+ * Insertions for the same range will be nested in order of declaration.
 72+ * @example
 73+ * stack = new es.AnnotationSerializer();
 74+ * stack.add( new es.Range( 1, 2 ), '[', ']' );
 75+ * stack.add( new es.Range( 1, 2 ), '{', '}' );
 76+ * // Outputs: "a[{b}]c"
 77+ * console.log( stack.render( 'abc' ) );
 78+ *
 79+ * @param range {es.Range} Range to insert text around
 80+ * @param pre {String} Text to insert before range
 81+ * @param post {String} Text to insert after range
 82+ */
 83+es.AnnotationSerializer.prototype.add = function( range, pre, post ) {
 84+ // TODO: Once we are using Range objects, we should do a range.normalize(); here
 85+ if ( !( range.start in this.annotations ) ) {
 86+ this.annotations[range.start] = [pre];
 87+ } else {
 88+ this.annotations[range.start].push( pre );
 89+ }
 90+ if ( !( range.end in this.annotations ) ) {
 91+ this.annotations[range.end] = [post];
 92+ } else {
 93+ this.annotations[range.end].unshift( post );
 94+ }
 95+};
 96+
 97+/**
 98+ * Renders annotations into text.
 99+ *
 100+ * @param text {String} Text to apply annotations to
 101+ * @returns {String} Wrapped text
 102+ */
 103+es.AnnotationSerializer.prototype.render = function( text ) {
 104+ var out = '';
 105+ for ( var i = 0, length = text.length; i <= length; i++ ) {
 106+ if ( i in this.annotations ) {
 107+ out += this.annotations[i].join( '' );
 108+ }
 109+ if ( i < length ) {
 110+ out += text[i];
 111+ }
 112+ }
 113+ return out;
 114+};
Index: trunk/parsers/wikidom/lib/synth/es.Surface.css
@@ -0,0 +1,183 @@
 2+.editSurface-input {
 3+ position: absolute;
 4+ z-index: -1;
 5+ opacity: 0;
 6+ color: white;
 7+ background-color: white;
 8+ border: none;
 9+ padding: 0;
 10+ margin: 0;
 11+ width: 1px;
 12+}
 13+
 14+.editSurface-input:focus {
 15+ outline: none;
 16+}
 17+
 18+.editSurface {
 19+ overflow: hidden;
 20+}
 21+
 22+.editSurface-document {
 23+ cursor: text;
 24+ margin-top: 1em;
 25+ overflow: hidden;
 26+ -webkit-user-select: none;
 27+}
 28+
 29+.editSurface-block {
 30+ margin: 1em;
 31+ margin-top: 0;
 32+ position: relative;
 33+ min-height: 1.5em;
 34+}
 35+
 36+.editSurface-listItem {
 37+ position: relative;
 38+ padding: 0 0 0 1em;
 39+ background-position: left 0.6em;
 40+ background-repeat: no-repeat;
 41+}
 42+
 43+.editSurface-listItem-content {
 44+ position: relative;
 45+}
 46+
 47+.editSurface-listItem-bullet {
 48+ background-image: url(images/bullet.png);
 49+}
 50+
 51+.editSurface-listItem-number {
 52+ /* */
 53+}
 54+
 55+.editSurface-listItem-bullet .editSurface-listItem-icon {
 56+ display: none;
 57+}
 58+
 59+.editSurface-listItem-number .editSurface-listItem-icon {
 60+ position: absolute;
 61+ right: 100%;
 62+ margin-right: -0.5em;
 63+ height: 1.5em;
 64+ line-height: 1.5em;
 65+}
 66+
 67+.editSurface-listItem-level0 {
 68+ margin-left: 0.5em;
 69+}
 70+
 71+.editSurface-listItem-level1 {
 72+ margin-left: 2.5em;
 73+}
 74+
 75+.editSurface-listItem-level2 {
 76+ margin-left: 4.5em;
 77+}
 78+
 79+.editSurface-listItem-level3 {
 80+ margin-left: 6.5em;
 81+}
 82+
 83+.editSurface-listItem-level4 {
 84+ margin-left: 8.5em;
 85+}
 86+
 87+.editSurface-listItem-level5 {
 88+ margin-left: 10.5em;
 89+}
 90+
 91+.editSurface-listItem-level6 {
 92+ margin-left: 12.5em;
 93+}
 94+
 95+.editSurface-line,
 96+.editSurface-ruler {
 97+ line-height: 1.5em;
 98+ cursor: text;
 99+ white-space: nowrap;
 100+ color: #000000;
 101+}
 102+
 103+.editSurface-ruler {
 104+ position: absolute;
 105+ top: 0;
 106+ left: 0;
 107+ display: inline-block;
 108+ z-index: -1000;
 109+}
 110+
 111+.editSurface-line.empty {
 112+ display: block;
 113+ width: 0px;
 114+}
 115+
 116+.editSurface-whitespace {
 117+ color: #ffffff;
 118+}
 119+
 120+.editSurface-range {
 121+ display: none;
 122+ position: absolute;
 123+ background-color: #bbffcc;
 124+ cursor: text;
 125+ z-index: -1;
 126+}
 127+
 128+.editSurface-cursor {
 129+ position: absolute;
 130+ background-color: black;
 131+ width: 1px;
 132+ height: 1.5em;
 133+ min-height: 1.5em;
 134+ display: none;
 135+}
 136+
 137+.editSurface-format-object {
 138+ background-color: rgba(0,0,0,0.05);
 139+ border-radius: 0.25em;
 140+ margin: 1px 0 1px 1px;
 141+ padding: 0.25em 0;
 142+ cursor: default;
 143+}
 144+
 145+.editSurface-format-object * {
 146+ cursor: default !important;
 147+}
 148+
 149+.editSurface-format-object a:link,
 150+.editSurface-format-object a:visited,
 151+.editSurface-format-object a:active {
 152+ color: blue;
 153+}
 154+
 155+.editSurface-format-italic {
 156+ font-style: italic;
 157+}
 158+
 159+.editSurface-format-bold {
 160+ font-weight: bold;
 161+}
 162+
 163+.editSurface-format-link {
 164+ color: blue;
 165+ text-decoration: underline;
 166+}
 167+
 168+.editSurface-format-big {
 169+ font-size: 1.2em;
 170+}
 171+
 172+.editSurface-format-small,
 173+.editSurface-format-sub,
 174+.editSurface-format-super {
 175+ font-size: .8em;
 176+}
 177+
 178+.editSurface-format-sub {
 179+ vertical-align: sub;
 180+}
 181+
 182+.editSurface-format-super {
 183+ vertical-align: super;
 184+}
Index: trunk/parsers/wikidom/lib/synth/images/bullet.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/parsers/wikidom/lib/synth/images/bullet.png
___________________________________________________________________
Added: svn:mime-type
1185 + application/octet-stream
Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js
@@ -57,4 +57,6 @@
5858 this.contentView.drawSelection( range );
5959 };
6060
 61+/* Inheritance */
 62+
6163 es.extend( es.ListBlockItemView, es.ViewContainerItem );
Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js
@@ -69,5 +69,7 @@
7070 }
7171 };
7272
 73+/* Inheritance */
 74+
7375 es.extend( es.ListBlockView, es.ViewContainer );
7476 es.extend( es.ListBlockView, es.BlockView );
Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js
@@ -108,6 +108,8 @@
109109
110110 };
111111
 112+/* Inheritance */
 113+
112114 es.SurfaceView.prototype.getLocationFromPosition = function( position ) {
113115
114116 };
Index: trunk/parsers/wikidom/lib/synth/views/es.BlockView.js
@@ -48,4 +48,6 @@
4949 throw 'BlockView.getRenderedLineRange not implemented in this subclass.';
5050 };
5151
 52+/* Inheritance */
 53+
5254 es.extend( es.BlockView, es.ViewContainerItem );
Index: trunk/parsers/wikidom/lib/synth/views/es.ContentView.js
@@ -805,4 +805,6 @@
806806 return out;
807807 };
808808
 809+/* Inheritance */
 810+
809811 es.extend( es.ContentView, es.EventEmitter );
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js
@@ -34,5 +34,7 @@
3535 }
3636 };
3737
 38+/* Inheritance */
 39+
3840 es.extend( es.TableBlockRowView, es.ViewContainer );
3941 es.extend( es.TableBlockRowView, es.ViewContainerItem );
Index: trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js
@@ -46,4 +46,6 @@
4747 this.contentView.drawSelection( range );
4848 };
4949
 50+/* Inheritance */
 51+
5052 es.extend( es.ParagraphBlockView, es.BlockView );
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js
@@ -29,5 +29,6 @@
3030 this.documentView.drawSelection( range );
3131 };
3232
 33+/* Inheritance */
3334
3435 es.extend( es.TableBlockCellView, es.ViewContainerItem );
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js
@@ -34,5 +34,7 @@
3535 }
3636 };
3737
 38+/* Inheritance */
 39+
3840 es.extend( es.TableBlockView, es.ViewContainer );
3941 es.extend( es.TableBlockView, es.BlockView );
Index: trunk/parsers/wikidom/demos/synth/es.js
@@ -258,5 +258,6 @@
259259 ]
260260 }
261261 ] } );
262 - var surface = new es.SurfaceView( $('#es-editor'), new es.SurfaceModel( doc ) );
 262+ // Use the global space for debugging purposes
 263+ window.surface = new es.SurfaceView( $('#es-editor'), new es.SurfaceModel( doc ) );
263264 } );
Index: trunk/parsers/wikidom/demos/synth/index.html
@@ -3,7 +3,7 @@
44 <html>
55 <head>
66 <title>EditSurface Demo</title>
7 - <link rel="stylesheet" href="../../lib/es/es.Surface.css">
 7+ <link rel="stylesheet" href="../../lib/synth/es.Surface.css">
88 <link rel="stylesheet" href="es.css">
99 </head>
1010 <body>

Status & tagging log