Hi Robert,
Really a lot of thanks for the reply, its a complex system and all help is
really appreciated.
I had also grabbed every single plugin from the REL1_35, and checked them.
Most seem to inherit from ve.ui/ce/dm.MWExtensionXXX
Looking at how the {{SomeReferenmnce}} transclusion works I noticed that
"Parser functions" also exist as {{#SomeParserFunction}}, and for the
VisualEditor they both result in a mwTransclusion model element.
For parser functions I guessed that ve.dm.MWTransclusion* would be the right
inheritance class for someone trying to extend the VisualEditor. To stop my
extension matching everything I added a matchTagNames, and a matchFunction to
narrow things down.
So now I get correct model output in the VE debug view. mwTransclusion for
regular templates, and for ONLY my parser function I get the mwMyParserFunction
for example.
However the on-focus the ContextItem routines appears to find two menu items,
transclusion AND my plugin.
This appears because the DEFAULT transclusion ContextItem inherits from
ve.dm.MWTransclusion and so the "ContextRegistryCandidate.isCompatibleWith(
model )" results in a true for transclusion and anything inheriting from it.
Much like for <tag/> extensions, shouldnt VisualEditor also offer a
ve.dm.MWTransclusionExtension type?
Am I approaching this the wrong way, I am quite confused now how to handle this
case correctly.
Cheers,Luc
Date: Wed, 25 Nov 2020 08:50:19 +0000
From: Robert Vogel <[email protected]>
To: For developers discussing technical aspects and organization of
Wikimedia projects <[email protected]>
Subject: Re: [Wikitech-l] VisualEditor inheriting from TransclusionNode in
parser function extension?Message-ID:
<am0pr08mb446861fe8e6a6b2589c66942ae...@am0pr08mb4468.eurprd08.prod.outlook.com>
Content-Type: text/plain; charset="utf-8"
Hi Luc!
>From my expierience inheritance of dialogs is rather hard to do and also
>probably not meant to be done.
In the end it might be easier to actually implement a standalone dialog.
If you are interested in ways to modify existing dialogs and adding stuff to
VisualEditor in general, you may want to have a look at the
BlueSpiceVisualEditorConnector extension [1-5].
[1]
https://github.com/wikimedia/mediawiki-extensions-BlueSpiceVisualEditorConnector/tree/3.1.12/resources
[2]
https://github.com/wikimedia/mediawiki-extensions-BlueSpiceVisualEditorConnector/tree/3.1.12/resources/bs.vec/ui
[3]
https://github.com/wikimedia/mediawiki-extensions-BlueSpiceVisualEditorConnector/blob/3.1.12/resources/bluespice.visualEditorConnector.overrides.js
[4]
https://github.com/wikimedia/mediawiki-extensions-BlueSpiceVisualEditorConnector/blob/3.1.12/resources/bluespice.visualEditorConnector.styleInspector.js
[5]
https://github.com/wikimedia/mediawiki-extensions-BlueSpiceVisualEditorConnector/blob/3.1.12/resources/bluespice.visualEditorConnector.tags.js
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l