On 23/05/12 19:16, Daniel Werner 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.
No. You shouldn't need to know that HTMLMultiSelectField2 is a MultiSelect but HTMLMultiSelectField uses checkboxes. Your useCheckboxes looks good. I recommend you to make it a tri-state value, so you could force checkboxes, select or let it decide (eg. checkboxes for < 100 elements, select for more) _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
