On Thu, Aug 5, 2010 at 07:04, Daniel Friesen <lists(a)nadir-seen-fire.com> wrote:
1) I use the
EditPageBeforeEditChecks hook to add a checkbox to
disable MeanEditor. However, I also need to set it to the correct
value. Right now, I am overriding the entire showStandardInputs
function just to change line 1749 (referring to
http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_16/phase3/includes/…).
Am I missing an obvious solution here?
You talking about the $checked values passed by showStandardInputs? I
think that was probably just there for legacy or to cleanly separate
values from that method, I can't remember. But all getCheckboxes uses
that for is passing booleans, can't you just supply the checkbox value
directly in your hook?
Yes, it works. I was trying to replicate the functionality of the
minoredit checkbox (read from preference the first time, keeps the
user-selected value after that), so I was only looking at that. I now
set the initial value during importFormData, that's probably the right
place to do so.
2) I would
like to disable the default toolbar when the visual editor
is in use. In the past, I used to override the entire showEditForm
method and reset the $toolbar variable. How can I accomplish this now?
Ouch, it would have been nicer for you if getEditToolbar was not static.
And perhaps also if the two "should I show the toolbar" tests were
broken into another instance method.
I think you might be able to use EditPageBeforeEditToolbar to erase the
toolbar though.
It works, thanks for the suggestion.
3) I need to
add the 'wymupdate' class to the standard buttons
(submit, preview, diff, etc.). Is there a clean way to do this without
overriding the entire getEditButtons method?
Hmm, that makes me think getEditButtons would have been better to use an
assoc-array where the contents were arguments to Xml::element so it
could be overridden instead of straight html.
I can't think of a non-ugly way to do this. You could almost override
getEditButtons, call the superclass method, and for each input use a
regex to insert a class manually... though that IS ugly.
Well, for now I will just replicate the method, it's quite short and
the modification is easy.
@Platonides: the ".wymupdate" selector is hardcoded into WYMeditor. I
prefer to leave WYMeditor untouched, so that I/users can use another
version, custom plugins, etc.
Thanks for your answers
-- Jacopo