Topic on VisualEditor/Feedback

Allow formatting in TextInputWidget?

9
195.200.254.142 (talkcontribs)

Is it somehow possible to allow text formatting / adding links/tables to some kind of TextInputWidget in the MediaWiki VisualEditor? For example in the WhitespacePreservingTextInputWidget?

Or maybe there's some other class I could use for that?

Whatamidoing (WMF) (talkcontribs)
ESanders (WMF) (talkcontribs)

You'd need a TargetWidget, which is what we use in the image dialog.

195.200.254.142 (talkcontribs)

@ESanders (WMF) thanks for the answer! I guess the version of VE I have is outdated as it doesn't contain the TargetWidget class, but I got it from the documentation site.

Is there any chance you could link me an example of the usage of this Widget (e.g. the image dialog you mentioned)? I sadly couldn't find one and trying to use it as the other Widgets I use doesn't work.

195.200.254.142 (talkcontribs)

After some more trying-to-get-it-done I think I can narrow my problem down: I need to pass a new Document to the TargetWidget which has no content yet but can be modified. Maybe someone could tell me how to create such a Document (i.e. which parameters to pass to which of the Document - constructors)?

Jskurat (talkcontribs)

Bump

ESanders (WMF) (talkcontribs)

I'd have a look at the Media or Reference dialog code as reference implementations of this.

ESanders (WMF) (talkcontribs)
Jskurat (talkcontribs)

Thank you, that looks promising. I'll dig into it.