Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/107537
Change subject: [WIP] Ultra-basic gallery editing
......................................................................
[WIP] Ultra-basic gallery editing
'Cos Erik doesn't like things he can't edit.
Change-Id: I1d9fb1215bb16b1245eddd87c977fb5bfdee4da9
---
M VisualEditor.php
M bin/msgs-ve-mw
A modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js
A modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js
M modules/ve-mw/i18n/en.json
M modules/ve-mw/i18n/qqq.json
M modules/ve-mw/init/ve.init.mw.Target.js
A modules/ve-mw/ui/inspectors/ve.ui.MWGalleryInspector.js
M modules/ve-mw/ui/styles/ve.ui.Icons-raster.css
M modules/ve-mw/ui/styles/ve.ui.Icons-vector.css
A modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js
11 files changed, 179 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/37/107537/1
diff --git a/VisualEditor.php b/VisualEditor.php
index 26d0ab8..5234671 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -797,6 +797,22 @@
'targets' => array( 'desktop', 'mobile' ),
),
+ 'ext.visualEditor.mwgallery' => $wgVisualEditorResourceTemplate + array(
+ 'scripts' => array(
+ 'modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js',
+ 'modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js',
+
'modules/ve-mw/ui/inspectors/ve.ui.MWGalleryInspector.js',
+
'modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js',
+ ),
+ 'dependencies' => array(
+ 'ext.visualEditor.mwcore',
+ ),
+ 'messages' => array(
+ 'visualeditor-mwgalleryinspector-title',
+ ),
+ 'targets' => array( 'desktop', 'mobile' ),
+ ),
+
'ext.visualEditor.mwhiero' => $wgVisualEditorResourceTemplate + array(
'scripts' => array(
'modules/ve-mw/dm/nodes/ve.dm.MWHieroNode.js',
diff --git a/bin/msgs-ve-mw b/bin/msgs-ve-mw
index dd6cef8..d86551c 100644
--- a/bin/msgs-ve-mw
+++ b/bin/msgs-ve-mw
@@ -88,6 +88,7 @@
visualeditor-mwalienextensioninspector-title
visualeditor-mweditmodesource-title
visualeditor-mweditmodesource-warning
+visualeditor-mwgalleryinspector-title
visualeditor-mwhieroinspector-title
visualeditor-mwmathinspector-title
visualeditor-notification-created
diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js
b/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js
new file mode 100644
index 0000000..f7fa5cd
--- /dev/null
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWGalleryNode.js
@@ -0,0 +1,35 @@
+/*!
+ * VisualEditor ContentEditable MWGalleryNode class.
+ *
+ * @copyright 2011–2014 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * ContentEditable MediaWiki gallery node.
+ *
+ * @class
+ * @extends ve.ce.MWExtensionNode
+ *
+ * @constructor
+ * @param {ve.dm.MWGalleryNode} model Model to observe
+ * @param {Object} [config] Configuration options
+ */
+ve.ce.MWGalleryNode = function VeCeMWGalleryNode( model, config ) {
+ // Parent constructor
+ ve.ce.MWExtensionNode.call( this, model, config );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ce.MWGalleryNode, ve.ce.MWExtensionNode );
+
+/* Static Properties */
+
+ve.ce.MWGalleryNode.static.name = 'mwGallery';
+
+ve.ce.MWGalleryNode.static.tagName = 'div';
+
+/* Registration */
+
+ve.ce.nodeFactory.register( ve.ce.MWGalleryNode );
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js
b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js
new file mode 100644
index 0000000..ab1aa70
--- /dev/null
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js
@@ -0,0 +1,33 @@
+/*!
+ * VisualEditor DataModel MWGalleryNode class.
+ *
+ * @copyright 2011–2014 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * DataModel MediaWiki gallery node.
+ *
+ * @class
+ * @extends ve.dm.MWExtensionNode
+ *
+ * @constructor
+ */
+ve.dm.MWGalleryNode = function VeDmMWGalleryNode( length, element ) {
+ // Parent constructor
+ ve.dm.MWExtensionNode.call( this, 0, element );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.dm.MWGalleryNode, ve.dm.MWExtensionNode );
+
+/* Static members */
+
+ve.dm.MWGalleryNode.static.name = 'mwGallery';
+
+ve.dm.MWGalleryNode.static.extensionName = 'gallery';
+
+/* Registration */
+
+ve.dm.modelRegistry.register( ve.dm.MWGalleryNode );
diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json
index 68999d8..19a9c8e 100644
--- a/modules/ve-mw/i18n/en.json
+++ b/modules/ve-mw/i18n/en.json
@@ -114,6 +114,7 @@
"visualeditor-mwalienextensioninspector-title": "MediaWiki extension",
"visualeditor-mweditmodesource-title": "Switch to source editing",
"visualeditor-mweditmodesource-warning": "You are about to switch to
source editing.\nAny changes you've made to this document will be kept, but you
will not be able switch back to VisualEditor without saving or reloading the
page.\nDo you want to continue?",
+ "visualeditor-mwgalleryinspector-title": "Gallery",
"visualeditor-mwhieroinspector-title": "Hieroglyphics",
"visualeditor-mwmathinspector-title": "Formula",
"visualeditor-notification-created": "\"$1\" has been created.",
diff --git a/modules/ve-mw/i18n/qqq.json b/modules/ve-mw/i18n/qqq.json
index c414fed..a95ce9e 100644
--- a/modules/ve-mw/i18n/qqq.json
+++ b/modules/ve-mw/i18n/qqq.json
@@ -119,7 +119,8 @@
"visualeditor-mwalienextensioninspector-title": "Used as title for unknown
MediaWiki extensions.\n{{Identical|MediaWiki extension}}",
"visualeditor-mweditmodesource-title": "Label for changing edit mode to
source editing.",
"visualeditor-mweditmodesource-warning": "Warning message show before
changing edit mode to source editing.",
- "visualeditor-mwhieroinspector-title": "Used as title for hieroglyphics
inspector.",
+ "visualeditor-mwgalleryinspector-title": "Used as title for the gallery
inspector.",
+ "visualeditor-mwhieroinspector-title": "Used as title for the
hieroglyphics inspector.",
"visualeditor-mwmathinspector-title": "Title for the inspector to edit
\u003Cnowiki\u003E\u003Cmath\u003E\u003C/nowiki\u003E formula
blocks.\n{{Identical|Formula}}",
"visualeditor-notification-created": "Shown after a user creates a new
page. Parameters:\n* $1 - a page name",
"visualeditor-notification-restored": "Shown after a user restores a page
to a previous revision. Parameters:\n* $1 is a page name.",
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js
b/modules/ve-mw/init/ve.init.mw.Target.js
index 3afc04a..6642069 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -37,6 +37,7 @@
this.modules = [
'ext.visualEditor.mwcore',
+ 'ext.visualEditor.mwgallery',
'ext.visualEditor.data'
]
.concat(
diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWGalleryInspector.js
b/modules/ve-mw/ui/inspectors/ve.ui.MWGalleryInspector.js
new file mode 100644
index 0000000..7847c5a
--- /dev/null
+++ b/modules/ve-mw/ui/inspectors/ve.ui.MWGalleryInspector.js
@@ -0,0 +1,53 @@
+/*!
+ * VisualEditor UserInterface MWGalleryInspector class.
+ *
+ * @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * MediaWiki gallery inspector.
+ *
+ * @class
+ * @extends ve.ui.MWExtensionInspector
+ *
+ * @constructor
+ * @param {ve.ui.WindowSet} windowSet Window set this inspector is part of
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWGalleryInspector = function VeUiMWGalleryInspector( windowSet, config
) {
+ // Parent constructor
+ ve.ui.MWExtensionInspector.call( this, windowSet, config );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.MWGalleryInspector, ve.ui.MWExtensionInspector );
+
+/* Static properties */
+
+ve.ui.MWGalleryInspector.static.name = 'gallery';
+
+ve.ui.MWGalleryInspector.static.icon = 'gallery';
+
+ve.ui.MWGalleryInspector.static.titleMessage =
'visualeditor-mwgalleryinspector-title';
+
+ve.ui.MWGalleryInspector.static.nodeView = ve.ce.MWGalleryNode;
+
+ve.ui.MWGalleryInspector.static.nodeModel = ve.dm.MWGalleryNode;
+
+/* Methods */
+
+ve.ui.MWGalleryInspector.prototype.initialize = function () {
+ // Parent method
+ ve.ui.MWExtensionInspector.prototype.initialize.call( this );
+};
+
+ve.ui.MWGalleryInspector.prototype.onOpen = function () {
+ // Parent method
+ ve.ui.MWExtensionInspector.prototype.onOpen.call( this );
+};
+
+/* Registration */
+
+ve.ui.inspectorFactory.register( ve.ui.MWGalleryInspector );
diff --git a/modules/ve-mw/ui/styles/ve.ui.Icons-raster.css
b/modules/ve-mw/ui/styles/ve.ui.Icons-raster.css
index bc026dc..0384a63 100644
--- a/modules/ve-mw/ui/styles/ve.ui.Icons-raster.css
+++ b/modules/ve-mw/ui/styles/ve.ui.Icons-raster.css
@@ -10,6 +10,11 @@
background-image: url(images/icons/alienextension.png);
}
+.oo-ui-icon-gallery {
+ /* @embed */
+ background-image: url(images/icons/parameter-set.png);
+}
+
.oo-ui-icon-hiero {
/* @embed */
background-image: url(images/icons/hiero.png);
diff --git a/modules/ve-mw/ui/styles/ve.ui.Icons-vector.css
b/modules/ve-mw/ui/styles/ve.ui.Icons-vector.css
index 7b63715..9202611 100644
--- a/modules/ve-mw/ui/styles/ve.ui.Icons-vector.css
+++ b/modules/ve-mw/ui/styles/ve.ui.Icons-vector.css
@@ -10,6 +10,11 @@
background-image: url(images/icons/alienextension.svg);
}
+.oo-ui-icon-gallery {
+ /* @embed */
+ background-image: url(images/icons/parameter-set.svg);
+}
+
.oo-ui-icon-hiero {
/* @embed */
background-image: url(images/icons/hiero.svg);
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js
b/modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js
new file mode 100644
index 0000000..f16d204
--- /dev/null
+++ b/modules/ve-mw/ui/tools/ve.ui.MWGalleryInspectorTool.js
@@ -0,0 +1,27 @@
+/*!
+ * VisualEditor MediaWiki UserInterface gallery tool class.
+ *
+ * @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * MediaWiki UserInterface gallery tool.
+ *
+ * @class
+ * @extends ve.ui.InspectorTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWGalleryInspectorTool = function VeUiMWGalleryInspectorTool( toolGroup,
config ) {
+ ve.ui.InspectorTool.call( this, toolGroup, config );
+};
+OO.inheritClass( ve.ui.MWGalleryInspectorTool, ve.ui.InspectorTool );
+ve.ui.MWGalleryInspectorTool.static.name = 'gallery';
+ve.ui.MWGalleryInspectorTool.static.group = 'object';
+ve.ui.MWGalleryInspectorTool.static.icon = 'gallery';
+ve.ui.MWGalleryInspectorTool.static.titleMessage =
'visualeditor-mwgalleryinspector-title';
+ve.ui.MWGalleryInspectorTool.static.inspector = 'gallery';
+ve.ui.MWGalleryInspectorTool.static.modelClasses = [ ve.dm.MWGalleryNode ];
+ve.ui.toolFactory.register( ve.ui.MWGalleryInspectorTool );
--
To view, visit https://gerrit.wikimedia.org/r/107537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d9fb1215bb16b1245eddd87c977fb5bfdee4da9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits