Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/211406

Change subject: [PULL THROUGH] Use new allowedTypes property in model registry
......................................................................

[PULL THROUGH] Use new allowedTypes property in model registry

For reference nodes, allow 'dc:references'.

For transclusion nodes, allow any other types.

Depends on I1ca64562e in core.

Bug: T98999
Change-Id: I7eb2b61eb9336792535e9fd6d5a8dd2d57065f04
---
M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
D modules/ve-mw/dm/ve.dm.MW.js
3 files changed, 6 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/06/211406/1

diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
index e7de412..aa60520 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
@@ -44,6 +44,8 @@
 
 ve.dm.MWReferenceNode.static.matchRdfaTypes = [ 'mw:Extension/ref' ];
 
+ve.dm.MWReferenceNode.static.allowedRdfaTypes = [ 'dc:references' ];
+
 ve.dm.MWReferenceNode.static.isContent = true;
 
 ve.dm.MWReferenceNode.static.blacklistedAnnotationTypes = [ 'link' ];
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
index f4e18bd..f48bfcd 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
@@ -46,18 +46,11 @@
 
 ve.dm.MWTransclusionNode.static.matchTagNames = null;
 
-ve.dm.MWTransclusionNode.static.matchRdfaTypes = [
-       'mw:Transclusion',
-       // We're interested in all nodes that have mw:Transclusion, even if 
they also have other mw:
-       // types. So we match all mw: types, then use a matchFunction to assert 
that mw:Transclusion
-       // is in there.
-       /^mw:/
-];
+ve.dm.MWTransclusionNode.static.matchRdfaTypes = [ 'mw:Transclusion' ];
 
-ve.dm.MWTransclusionNode.static.matchFunction = function ( domElement ) {
-       var types = ( domElement.getAttribute( 'typeof' ) || '' ).split( ' ' );
-       return types.indexOf( 'mw:Transclusion' ) !== -1;
-};
+// Transclusion nodes can contain other types, e.g. mw:PageProp/Category.
+// Allow all other types (null) so they match to this node.
+ve.dm.MWTransclusionNode.static.allowedRdfaTypes = null;
 
 ve.dm.MWTransclusionNode.static.enableAboutGrouping = true;
 
diff --git a/modules/ve-mw/dm/ve.dm.MW.js b/modules/ve-mw/dm/ve.dm.MW.js
deleted file mode 100644
index ced1d9d..0000000
--- a/modules/ve-mw/dm/ve.dm.MW.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * VisualEditor DataModel MediaWiki configuration.
- *
- * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
- */
-
-ve.dm.modelRegistry.registerExtensionSpecificType( /^mw:/ );

-- 
To view, visit https://gerrit.wikimedia.org/r/211406
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7eb2b61eb9336792535e9fd6d5a8dd2d57065f04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to