Index: trunk/extensions/VisualEditor/demos/ce/main.js |
— | — | @@ -472,7 +472,7 @@ |
473 | 473 | }; |
474 | 474 | window.documentModel = ve.dm.DocumentNode.newFromPlainObject( wikidoms['Wikipedia article'] ); |
475 | 475 | window.surfaceModel = new ve.dm.Surface( window.documentModel ); |
476 | | - window.surfaceView = new ve.es.Surface( $( '#es-editor' ), window.surfaceModel ); |
| 476 | + window.surfaceView = new ve.ce.Surface( $( '#es-editor' ), window.surfaceModel ); |
477 | 477 | window.toolbarView = new ve.ui.Toolbar( $( '#es-toolbar' ), window.surfaceView ); |
478 | 478 | window.contextView = new ve.ui.Context( window.surfaceView ); |
479 | 479 | window.surfaceModel.select( new ve.Range( 1, 1 ) ); |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.PreNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a pre view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.PreNode} |
| 22 | + * @returns {ve.ce.PreNode} |
23 | 23 | */ |
24 | 24 | ve.dm.PreNode.prototype.createView = function() { |
25 | | - return new ve.es.PreNode( this ); |
| 25 | + return new ve.ce.PreNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.TableCellNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a table cell view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.TableCellNode} |
| 22 | + * @returns {ve.ce.TableCellNode} |
23 | 23 | */ |
24 | 24 | ve.dm.TableCellNode.prototype.createView = function() { |
25 | | - return new ve.es.TableCellNode( this ); |
| 25 | + return new ve.ce.TableCellNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.TableNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a table view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.TableNode} |
| 22 | + * @returns {ve.ce.TableNode} |
23 | 23 | */ |
24 | 24 | ve.dm.TableNode.prototype.createView = function() { |
25 | | - return new ve.es.TableNode( this ); |
| 25 | + return new ve.ce.TableNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.ListItemNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a list item view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.ListItemNode} |
| 22 | + * @returns {ve.ce.ListItemNode} |
23 | 23 | */ |
24 | 24 | ve.dm.ListItemNode.prototype.createView = function() { |
25 | | - return new ve.es.ListItemNode( this ); |
| 25 | + return new ve.ce.ListItemNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.ListNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a list view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.ListNode} |
| 22 | + * @returns {ve.ce.ListNode} |
23 | 23 | */ |
24 | 24 | ve.dm.ListNode.prototype.createView = function() { |
25 | | - return new ve.es.ListNode( this ); |
| 25 | + return new ve.ce.ListNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js |
— | — | @@ -589,10 +589,10 @@ |
590 | 590 | * Creates a document view for this model. |
591 | 591 | * |
592 | 592 | * @method |
593 | | - * @returns {ve.es.DocumentNode} |
| 593 | + * @returns {ve.ce.DocumentNode} |
594 | 594 | */ |
595 | 595 | ve.dm.DocumentNode.prototype.createView = function() { |
596 | | - return new ve.es.DocumentNode( this ); |
| 596 | + return new ve.ce.DocumentNode( this ); |
597 | 597 | }; |
598 | 598 | |
599 | 599 | /** |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.HeadingNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a heading view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.ParagraphNode} |
| 22 | + * @returns {ve.ce.ParagraphNode} |
23 | 23 | */ |
24 | 24 | ve.dm.HeadingNode.prototype.createView = function() { |
25 | | - return new ve.es.HeadingNode( this ); |
| 25 | + return new ve.ce.HeadingNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.TableRowNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a table row view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.TableRowNode} |
| 22 | + * @returns {ve.ce.TableRowNode} |
23 | 23 | */ |
24 | 24 | ve.dm.TableRowNode.prototype.createView = function() { |
25 | | - return new ve.es.TableRowNode( this ); |
| 25 | + return new ve.ce.TableRowNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.ParagraphNode.js |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | * Creates a paragraph view for this model. |
20 | 20 | * |
21 | 21 | * @method |
22 | | - * @returns {ve.es.ParagraphNode} |
| 22 | + * @returns {ve.ce.ParagraphNode} |
23 | 23 | */ |
24 | 24 | ve.dm.ParagraphNode.prototype.createView = function() { |
25 | | - return new ve.es.ParagraphNode( this ); |
| 25 | + return new ve.ce.ParagraphNode( this ); |
26 | 26 | }; |
27 | 27 | |
28 | 28 | /* Registration */ |
Index: trunk/extensions/VisualEditor/modules/ve/dm/ve.dm.Node.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | * |
30 | 30 | * @abstract |
31 | 31 | * @method |
32 | | - * @returns {ve.es.Node} New item view associated with this model |
| 32 | + * @returns {ve.ce.Node} New item view associated with this model |
33 | 33 | */ |
34 | 34 | ve.dm.Node.prototype.createView = function() { |
35 | 35 | throw 'DocumentModelNode.createView not implemented in this subclass:' + this.constructor; |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Node.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.Node object.
|
| 3 | + * Creates an ve.ce.Node object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @abstract
|
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * @param {ve.dm.Node} model Model to observe
|
10 | 10 | * @param {jQuery} [$element=$( '<div></div>' )] Element to use as a container
|
11 | 11 | */
|
12 | | -ve.es.Node = function( model, $element ) {
|
| 12 | +ve.ce.Node = function( model, $element ) {
|
13 | 13 | // Inheritance
|
14 | 14 | ve.Node.call( this );
|
15 | 15 |
|
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * @see {ve.Node.prototype.getElementLength}
|
29 | 29 | * @returns {Integer} Length of content
|
30 | 30 | */
|
31 | | -ve.es.Node.prototype.getElementLength = function() {
|
| 31 | +ve.ce.Node.prototype.getElementLength = function() {
|
32 | 32 | return this.model.getElementLength();
|
33 | 33 | };
|
34 | 34 |
|
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | * @see {ve.Node.prototype.getContentLength}
|
40 | 40 | * @returns {Integer} Length of content
|
41 | 41 | */
|
42 | | -ve.es.Node.prototype.getContentLength = function() {
|
| 42 | +ve.ce.Node.prototype.getContentLength = function() {
|
43 | 43 | return this.model.getContentLength();
|
44 | 44 | };
|
45 | 45 |
|
— | — | @@ -46,10 +46,10 @@ |
47 | 47 | * Attaches node as a child to another node.
|
48 | 48 | *
|
49 | 49 | * @method
|
50 | | - * @param {ve.es.Node} parent Node to attach to
|
| 50 | + * @param {ve.ce.Node} parent Node to attach to
|
51 | 51 | * @emits attach (parent)
|
52 | 52 | */
|
53 | | -ve.es.Node.prototype.attach = function( parent ) {
|
| 53 | +ve.ce.Node.prototype.attach = function( parent ) {
|
54 | 54 | this.parent = parent;
|
55 | 55 | this.emit( 'attach', parent );
|
56 | 56 | };
|
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | * @method
|
62 | 62 | * @emits detach (parent)
|
63 | 63 | */
|
64 | | -ve.es.Node.prototype.detach = function() {
|
| 64 | +ve.ce.Node.prototype.detach = function() {
|
65 | 65 | var parent = this.parent;
|
66 | 66 | this.parent = null;
|
67 | 67 | this.emit( 'detach', parent );
|
— | — | @@ -70,9 +70,9 @@ |
71 | 71 | * Gets a reference to this node's parent.
|
72 | 72 | *
|
73 | 73 | * @method
|
74 | | - * @returns {ve.es.Node} Reference to this node's parent
|
| 74 | + * @returns {ve.ce.Node} Reference to this node's parent
|
75 | 75 | */
|
76 | | -ve.es.Node.prototype.getParent = function() {
|
| 76 | +ve.ce.Node.prototype.getParent = function() {
|
77 | 77 | return this.parent;
|
78 | 78 | };
|
79 | 79 |
|
— | — | @@ -82,26 +82,26 @@ |
83 | 83 | * @method
|
84 | 84 | * @returns {ve.dm.Node} Reference to the model this node observes
|
85 | 85 | */
|
86 | | -ve.es.Node.prototype.getModel = function() {
|
| 86 | +ve.ce.Node.prototype.getModel = function() {
|
87 | 87 | return this.model;
|
88 | 88 | };
|
89 | 89 |
|
90 | | -ve.es.Node.getSplitableNode = function( node ) {
|
| 90 | +ve.ce.Node.getSplitableNode = function( node ) {
|
91 | 91 | var splitableNode = null;
|
92 | 92 |
|
93 | 93 | ve.Node.traverseUpstream( node, function( node ) {
|
94 | 94 | var elementType = node.model.getElementType();
|
95 | 95 | if (
|
96 | 96 | splitableNode !== null &&
|
97 | | - ve.es.DocumentNode.splitRules[ elementType ].children === true
|
| 97 | + ve.ce.DocumentNode.splitRules[ elementType ].children === true
|
98 | 98 | ) {
|
99 | 99 | return false;
|
100 | 100 | }
|
101 | | - splitableNode = ve.es.DocumentNode.splitRules[ elementType ].self ? node : null;
|
| 101 | + splitableNode = ve.ce.DocumentNode.splitRules[ elementType ].self ? node : null;
|
102 | 102 | } );
|
103 | 103 | return splitableNode;
|
104 | 104 | };
|
105 | 105 |
|
106 | 106 | /* Inheritance */
|
107 | 107 |
|
108 | | -ve.extendClass( ve.es.Node, ve.Node );
|
| 108 | +ve.extendClass( ve.ce.Node, ve.Node );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js |
— | — | @@ -1,12 +1,12 @@ |
2 | 2 | /** |
3 | | - * Creates an ve.es.Surface object. |
| 3 | + * Creates an ve.ce.Surface object. |
4 | 4 | * |
5 | 5 | * @class |
6 | 6 | * @constructor |
7 | 7 | * @param {jQuery} $container DOM Container to render surface into |
8 | 8 | * @param {ve.dm.Surface} model Surface model to view |
9 | 9 | */ |
10 | | -ve.es.Surface = function( $container, model ) { |
| 10 | +ve.ce.Surface = function( $container, model ) { |
11 | 11 | // Inheritance |
12 | 12 | ve.EventEmitter.call( this ); |
13 | 13 | |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | |
19 | 19 | // Properties |
20 | 20 | this.model = model; |
21 | | - this.documentView = new ve.es.DocumentNode( this.model.getDocument(), this ); |
| 21 | + this.documentView = new ve.ce.DocumentNode( this.model.getDocument(), this ); |
22 | 22 | this.contextView = null; |
23 | 23 | this.$ = $container |
24 | 24 | .addClass( 'es-surfaceView' ) |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | |
83 | 83 | /* Methods */ |
84 | 84 | |
85 | | -ve.es.Surface.prototype.annotate = function( method, annotation ) { |
| 85 | +ve.ce.Surface.prototype.annotate = function( method, annotation ) { |
86 | 86 | var range = this.getSelection(); |
87 | 87 | if ( method === 'toggle' ) { |
88 | 88 | var annotations = this.getAnnotations(); |
— | — | @@ -107,11 +107,11 @@ |
108 | 108 | } |
109 | 109 | }; |
110 | 110 | |
111 | | -ve.es.Surface.prototype.renderDomNode = function ( node ) { |
| 111 | +ve.ce.Surface.prototype.renderDomNode = function ( node ) { |
112 | 112 | this.getLeafNode( node ).data( 'view' ).renderContent(); |
113 | 113 | }; |
114 | 114 | |
115 | | -ve.es.Surface.prototype.onCutCopy = function( e ) { |
| 115 | +ve.ce.Surface.prototype.onCutCopy = function( e ) { |
116 | 116 | var _this = this, |
117 | 117 | rangySel = rangy.getSelection(), |
118 | 118 | key = rangySel.getRangeAt(0).toString().replace(/\s/gm,""); |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | } |
144 | 144 | }; |
145 | 145 | |
146 | | -ve.es.Surface.prototype.onPaste = function( e ) { |
| 146 | +ve.ce.Surface.prototype.onPaste = function( e ) { |
147 | 147 | var _this = this, |
148 | 148 | insertionPoint = _this.getSelection().start, |
149 | 149 | node = rangy.getSelection().anchorNode; |
— | — | @@ -171,35 +171,35 @@ |
172 | 172 | }, 1 ); |
173 | 173 | }; |
174 | 174 | |
175 | | -ve.es.Surface.prototype.onCompositionStart = function( e ) { |
| 175 | +ve.ce.Surface.prototype.onCompositionStart = function( e ) { |
176 | 176 | this.stopPolling(); |
177 | 177 | var rangySel = rangy.getSelection(); |
178 | 178 | this.poll.compositionStart = this.getOffset( rangySel.anchorNode, rangySel.anchorOffset, false ); |
179 | 179 | }; |
180 | 180 | |
181 | | -ve.es.Surface.prototype.onCompositionEnd = function( e ) { |
| 181 | +ve.ce.Surface.prototype.onCompositionEnd = function( e ) { |
182 | 182 | var rangySel = rangy.getSelection(); |
183 | 183 | this.poll.compositionEnd = this.getOffset( rangySel.focusNode, rangySel.focusOffset, false ); |
184 | 184 | this.startPolling(); |
185 | 185 | }; |
186 | 186 | |
187 | | -ve.es.Surface.prototype.attachContextView = function( contextView ) { |
| 187 | +ve.ce.Surface.prototype.attachContextView = function( contextView ) { |
188 | 188 | this.contextView = contextView; |
189 | 189 | }; |
190 | 190 | |
191 | | -ve.es.Surface.prototype.getModel = function() { |
| 191 | +ve.ce.Surface.prototype.getModel = function() { |
192 | 192 | return this.model; |
193 | 193 | }; |
194 | 194 | |
195 | | -ve.es.Surface.prototype.documentOnFocus = function() { |
| 195 | +ve.ce.Surface.prototype.documentOnFocus = function() { |
196 | 196 | this.startPolling(); |
197 | 197 | }; |
198 | 198 | |
199 | | -ve.es.Surface.prototype.documentOnBlur = function() { |
| 199 | +ve.ce.Surface.prototype.documentOnBlur = function() { |
200 | 200 | this.stopPolling(); |
201 | 201 | }; |
202 | 202 | |
203 | | -ve.es.Surface.prototype.startPolling = function() { |
| 203 | +ve.ce.Surface.prototype.startPolling = function() { |
204 | 204 | if ( this.poll.interval === null ) { |
205 | 205 | var _this = this; |
206 | 206 | setTimeout( function() { |
— | — | @@ -211,20 +211,20 @@ |
212 | 212 | } |
213 | 213 | }; |
214 | 214 | |
215 | | -ve.es.Surface.prototype.stopPolling = function() { |
| 215 | +ve.ce.Surface.prototype.stopPolling = function() { |
216 | 216 | if ( this.poll.interval !== null ) { |
217 | 217 | clearInterval( this.poll.interval ); |
218 | 218 | this.poll.interval = null; |
219 | 219 | } |
220 | 220 | }; |
221 | 221 | |
222 | | -ve.es.Surface.prototype.pollContent = function() { |
| 222 | +ve.ce.Surface.prototype.pollContent = function() { |
223 | 223 | var localOffset, text, hash; |
224 | 224 | |
225 | 225 | if ( this.poll.compositionStart !== null && this.poll.compositionEnd !== null ) { |
226 | 226 | |
227 | | - text = ve.es.Surface.getDOMText2( this.poll.node ); |
228 | | - hash = ve.es.Surface.getDOMHash( this.poll.node ); |
| 227 | + text = ve.ce.Surface.getDOMText2( this.poll.node ); |
| 228 | + hash = ve.ce.Surface.getDOMHash( this.poll.node ); |
229 | 229 | localOffset = this.poll.compositionEnd; |
230 | 230 | this.poll.compositionStart = null; |
231 | 231 | this.poll.compositionEnd = null; |
— | — | @@ -237,8 +237,8 @@ |
238 | 238 | } |
239 | 239 | |
240 | 240 | var node = this.getLeafNode( rangySel.anchorNode )[0]; |
241 | | - text = ve.es.Surface.getDOMText2( node ); |
242 | | - hash = ve.es.Surface.getDOMHash( node ); |
| 241 | + text = ve.ce.Surface.getDOMText2( node ); |
| 242 | + hash = ve.ce.Surface.getDOMHash( node ); |
243 | 243 | |
244 | 244 | if ( rangySel.anchorNode !== rangySel.focusNode || rangySel.anchorOffset !== rangySel.focusOffset ) { |
245 | 245 | localOffset = null; |
— | — | @@ -305,7 +305,7 @@ |
306 | 306 | this.poll.prevOffset = localOffset; |
307 | 307 | }; |
308 | 308 | |
309 | | -ve.es.Surface.prototype.onMouseDown = function( e ) { |
| 309 | +ve.ce.Surface.prototype.onMouseDown = function( e ) { |
310 | 310 | if ( this.poll.interval !== null ) { |
311 | 311 | this.stopPolling(); |
312 | 312 | this.pollContent(); |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | } |
315 | 315 | }; |
316 | 316 | |
317 | | -ve.es.Surface.prototype.onKeyDown = function( e ) { |
| 317 | +ve.ce.Surface.prototype.onKeyDown = function( e ) { |
318 | 318 | if ( this.poll.interval !== null ) { |
319 | 319 | this.stopPolling(); |
320 | 320 | this.pollContent(); |
— | — | @@ -370,7 +370,7 @@ |
371 | 371 | } |
372 | 372 | }; |
373 | 373 | |
374 | | -ve.es.Surface.prototype.getOffset = function( elem, offset, global ) { |
| 374 | +ve.ce.Surface.prototype.getOffset = function( elem, offset, global ) { |
375 | 375 | var $leafNode = this.getLeafNode( elem ), |
376 | 376 | current = [$leafNode.contents(), 0], |
377 | 377 | stack = [current], |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | } |
418 | 418 | }; |
419 | 419 | |
420 | | -ve.es.Surface.prototype.showCursorAt = function( offset ) { |
| 420 | +ve.ce.Surface.prototype.showCursorAt = function( offset ) { |
421 | 421 | var $node = this.documentView.getNodeFromOffset( offset ).$, |
422 | 422 | current = [$node.contents(), 0], |
423 | 423 | stack = [current], |
— | — | @@ -462,7 +462,7 @@ |
463 | 463 | sel.addRange( range ); |
464 | 464 | }; |
465 | 465 | |
466 | | -ve.es.Surface.prototype.getSelection = function() { |
| 466 | +ve.ce.Surface.prototype.getSelection = function() { |
467 | 467 | var rangySel = rangy.getSelection(), |
468 | 468 | range; |
469 | 469 | |
— | — | @@ -479,7 +479,7 @@ |
480 | 480 | return range; |
481 | 481 | }; |
482 | 482 | |
483 | | -ve.es.Surface.prototype.getLeafNode = function( elem ) { |
| 483 | +ve.ce.Surface.prototype.getLeafNode = function( elem ) { |
484 | 484 | var $node = $( elem ); |
485 | 485 | while( !$node.hasClass( 'ce-leafNode' ) ) { |
486 | 486 | $node = $node.parent(); |
— | — | @@ -487,13 +487,13 @@ |
488 | 488 | return $node; |
489 | 489 | }; |
490 | 490 | |
491 | | -ve.es.Surface.getDOMText2 = function( elem ) { |
| 491 | +ve.ce.Surface.getDOMText2 = function( elem ) { |
492 | 492 | // TODO: there must be some better way to write this regex replace |
493 | 493 | var regex = new RegExp("[" + String.fromCharCode(32) + String.fromCharCode(160) + "]", "g"); |
494 | | - return ve.es.Surface.getDOMText( elem ).replace( regex, " " ); |
| 494 | + return ve.ce.Surface.getDOMText( elem ).replace( regex, " " ); |
495 | 495 | }; |
496 | 496 | |
497 | | -ve.es.Surface.getDOMText = function( elem ) { |
| 497 | +ve.ce.Surface.getDOMText = function( elem ) { |
498 | 498 | var nodeType = elem.nodeType, |
499 | 499 | ret = ''; |
500 | 500 | |
— | — | @@ -507,7 +507,7 @@ |
508 | 508 | } else { |
509 | 509 | // Traverse it's children |
510 | 510 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { |
511 | | - ret += ve.es.Surface.getDOMText( elem ); |
| 511 | + ret += ve.ce.Surface.getDOMText( elem ); |
512 | 512 | } |
513 | 513 | } |
514 | 514 | } else if ( nodeType === 3 || nodeType === 4 ) { |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | return ret; |
519 | 519 | }; |
520 | 520 | |
521 | | -ve.es.Surface.getDOMHash = function( elem ) { |
| 521 | +ve.ce.Surface.getDOMHash = function( elem ) { |
522 | 522 | var nodeType = elem.nodeType, |
523 | 523 | nodeName = elem.nodeName, |
524 | 524 | ret = ''; |
— | — | @@ -528,14 +528,14 @@ |
529 | 529 | ret += '<' + nodeName + '>'; |
530 | 530 | // Traverse it's children |
531 | 531 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { |
532 | | - ret += ve.es.Surface.getDOMHash( elem ); |
| 532 | + ret += ve.ce.Surface.getDOMHash( elem ); |
533 | 533 | } |
534 | 534 | ret += '</' + nodeName + '>'; |
535 | 535 | } |
536 | 536 | return ret; |
537 | 537 | }; |
538 | 538 | |
539 | | -ve.es.Surface.prototype.handleDelete = function( backspace, isPartial ) { |
| 539 | +ve.ce.Surface.prototype.handleDelete = function( backspace, isPartial ) { |
540 | 540 | this.stopPolling(); |
541 | 541 | var selection = this.getSelection().clone(), |
542 | 542 | sourceOffset, |
— | — | @@ -564,8 +564,8 @@ |
565 | 565 | targetNode = this.documentView.getNodeFromOffset( targetOffset, false ); |
566 | 566 | |
567 | 567 | if ( sourceNode.model.getElementType() === targetNode.model.getElementType() ) { |
568 | | - sourceSplitableNode = ve.es.Node.getSplitableNode( sourceNode ); |
569 | | - targetSplitableNode = ve.es.Node.getSplitableNode( targetNode ); |
| 568 | + sourceSplitableNode = ve.ce.Node.getSplitableNode( sourceNode ); |
| 569 | + targetSplitableNode = ve.ce.Node.getSplitableNode( targetNode ); |
570 | 570 | } |
571 | 571 | |
572 | 572 | cursorAt = targetOffset; |
— | — | @@ -614,7 +614,7 @@ |
615 | 615 | |
616 | 616 | }; |
617 | 617 | |
618 | | -ve.es.Surface.prototype.handleEnter = function() { |
| 618 | +ve.ce.Surface.prototype.handleEnter = function() { |
619 | 619 | this.stopPolling(); |
620 | 620 | var selection = this.getSelection().clone(), |
621 | 621 | tx; |
— | — | @@ -626,7 +626,7 @@ |
627 | 627 | |
628 | 628 | if ( |
629 | 629 | nodeOffset + node.getContentLength() + 1 === selection.to && |
630 | | - node === ve.es.Node.getSplitableNode( node ) |
| 630 | + node === ve.ce.Node.getSplitableNode( node ) |
631 | 631 | ) { |
632 | 632 | tx = this.documentView.model.prepareInsertion( |
633 | 633 | nodeOffset + node.getElementLength(), |
— | — | @@ -642,7 +642,7 @@ |
643 | 643 | var elementType = node.model.getElementType(); |
644 | 644 | if ( |
645 | 645 | splitable === true && |
646 | | - ve.es.DocumentNode.splitRules[ elementType ].children === true |
| 646 | + ve.ce.DocumentNode.splitRules[ elementType ].children === true |
647 | 647 | ) { |
648 | 648 | return false; |
649 | 649 | } |
— | — | @@ -655,7 +655,7 @@ |
656 | 656 | 'attributes': ve.copyObject( node.model.element.attributes ) |
657 | 657 | } |
658 | 658 | ); |
659 | | - splitable = ve.es.DocumentNode.splitRules[ elementType ].self; |
| 659 | + splitable = ve.ce.DocumentNode.splitRules[ elementType ].self; |
660 | 660 | return true; |
661 | 661 | } ); |
662 | 662 | tx = this.documentView.model.prepareInsertion( selection.to, stack ); |
— | — | @@ -674,4 +674,4 @@ |
675 | 675 | |
676 | 676 | /* Inheritance */ |
677 | 677 | |
678 | | -ve.extendClass( ve.es.Surface, ve.EventEmitter ); |
\ No newline at end of file |
| 678 | +ve.extendClass( ve.ce.Surface, ve.EventEmitter ); |
\ No newline at end of file |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Content.js |
— | — | @@ -1,4 +1,4 @@ |
2 | | -ve.es.Content = function( $container, model ) { |
| 2 | +ve.ce.Content = function( $container, model ) { |
3 | 3 | // Inheritance |
4 | 4 | ve.EventEmitter.call( this ); |
5 | 5 | |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * @static |
28 | 28 | * @member |
29 | 29 | */ |
30 | | -ve.es.Content.annotationRenderers = { |
| 30 | +ve.ce.Content.annotationRenderers = { |
31 | 31 | 'object/template': { |
32 | 32 | 'open': function( data ) { |
33 | 33 | return '<span class="es-contentView-format-object">' + data.html; |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | * @static |
93 | 93 | * @member |
94 | 94 | */ |
95 | | -ve.es.Content.htmlCharacters = { |
| 95 | +ve.ce.Content.htmlCharacters = { |
96 | 96 | '&': '&', |
97 | 97 | '<': '<', |
98 | 98 | '>': '>', |
— | — | @@ -117,8 +117,8 @@ |
118 | 118 | * @param {Array} stack List of currently open annotations |
119 | 119 | * @returns {String} Rendered annotation |
120 | 120 | */ |
121 | | -ve.es.Content.renderAnnotation = function( bias, annotation, stack ) { |
122 | | - var renderers = ve.es.Content.annotationRenderers, |
| 121 | +ve.ce.Content.renderAnnotation = function( bias, annotation, stack ) { |
| 122 | + var renderers = ve.ce.Content.annotationRenderers, |
123 | 123 | type = annotation.type, |
124 | 124 | out = ''; |
125 | 125 | if ( type in renderers ) { |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | |
169 | 169 | /* Methods */ |
170 | 170 | |
171 | | -ve.es.Content.prototype.render = function( offset ) { |
| 171 | +ve.ce.Content.prototype.render = function( offset ) { |
172 | 172 | this.$.html( this.getHtml( 0, this.model.getContentLength() ) ); |
173 | 173 | }; |
174 | 174 | |
— | — | @@ -178,15 +178,15 @@ |
179 | 179 | * @param {ve.Range} range Range of content to render |
180 | 180 | * @param {String} Rendered HTML of data within content model |
181 | 181 | */ |
182 | | -ve.es.Content.prototype.getHtml = function( range, options ) { |
| 182 | +ve.ce.Content.prototype.getHtml = function( range, options ) { |
183 | 183 | if ( range ) { |
184 | 184 | range.normalize(); |
185 | 185 | } else { |
186 | 186 | range = { 'start': 0, 'end': undefined }; |
187 | 187 | } |
188 | 188 | var data = this.model.getContentData(), |
189 | | - render = ve.es.Content.renderAnnotation, |
190 | | - htmlChars = ve.es.Content.htmlCharacters; |
| 189 | + render = ve.ce.Content.renderAnnotation, |
| 190 | + htmlChars = ve.ce.Content.htmlCharacters; |
191 | 191 | var out = '', |
192 | 192 | left = '', |
193 | 193 | right, |
— | — | @@ -238,4 +238,4 @@ |
239 | 239 | |
240 | 240 | /* Inheritance */ |
241 | 241 | |
242 | | -ve.extendClass( ve.es.Content, ve.EventEmitter ); |
\ No newline at end of file |
| 242 | +ve.extendClass( ve.ce.Content, ve.EventEmitter ); |
\ No newline at end of file |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.LeafNode.js |
— | — | @@ -1,24 +1,24 @@ |
2 | 2 | /** |
3 | | - * Creates an ve.es.LeafNode object. |
| 3 | + * Creates an ve.ce.LeafNode object. |
4 | 4 | * |
5 | 5 | * @class |
6 | 6 | * @abstract |
7 | 7 | * @constructor |
8 | 8 | * @extends {ve.LeafNode} |
9 | | - * @extends {ve.es.Node} |
| 9 | + * @extends {ve.ce.Node} |
10 | 10 | * @param model {ve.ModelNode} Model to observe |
11 | 11 | * @param {jQuery} [$element] Element to use as a container |
12 | 12 | */ |
13 | | -ve.es.LeafNode = function( model, $element ) { |
| 13 | +ve.ce.LeafNode = function( model, $element ) { |
14 | 14 | // Inheritance |
15 | 15 | ve.LeafNode.call( this ); |
16 | | - ve.es.Node.call( this, model, $element ); |
| 16 | + ve.ce.Node.call( this, model, $element ); |
17 | 17 | |
18 | 18 | this.$.data('view', this); |
19 | 19 | this.$.addClass('ce-leafNode'); |
20 | 20 | |
21 | 21 | // Properties |
22 | | - this.contentView = new ve.es.Content( this.$, model ); |
| 22 | + this.contentView = new ve.ce.Content( this.$, model ); |
23 | 23 | |
24 | 24 | // Events |
25 | 25 | this.contentView.on( 'update', this.emitUpdate ); |
— | — | @@ -31,15 +31,15 @@ |
32 | 32 | * |
33 | 33 | * @method |
34 | 34 | */ |
35 | | -ve.es.LeafNode.prototype.renderContent = function() { |
| 35 | +ve.ce.LeafNode.prototype.renderContent = function() { |
36 | 36 | this.contentView.render(); |
37 | 37 | }; |
38 | 38 | |
39 | | -ve.es.LeafNode.prototype.getDOMText = function() { |
| 39 | +ve.ce.LeafNode.prototype.getDOMText = function() { |
40 | 40 | return ve.ce.getDOMText( this.$[0] ); |
41 | 41 | }; |
42 | 42 | |
43 | 43 | /* Inheritance */ |
44 | 44 | |
45 | | -ve.extendClass( ve.es.LeafNode, ve.LeafNode ); |
46 | | -ve.extendClass( ve.es.LeafNode, ve.es.Node ); |
| 45 | +ve.extendClass( ve.ce.LeafNode, ve.LeafNode ); |
| 46 | +ve.extendClass( ve.ce.LeafNode, ve.ce.Node ); |
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.HeadingNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.HeadingNode object.
|
| 3 | + * Creates an ve.ce.HeadingNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.LeafNode}
|
| 7 | + * @extends {ve.ce.LeafNode}
|
8 | 8 | * @param {ve.dm.HeadingNode} model Heading model to view
|
9 | 9 | */
|
10 | | -ve.es.HeadingNode = function( model ) {
|
| 10 | +ve.ce.HeadingNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.LeafNode.call( this, model );
|
| 12 | + ve.ce.LeafNode.call( this, model );
|
13 | 13 |
|
14 | 14 | // Properties
|
15 | 15 | this.currentLevelHash = null;
|
— | — | @@ -28,7 +28,7 @@ |
29 | 29 |
|
30 | 30 | /* Methods */
|
31 | 31 |
|
32 | | -ve.es.HeadingNode.prototype.setClasses = function() {
|
| 32 | +ve.ce.HeadingNode.prototype.setClasses = function() {
|
33 | 33 | var level = this.model.getElementAttribute( 'level' );
|
34 | 34 | if ( level !== this.currentLevelHash ) {
|
35 | 35 | this.currentLevelHash = level;
|
— | — | @@ -43,11 +43,11 @@ |
44 | 44 |
|
45 | 45 | /* Registration */
|
46 | 46 |
|
47 | | -ve.es.DocumentNode.splitRules.heading = {
|
| 47 | +ve.ce.DocumentNode.splitRules.heading = {
|
48 | 48 | 'self': true,
|
49 | 49 | 'children': null
|
50 | 50 | };
|
51 | 51 |
|
52 | 52 | /* Inheritance */
|
53 | 53 |
|
54 | | -ve.extendClass( ve.es.HeadingNode, ve.es.LeafNode );
|
| 54 | +ve.extendClass( ve.ce.HeadingNode, ve.ce.LeafNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.TableRowNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.TableRowNode object.
|
| 3 | + * Creates an ve.ce.TableRowNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.BranchNode}
|
| 7 | + * @extends {ve.ce.BranchNode}
|
8 | 8 | * @param {ve.dm.TableRowNode} model Table row model to view
|
9 | 9 | */
|
10 | | -ve.es.TableRowNode = function( model ) {
|
| 10 | +ve.ce.TableRowNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.BranchNode.call( this, model, $( '<tr>' ), true );
|
| 12 | + ve.ce.BranchNode.call( this, model, $( '<tr>' ), true );
|
13 | 13 |
|
14 | 14 | // DOM Changes
|
15 | 15 | this.$
|
— | — | @@ -18,11 +18,11 @@ |
19 | 19 |
|
20 | 20 | /* Registration */
|
21 | 21 |
|
22 | | -ve.es.DocumentNode.splitRules.tableRow = {
|
| 22 | +ve.ce.DocumentNode.splitRules.tableRow = {
|
23 | 23 | 'self': false,
|
24 | 24 | 'children': false
|
25 | 25 | };
|
26 | 26 |
|
27 | 27 | /* Inheritance */
|
28 | 28 |
|
29 | | -ve.extendClass( ve.es.TableRowNode, ve.es.BranchNode );
|
| 29 | +ve.extendClass( ve.ce.TableRowNode, ve.ce.BranchNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.ParagraphNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /** |
3 | | - * Creates an ve.es.ParagraphNode object. |
| 3 | + * Creates an ve.ce.ParagraphNode object. |
4 | 4 | * |
5 | 5 | * @class |
6 | 6 | * @constructor |
7 | | - * @extends {ve.es.LeafNode} |
| 7 | + * @extends {ve.ce.LeafNode} |
8 | 8 | * @param {ve.dm.ParagraphNode} model Paragraph model to view |
9 | 9 | */ |
10 | | -ve.es.ParagraphNode = function( model ) { |
| 10 | +ve.ce.ParagraphNode = function( model ) { |
11 | 11 | // Inheritance |
12 | | - ve.es.LeafNode.call( this, model, $( '<p></p>' ) ); |
| 12 | + ve.ce.LeafNode.call( this, model, $( '<p></p>' ) ); |
13 | 13 | |
14 | 14 | // DOM Changes |
15 | 15 | this.$.addClass( 'es-paragraphView' ); |
— | — | @@ -16,11 +16,11 @@ |
17 | 17 | |
18 | 18 | /* Registration */ |
19 | 19 | |
20 | | -ve.es.DocumentNode.splitRules.paragraph = { |
| 20 | +ve.ce.DocumentNode.splitRules.paragraph = { |
21 | 21 | 'self': true, |
22 | 22 | 'children': null |
23 | 23 | }; |
24 | 24 | |
25 | 25 | /* Inheritance */ |
26 | 26 | |
27 | | -ve.extendClass( ve.es.ParagraphNode, ve.es.LeafNode ); |
| 27 | +ve.extendClass( ve.ce.ParagraphNode, ve.ce.LeafNode ); |
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.PreNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.PreNode object.
|
| 3 | + * Creates an ve.ce.PreNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.LeafNode}
|
| 7 | + * @extends {ve.ce.LeafNode}
|
8 | 8 | * @param {ve.dm.PreNode} model Pre model to view
|
9 | 9 | */
|
10 | | -ve.es.PreNode = function( model ) {
|
| 10 | +ve.ce.PreNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.LeafNode.call( this, model, undefined, { 'pre': true } );
|
| 12 | + ve.ce.LeafNode.call( this, model, undefined, { 'pre': true } );
|
13 | 13 |
|
14 | 14 | // DOM Changes
|
15 | 15 | this.$.addClass( 'es-preView' );
|
— | — | @@ -16,11 +16,11 @@ |
17 | 17 |
|
18 | 18 | /* Registration */
|
19 | 19 |
|
20 | | -ve.es.DocumentNode.splitRules.pre = {
|
| 20 | +ve.ce.DocumentNode.splitRules.pre = {
|
21 | 21 | 'self': true,
|
22 | 22 | 'children': null
|
23 | 23 | };
|
24 | 24 |
|
25 | 25 | /* Inheritance */
|
26 | 26 |
|
27 | | -ve.extendClass( ve.es.PreNode, ve.es.LeafNode );
|
| 27 | +ve.extendClass( ve.ce.PreNode, ve.ce.LeafNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.TableCellNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.TableCellNode object.
|
| 3 | + * Creates an ve.ce.TableCellNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.BranchNode}
|
| 7 | + * @extends {ve.ce.BranchNode}
|
8 | 8 | * @param {ve.dm.TableCellNode} model Table cell model to view
|
9 | 9 | */
|
10 | | -ve.es.TableCellNode = function( model ) {
|
| 10 | +ve.ce.TableCellNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.BranchNode.call( this, model, $( '<td>' ) );
|
| 12 | + ve.ce.BranchNode.call( this, model, $( '<td>' ) );
|
13 | 13 |
|
14 | 14 | // DOM Changes
|
15 | 15 | this.$
|
— | — | @@ -18,11 +18,11 @@ |
19 | 19 |
|
20 | 20 | /* Registration */
|
21 | 21 |
|
22 | | -ve.es.DocumentNode.splitRules.tableCell = {
|
| 22 | +ve.ce.DocumentNode.splitRules.tableCell = {
|
23 | 23 | 'self': false,
|
24 | 24 | 'children': true
|
25 | 25 | };
|
26 | 26 |
|
27 | 27 | /* Inheritance */
|
28 | 28 |
|
29 | | -ve.extendClass( ve.es.TableCellNode, ve.es.BranchNode );
|
| 29 | +ve.extendClass( ve.ce.TableCellNode, ve.ce.BranchNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.TableNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.TableNode object.
|
| 3 | + * Creates an ve.ce.TableNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.BranchNode}
|
| 7 | + * @extends {ve.ce.BranchNode}
|
8 | 8 | * @param {ve.dm.TableNode} model Table model to view
|
9 | 9 | */
|
10 | | -ve.es.TableNode = function( model ) {
|
| 10 | +ve.ce.TableNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.BranchNode.call( this, model, $( '<table>' ) );
|
| 12 | + ve.ce.BranchNode.call( this, model, $( '<table>' ) );
|
13 | 13 |
|
14 | 14 | // DOM Changes
|
15 | 15 | this.$
|
— | — | @@ -18,11 +18,11 @@ |
19 | 19 |
|
20 | 20 | /* Registration */
|
21 | 21 |
|
22 | | -ve.es.DocumentNode.splitRules.table = {
|
| 22 | +ve.ce.DocumentNode.splitRules.table = {
|
23 | 23 | 'self': false,
|
24 | 24 | 'children': false
|
25 | 25 | };
|
26 | 26 |
|
27 | 27 | /* Inheritance */
|
28 | 28 |
|
29 | | -ve.extendClass( ve.es.TableNode, ve.es.BranchNode );
|
| 29 | +ve.extendClass( ve.ce.TableNode, ve.ce.BranchNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.ListItemNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.ListItemNode object.
|
| 3 | + * Creates an ve.ce.ListItemNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.LeafNode}
|
| 7 | + * @extends {ve.ce.LeafNode}
|
8 | 8 | * @param {ve.dm.ListItemNode} model List item model to view
|
9 | 9 | */
|
10 | | -ve.es.ListItemNode = function( model ) {
|
| 10 | +ve.ce.ListItemNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.BranchNode.call( this, model );
|
| 12 | + ve.ce.BranchNode.call( this, model );
|
13 | 13 |
|
14 | 14 | // Properties
|
15 | 15 | this.$icon = $( '<div class="es-listItemView-icon"></div>' ).prependTo( this.$ );
|
— | — | @@ -29,7 +29,7 @@ |
30 | 30 |
|
31 | 31 | /* Methods */
|
32 | 32 |
|
33 | | -ve.es.ListItemNode.prototype.setClasses = function() {
|
| 33 | +ve.ce.ListItemNode.prototype.setClasses = function() {
|
34 | 34 | var styles = this.model.getElementAttribute( 'styles' ),
|
35 | 35 | stylesHash = styles.join( '|' );
|
36 | 36 | if ( this.currentStylesHash !== stylesHash ) {
|
— | — | @@ -52,11 +52,11 @@ |
53 | 53 |
|
54 | 54 | /* Registration */
|
55 | 55 |
|
56 | | -ve.es.DocumentNode.splitRules.listItem = {
|
| 56 | +ve.ce.DocumentNode.splitRules.listItem = {
|
57 | 57 | 'self': true,
|
58 | 58 | 'children': false
|
59 | 59 | };
|
60 | 60 |
|
61 | 61 | /* Inheritance */
|
62 | 62 |
|
63 | | -ve.extendClass( ve.es.ListItemNode, ve.es.BranchNode );
|
| 63 | +ve.extendClass( ve.ce.ListItemNode, ve.ce.BranchNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.ListNode.js |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.ListNode object.
|
| 3 | + * Creates an ve.ce.ListNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @constructor
|
7 | | - * @extends {ve.es.BranchNode}
|
| 7 | + * @extends {ve.ce.BranchNode}
|
8 | 8 | * @param {ve.dm.ListNode} model List model to view
|
9 | 9 | */
|
10 | | -ve.es.ListNode = function( model ) {
|
| 10 | +ve.ce.ListNode = function( model ) {
|
11 | 11 | // Inheritance
|
12 | | - ve.es.BranchNode.call( this, model );
|
| 12 | + ve.ce.BranchNode.call( this, model );
|
13 | 13 |
|
14 | 14 | // DOM Changes
|
15 | 15 | this.$.addClass( 'es-listView' );
|
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | *
|
32 | 32 | * @method
|
33 | 33 | */
|
34 | | -ve.es.ListNode.prototype.enumerate = function() {
|
| 34 | +ve.ce.ListNode.prototype.enumerate = function() {
|
35 | 35 | var styles,
|
36 | 36 | levels = [];
|
37 | 37 | for ( var i = 0; i < this.children.length; i++ ) {
|
— | — | @@ -52,11 +52,11 @@ |
53 | 53 |
|
54 | 54 | /* Registration */
|
55 | 55 |
|
56 | | -ve.es.DocumentNode.splitRules.list = {
|
| 56 | +ve.ce.DocumentNode.splitRules.list = {
|
57 | 57 | 'self': false,
|
58 | 58 | 'children': true
|
59 | 59 | };
|
60 | 60 |
|
61 | 61 | /* Inheritance */
|
62 | 62 |
|
63 | | -ve.extendClass( ve.es.ListNode, ve.es.BranchNode );
|
| 63 | +ve.extendClass( ve.ce.ListNode, ve.ce.BranchNode );
|
Index: trunk/extensions/VisualEditor/modules/ve/ce/nodes/ve.ce.DocumentNode.js |
— | — | @@ -1,15 +1,15 @@ |
2 | 2 | /** |
3 | | - * Creates an ve.es.DocumentNode object. |
| 3 | + * Creates an ve.ce.DocumentNode object. |
4 | 4 | * |
5 | 5 | * @class |
6 | 6 | * @constructor |
7 | | - * @extends {ve.es.BranchNode} |
| 7 | + * @extends {ve.ce.BranchNode} |
8 | 8 | * @param {ve.dm.DocumentNode} documentModel Document model to view |
9 | | - * @param {ve.es.Surface} surfaceView Surface view this view is a child of |
| 9 | + * @param {ve.ce.Surface} surfaceView Surface view this view is a child of |
10 | 10 | */ |
11 | | -ve.es.DocumentNode = function( model, surfaceView ) { |
| 11 | +ve.ce.DocumentNode = function( model, surfaceView ) { |
12 | 12 | // Inheritance |
13 | | - ve.es.BranchNode.call( this, model ); |
| 13 | + ve.ce.BranchNode.call( this, model ); |
14 | 14 | |
15 | 15 | // Properties |
16 | 16 | this.surfaceView = surfaceView; |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | * 'children': false |
49 | 49 | * } |
50 | 50 | */ |
51 | | -ve.es.DocumentNode.splitRules = {}; |
| 51 | +ve.ce.DocumentNode.splitRules = {}; |
52 | 52 | |
53 | 53 | /* Methods */ |
54 | 54 | |
— | — | @@ -58,16 +58,16 @@ |
59 | 59 | * @param e {Event} Event to create ve.Position from |
60 | 60 | * @returns {Integer} Document offset |
61 | 61 | */ |
62 | | -ve.es.DocumentNode.prototype.getOffsetFromEvent = function( e ) { |
| 62 | +ve.ce.DocumentNode.prototype.getOffsetFromEvent = function( e ) { |
63 | 63 | var position = ve.Position.newFromEventPagePosition( e ); |
64 | 64 | return this.getOffsetFromRenderedPosition( position ); |
65 | 65 | }; |
66 | 66 | |
67 | | -ve.es.DocumentNode.splitRules.document = { |
| 67 | +ve.ce.DocumentNode.splitRules.document = { |
68 | 68 | 'self': false, |
69 | 69 | 'children': true |
70 | 70 | }; |
71 | 71 | |
72 | 72 | /* Inheritance */ |
73 | 73 | |
74 | | -ve.extendClass( ve.es.DocumentNode, ve.es.BranchNode ); |
| 74 | +ve.extendClass( ve.ce.DocumentNode, ve.ce.BranchNode ); |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.js |
— | — | @@ -3,11 +3,11 @@ |
4 | 4 | * |
5 | 5 | * All classes and functions will be attached to this object to keep the global namespace clean. |
6 | 6 | */ |
7 | | -ve.es = { |
| 7 | +ve.ce = { |
8 | 8 | |
9 | 9 | }; |
10 | 10 | |
11 | | -ve.es.getDOMText = function( elem ) { |
| 11 | +ve.ce.getDOMText = function( elem ) { |
12 | 12 | var nodeType = elem.nodeType, |
13 | 13 | ret = ''; |
14 | 14 | |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | } else { |
23 | 23 | // Traverse it's children |
24 | 24 | for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { |
25 | | - ret += ve.es.getDOMText( elem ); |
| 25 | + ret += ve.ce.getDOMText( elem ); |
26 | 26 | } |
27 | 27 | } |
28 | 28 | } else if ( nodeType === 3 || nodeType === 4 ) { |
Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.BranchNode.js |
— | — | @@ -1,18 +1,18 @@ |
2 | 2 | /**
|
3 | | - * Creates an ve.es.BranchNode object.
|
| 3 | + * Creates an ve.ce.BranchNode object.
|
4 | 4 | *
|
5 | 5 | * @class
|
6 | 6 | * @abstract
|
7 | 7 | * @constructor
|
8 | 8 | * @extends {ve.BranchNode}
|
9 | | - * @extends {ve.es.Node}
|
| 9 | + * @extends {ve.ce.Node}
|
10 | 10 | * @param model {ve.ModelNode} Model to observe
|
11 | 11 | * @param {jQuery} [$element] Element to use as a container
|
12 | 12 | */
|
13 | | -ve.es.BranchNode = function( model, $element, horizontal ) {
|
| 13 | +ve.ce.BranchNode = function( model, $element, horizontal ) {
|
14 | 14 | // Inheritance
|
15 | 15 | ve.BranchNode.call( this );
|
16 | | - ve.es.Node.call( this, model, $element );
|
| 16 | + ve.ce.Node.call( this, model, $element );
|
17 | 17 |
|
18 | 18 | // Properties
|
19 | 19 | this.horizontal = horizontal || false;
|
— | — | @@ -39,7 +39,7 @@ |
40 | 40 |
|
41 | 41 | /* Methods */
|
42 | 42 |
|
43 | | -ve.es.BranchNode.prototype.onAfterPush = function( childModel ) {
|
| 43 | +ve.ce.BranchNode.prototype.onAfterPush = function( childModel ) {
|
44 | 44 | var childView = childModel.createView();
|
45 | 45 | this.emit( 'beforePush', childView );
|
46 | 46 | childView.attach( this );
|
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | this.emit( 'update' );
|
59 | 59 | };
|
60 | 60 |
|
61 | | -ve.es.BranchNode.prototype.onAfterUnshift = function( childModel ) {
|
| 61 | +ve.ce.BranchNode.prototype.onAfterUnshift = function( childModel ) {
|
62 | 62 | var childView = childModel.createView();
|
63 | 63 | this.emit( 'beforeUnshift', childView );
|
64 | 64 | childView.attach( this );
|
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | this.emit( 'update' );
|
72 | 72 | };
|
73 | 73 |
|
74 | | -ve.es.BranchNode.prototype.onAfterPop = function() {
|
| 74 | +ve.ce.BranchNode.prototype.onAfterPop = function() {
|
75 | 75 | this.emit( 'beforePop' );
|
76 | 76 | // Update children
|
77 | 77 | var childView = this.children.pop();
|
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | this.emit( 'update' );
|
84 | 84 | };
|
85 | 85 |
|
86 | | -ve.es.BranchNode.prototype.onAfterShift = function() {
|
| 86 | +ve.ce.BranchNode.prototype.onAfterShift = function() {
|
87 | 87 | this.emit( 'beforeShift' );
|
88 | 88 | // Update children
|
89 | 89 | var childView = this.children.shift();
|
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | this.emit( 'update' );
|
96 | 96 | };
|
97 | 97 |
|
98 | | -ve.es.BranchNode.prototype.onAfterSplice = function( index, howmany ) {
|
| 98 | +ve.ce.BranchNode.prototype.onAfterSplice = function( index, howmany ) {
|
99 | 99 | var i,
|
100 | 100 | length,
|
101 | 101 | args = Array.prototype.slice.call( arguments, 0 );
|
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | this.emit( 'update' );
|
139 | 139 | };
|
140 | 140 |
|
141 | | -ve.es.BranchNode.prototype.onAfterSort = function() {
|
| 141 | +ve.ce.BranchNode.prototype.onAfterSort = function() {
|
142 | 142 | this.emit( 'beforeSort' );
|
143 | 143 | var childModels = this.model.getChildren();
|
144 | 144 | for ( var i = 0; i < childModels.length; i++ ) {
|
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | this.renderContent();
|
159 | 159 | };
|
160 | 160 |
|
161 | | -ve.es.BranchNode.prototype.onAfterReverse = function() {
|
| 161 | +ve.ce.BranchNode.prototype.onAfterReverse = function() {
|
162 | 162 | this.emit( 'beforeReverse' );
|
163 | 163 | // Update children
|
164 | 164 | this.reverse();
|
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | *
|
177 | 177 | * @method
|
178 | 178 | */
|
179 | | -ve.es.BranchNode.prototype.renderContent = function() {
|
| 179 | +ve.ce.BranchNode.prototype.renderContent = function() {
|
180 | 180 | for ( var i = 0; i < this.children.length; i++ ) {
|
181 | 181 | this.children[i].renderContent();
|
182 | 182 | }
|
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | * @method
|
189 | 189 | * @param {ve.Range} range Range of content to draw selection around
|
190 | 190 | */
|
191 | | -ve.es.BranchNode.prototype.drawSelection = function( range ) {
|
| 191 | +ve.ce.BranchNode.prototype.drawSelection = function( range ) {
|
192 | 192 | var selectedNodes = this.selectNodes( range, true );
|
193 | 193 | for ( var i = 0; i < this.children.length; i++ ) {
|
194 | 194 | if ( selectedNodes.length && this.children[i] === selectedNodes[0].node ) {
|
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | *
|
208 | 208 | * @method
|
209 | 209 | */
|
210 | | -ve.es.BranchNode.prototype.clearSelection = function() {
|
| 210 | +ve.ce.BranchNode.prototype.clearSelection = function() {
|
211 | 211 | for ( var i = 0; i < this.children.length; i++ ) {
|
212 | 212 | this.children[i].clearSelection();
|
213 | 213 | }
|
— | — | @@ -219,7 +219,7 @@ |
220 | 220 | * @param {ve.Position} position Position to get offset for
|
221 | 221 | * @returns {Integer} Offset of position
|
222 | 222 | */
|
223 | | -ve.es.BranchNode.prototype.getOffsetFromRenderedPosition = function( position ) {
|
| 223 | +ve.ce.BranchNode.prototype.getOffsetFromRenderedPosition = function( position ) {
|
224 | 224 | if ( this.children.length === 0 ) {
|
225 | 225 | return 0;
|
226 | 226 | }
|
— | — | @@ -243,7 +243,7 @@ |
244 | 244 | * @param {Integer} offset Offset to get position for
|
245 | 245 | * @returns {ve.Position} Position of offset
|
246 | 246 | */
|
247 | | -ve.es.BranchNode.prototype.getRenderedPositionFromOffset = function( offset, leftBias ) {
|
| 247 | +ve.ce.BranchNode.prototype.getRenderedPositionFromOffset = function( offset, leftBias ) {
|
248 | 248 | var node = this.getNodeFromOffset( offset, true );
|
249 | 249 | if ( node !== null ) {
|
250 | 250 | return node.getRenderedPositionFromOffset(
|
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | return null;
|
256 | 256 | };
|
257 | 257 |
|
258 | | -ve.es.BranchNode.prototype.getRenderedLineRangeFromOffset = function( offset ) {
|
| 258 | +ve.ce.BranchNode.prototype.getRenderedLineRangeFromOffset = function( offset ) {
|
259 | 259 | var node = this.getNodeFromOffset( offset, true );
|
260 | 260 | if ( node !== null ) {
|
261 | 261 | var nodeOffset = this.getOffsetFromNode( node, true );
|
— | — | @@ -268,5 +268,5 @@ |
269 | 269 |
|
270 | 270 | /* Inheritance */
|
271 | 271 |
|
272 | | -ve.extendClass( ve.es.BranchNode, ve.BranchNode );
|
273 | | -ve.extendClass( ve.es.BranchNode, ve.es.Node );
|
| 272 | +ve.extendClass( ve.ce.BranchNode, ve.BranchNode );
|
| 273 | +ve.extendClass( ve.ce.BranchNode, ve.ce.Node );
|