I've been away from OOUI/VisualEditor codebase for some time and I'm
hitting my head against a wall trying to get anywhere with what seems
like a small task.
Firstly I'm having issues getting citations working at all on my
vagrant instance -
http://imgur.com/WZmEWXj is how they look when I load VE
despite looking like http://imgur.com/dGA3sLw before I hit edit.
(I gave up trying to develop this on my local instance)
That aside, I figured I could easily add a 'reference' command to the
bottom of the menu that would load the ReferencesDialog which contains
the 'use existing reference' button.
I figured it would be good to make this button open the ReferenceDialog
and then explore a way of refactoring that so that 'use existing reference'
could be used outside it or at the very least a reference dialogue could
be opened and straight away switched to use existing reference.
With this quest defined, I went into the code to work out how to do this.
I looked at ve.ui.MWReferenceDialog.js and got the command name
'reference' and added it to the list like so:
'include': [ { 'group': 'cite' }, 'reference' ]
Magically a button appeared so i got excited and clicked it, hoping I
would see a reference dialog of some kind.
Sadly this caused things to explode, and I'm unable to debug this in
any coherent fashion to work this out.
I've now been stuck for the past 2 hours and since I'm on GMT hours
I've been unable to find help on irc. I'm turning to you guys to work
out how I can take this further or if I'm going down the wrong rabbit
hole.
Help needed.
I see Juliusz is on IRC so I'm hoping he'll be able to help.