On 23 May 2012 18:16, Daniel Werner daniel.werner@wikimedia.de wrote:
Right now I am implementing a new option (as part of https://bugzilla.wikimedia.org/show_bug.cgi?id=36425) for which I'd like to use a <select multiple="multiple"/> html element with options. Right now MediaWiki always generates a list of selectboxes instead of that when using the HTMLMultiSelectField class. We are talking about 280+ selectable items here, so for now we came to the conclusion that a real multi <select/> would be nicer and less space consuming for now I have already managed to implement this multiple select, modifying HTMLMultiSelectField adding a new option 'usecheckboxes' which can be set to false to disable the known behavior and use a select element instead.
This would mainly be for the JavaScript-less ui. If javascript were enabled, we could still do something nicer, for example with something like jQuery chosen plugin here.
My question would just be, how I should implement these changes preferably. Is it ok with the new option for HTMLMultiSelectField or should this be a new class inheriting from HTMLMultiSelectField? I think HTMLMultiSelectField sounds more like describing what I just implemented rather than a bunch of select boxes, but of course renaming the existing one could "break" extensions (even though both are fully compatible and interchangeable). So one option would be simply naming the new one HTMLMultiSelectField2 if we don't want to stick with an additional option here.
Cheers Daniel
There's some relevant comments and discussion in our draft style guide [1] that might be interesting/relevant.
--HM