Revision 1e
Tested with Mozilla 1.7.12, Firefox 1.5, Opera 9, Konq, and IE 6. Not yet tried with Safari. Will work fine in old browsers. Need to test marginals (those with annoyingly sporadic DOM support that claim they work but don’t)
A demo with it working in the Trac Ticket page, and the Query page.
How to use it:
- Download componentselect.js
- Include the file in the Trac page(s), via a
<script type="text/javascript" src="componentselect.js"></script>, or copy&paste the code at the bottom of trac.js
- Add
#properties select.haikucomponent { width: 10em; float: left; clear: left; } to the css file
- Patch chrome/common/js/query.js with
--- query.js.1 2006-03-14 10:12:19.000000000 +0000
+++ query.js 2006-06-16 14:03:25.000000000 +0100
@@ -229,6 +229,9 @@
td.appendChild(element);
element.focus();
tr.appendChild(td);
+ if (property.type == "select" && property.label == "Component" ) {
+ reduceComponents( element );
+ }
}
// Add the add and remove buttons
Changes
- Version 1a
- Initial release.
- Version 1b
- Fixed <select>s that don’t contain an initial “null” selection, so we add the first sub component <select> now too.
- Version 1c
- D’oh. Fixed change 1b for cases when <select> doesn’t have a choice selected. We now tell the browser to pick the first item.
- Version 1d
- I found a problem while playing with Trac [ my, isn't testing good fun? :) ] In the case that a component has already been selected, we add all the dropdowns for that range of subchoices, so drivers/graphics/nvidia adds three <select>s. However, with playing around with browsers, onchange doesn't fire if you click an item that is already selected. So we need to add '' as an option to default to to allow users to select the top most choice and have an update. (Forgot to mention, it also fixes the flaw with '' entries and adds sorting so we dont get duplicate entries) Feedback via email
- Version 1e
- Query requires a new revision, and here it is. Needs testing.
- Sadly it's not as drop-in friendly as the previous, you have to follow an extra step above
- Fixed wkornew's suggestion about not having '' entries, and automagically expanding to leafs
- Reworked the system to be query-friendly (didnt understand multiple component selectors before)
- Writing a clean hook system should be up to the Trac devs, this is just an easy (and acceptable 'hack')
- Fixed the same bug repaired in rev1c, grr, Konq
- Version 1f
- New Features!
- Added support for selecting partial components according to a request