From 6b7d62e4a400a22cb16a1d522000ba05bd79440e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Inez=20Korczyn=CC=81ski?= Date: Wed, 24 Apr 2013 16:46:34 -0700 Subject: [PATCH] Rename MWImageNode to MWInlineImageNode (get ready for adding MWBlockImageNode soon) Change-Id: I617e2a17cb6fbd11e486c2981e361ae931ac1870 --- VisualEditor.php | 4 ++-- demos/ve/index.php | 4 ++-- ...mageNode.js => ve.ce.MWInlineImageNode.js} | 12 +++++------ ...mageNode.js => ve.dm.MWInlineImageNode.js} | 20 +++++++++---------- modules/ve/test/dm/ve.dm.example.js | 8 ++++---- modules/ve/test/index.php | 4 ++-- modules/ve/ui/dialogs/ve.ui.MediaDialog.js | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) rename modules/ve/ce/nodes/{ve.ce.MWImageNode.js => ve.ce.MWInlineImageNode.js} (66%) rename modules/ve/dm/nodes/{ve.dm.MWImageNode.js => ve.dm.MWInlineImageNode.js} (74%) diff --git a/VisualEditor.php b/VisualEditor.php index 2b5e928419..b30756b8ab 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -490,10 +490,10 @@ $wgResourceModules += array( ), 'ext.visualEditor.experimental' => $wgVisualEditorResourceTemplate + array( 'scripts' => array( - 've/dm/nodes/ve.dm.MWImageNode.js', + 've/dm/nodes/ve.dm.MWInlineImageNode.js', 've/dm/nodes/ve.dm.MWTemplateNode.js', - 've/ce/nodes/ve.ce.MWImageNode.js', + 've/ce/nodes/ve.ce.MWInlineImageNode.js', 've/ce/nodes/ve.ce.MWTemplateNode.js', ), 'dependencies' => array( diff --git a/demos/ve/index.php b/demos/ve/index.php index b7c1e86c66..712a94be6f 100644 --- a/demos/ve/index.php +++ b/demos/ve/index.php @@ -162,7 +162,7 @@ $html = file_get_contents( $page ); - + @@ -213,7 +213,7 @@ $html = file_get_contents( $page ); - + diff --git a/modules/ve/ce/nodes/ve.ce.MWImageNode.js b/modules/ve/ce/nodes/ve.ce.MWInlineImageNode.js similarity index 66% rename from modules/ve/ce/nodes/ve.ce.MWImageNode.js rename to modules/ve/ce/nodes/ve.ce.MWInlineImageNode.js index 0e77b76f92..17675bea7e 100644 --- a/modules/ve/ce/nodes/ve.ce.MWImageNode.js +++ b/modules/ve/ce/nodes/ve.ce.MWInlineImageNode.js @@ -11,9 +11,9 @@ * @class * @extends ve.ce.ImageNode * @constructor - * @param {ve.dm.MWImageNode} model Model to observe + * @param {ve.dm.MWInlineImageNode} model Model to observe */ - ve.ce.MWImageNode = function VeCeMWImageNode( model ) { + ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode( model ) { // Parent constructor ve.ce.ImageNode.call( this, model ); @@ -23,7 +23,7 @@ // Initialization this.$ .attr( 'contenteditable', false ) - .addClass( 've-ce-mwImageNode' ) + .addClass( 've-ce-mwInlineImageNode' ) .append( this.$image ) .data( 'view', this.$image.data( 'view' ) ); this.onUpdate(); @@ -31,14 +31,14 @@ /* Inheritance */ -ve.inheritClass( ve.ce.MWImageNode, ve.ce.ImageNode ); +ve.inheritClass( ve.ce.MWInlineImageNode, ve.ce.ImageNode ); /* Static Properties */ -ve.ce.MWImageNode.static.name = 'MWimage'; +ve.ce.MWInlineImageNode.static.name = 'MWinlineimage'; /* Methods */ /* Registration */ -ve.ce.nodeFactory.register( ve.ce.MWImageNode ); +ve.ce.nodeFactory.register( ve.ce.MWInlineImageNode ); diff --git a/modules/ve/dm/nodes/ve.dm.MWImageNode.js b/modules/ve/dm/nodes/ve.dm.MWInlineImageNode.js similarity index 74% rename from modules/ve/dm/nodes/ve.dm.MWImageNode.js rename to modules/ve/dm/nodes/ve.dm.MWInlineImageNode.js index c72b25ccc1..873e8f3845 100644 --- a/modules/ve/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve/dm/nodes/ve.dm.MWInlineImageNode.js @@ -14,26 +14,26 @@ * @param {number} [length] Length of content data in document * @param {Object} [element] Reference to element in linear model */ -ve.dm.MWImageNode = function VeDmMWImageNode( length, element ) { +ve.dm.MWInlineImageNode = function VeDmMWInlineImageNode( length, element ) { ve.dm.ImageNode.call( this, 0, element ); }; /* Inheritance */ -ve.inheritClass( ve.dm.MWImageNode, ve.dm.ImageNode ); +ve.inheritClass( ve.dm.MWInlineImageNode, ve.dm.ImageNode ); /* Static Properties */ -ve.dm.MWImageNode.static.name = 'MWimage'; +ve.dm.MWInlineImageNode.static.name = 'MWinlineimage'; -ve.dm.MWImageNode.static.matchTagNames = null; +ve.dm.MWInlineImageNode.static.matchTagNames = null; // TODO: Develop better method to test for generated content -ve.dm.MWImageNode.static.generatedContent = true; +ve.dm.MWInlineImageNode.static.generatedContent = true; -ve.dm.MWImageNode.static.matchRdfaTypes = [ 'mw:Image' ]; +ve.dm.MWInlineImageNode.static.matchRdfaTypes = [ 'mw:Image' ]; -ve.dm.MWImageNode.static.toDataElement = function ( domElements ) { +ve.dm.MWInlineImageNode.static.toDataElement = function ( domElements ) { var i, j, childNode, children = Array.prototype.slice.call( domElements[0].children, 0 ), parentResult = ve.dm.ImageNode.static.toDataElement.apply( this, [ children ].concat( Array.prototype.slice.call( arguments, 1 ) ) @@ -50,14 +50,14 @@ ve.dm.MWImageNode.static.toDataElement = function ( domElements ) { } return ve.extendObject( true, dataElement, { - 'type': 'MWimage', + 'type': 'MWinlineimage', 'attributes': { 'isLinked': domElements[0].nodeName.toLowerCase() === 'a' } } ); }; -ve.dm.MWImageNode.static.toDomElements = function ( dataElement, doc ) { +ve.dm.MWInlineImageNode.static.toDomElements = function ( dataElement, doc ) { var k, wrapper = doc.createElement( dataElement.attributes.isLinked ? 'a' : 'span' ), imageDomElement = ve.dm.ImageNode.static.toDomElements.apply( this, arguments )[0]; @@ -74,4 +74,4 @@ ve.dm.MWImageNode.static.toDomElements = function ( dataElement, doc ) { /* Registration */ -ve.dm.modelRegistry.register( ve.dm.MWImageNode ); +ve.dm.modelRegistry.register( ve.dm.MWInlineImageNode ); diff --git a/modules/ve/test/dm/ve.dm.example.js b/modules/ve/test/dm/ve.dm.example.js index 3584967537..2caeddfb2e 100644 --- a/modules/ve/test/dm/ve.dm.example.js +++ b/modules/ve/test/dm/ve.dm.example.js @@ -735,7 +735,7 @@ ve.dm.example.conversions = { } }; -ve.dm.example.MWImageHtml = 'Wiki.png'; +ve.dm.example.MWInlineImageHtml = 'Wiki.png'; ve.dm.example.MWTemplate = { 'blockSpan': '', 'blockSpanModified': '', @@ -842,11 +842,11 @@ ve.dm.example.domToDataCases = { ] }, 'mw:Image': { - 'html': '

' + ve.dm.example.MWImageHtml + '

', + 'html': '

' + ve.dm.example.MWInlineImageHtml + '

', 'data': [ { 'type': 'paragraph' }, { - 'type': 'MWimage', + 'type': 'MWinlineimage', 'attributes': { 'html/0-0/alt': 'Wiki.png', 'html/0-0/height': '', @@ -861,7 +861,7 @@ ve.dm.example.domToDataCases = { 'isLinked': true } }, - { 'type': '/MWimage' }, + { 'type': '/MWinlineimage' }, { 'type': '/paragraph' } ] }, diff --git a/modules/ve/test/index.php b/modules/ve/test/index.php index 273b863e05..84eb40b00f 100644 --- a/modules/ve/test/index.php +++ b/modules/ve/test/index.php @@ -105,7 +105,7 @@ - + @@ -156,7 +156,7 @@ - + diff --git a/modules/ve/ui/dialogs/ve.ui.MediaDialog.js b/modules/ve/ui/dialogs/ve.ui.MediaDialog.js index 7482f5789c..b3dedd9af7 100644 --- a/modules/ve/ui/dialogs/ve.ui.MediaDialog.js +++ b/modules/ve/ui/dialogs/ve.ui.MediaDialog.js @@ -30,7 +30,7 @@ ve.ui.MediaDialog.static.titleMessage = 'visualeditor-dialog-media-title'; ve.ui.MediaDialog.static.icon = 'picture'; -ve.ui.MediaDialog.static.modelClasses = [ ve.dm.MWImageNode ]; +ve.ui.MediaDialog.static.modelClasses = [ ve.dm.MWInlineImageNode ]; /* Registration */