Hello,
[Sorry If you got this already from the same list; I had some trouble
with the server and the message did not appear in the archive. So here
my 2nd trail :-) ]
I'd like to use custom dialogs and buttons in the WikiEditor
(
https://www.mediawiki.org/wiki/Extension:WikiEditor).
I managed to get my own dialogs running, but I have some trouble. Most
annoying is that often I am unable to call any dialog (my custom ones
and the ones that the editor has already for links and images). I
suspect that is has something to do with the order in which resources
are loaded; the only visible correlation so far is that if my custom
button is on the last position in its section all dialogs are not
working the order changes sometimes after reload).
Thats what I did: (on MediaWiki 1.20.5, Vector Skin)
- enabled the javascript debug mode in the local settings:
$wgResourceLoaderDebug = true;
- the javascript I use for the customization is currently in
Mediawiki:Common.js (but should move to a skin specific js probably)
- use the customizeToolbar-function from the WikiEditor-toolbar
customization page (
http://bit.ly/xPH8Gl)
- adding the button to the toolbar using:
$('#wpTextbox1').wikiEditor( 'addToToolbar', {…'tools':{mytool:{…
'action:{
'type':'dialog','module':'mytool' …}}}}
(but better see the code here:
http://jsfiddle.net/FApr9/)
- adding the actual dialog module to
"$.wikiEditor.modules.dialogs.modules" using
"$.wikiEditor.modules.dialogs.modules['mytool'] = {…}" (again,
http://jsfiddle.net/FApr9/)
If anybody could give me advice in how the reliably integrate a custom
dialog in the mediawiki toolbar I would be thankful.
Kind Regards,
Jan
PS.: Less problematic, though interesting too: does anybody know how to
create a link-like text instead of a button?
PPS.: I'm new at the list, so if the question does not belong here, feel
free to point me at a more suitable place.