I think adding a new jForm field type called "color", which is
integrated with the jsColor picker (
http://jscolor.com) could enhance
template administration. Essentially, by declaring a form field as
"color", the user would be presented with a jsColor picker instead of
a simple text box in which to input a hex value.
What do people think of this idea in general?
I've done an extremely rough first pass, available here:
http://chris.paing.com/jscolor_joomla.zip
The files consist of:
- color.php, a new jForm field file (to be stored in /libraries/joomla/
form/fields/)
- jscolor.js, the identical file from the jscolor project, with only
one hack - the "dir" variable has been set
- images, the identical files from the jscolor project
Issues:
- Not sure how to correctly declare the jscolor.js javascript. At the
moment its hacked into the color.php file, but presumably there's some
way to add it once to the Joomla! headers.
- Not sure how to declare the directory path for the images in
jscolor.js properly? It may be necessary to hack jscolor.js further
to allow the "dir" variable to be set from color.php directly.
However, I was striving to avoid editing jscolor.js at all. It would
make it easy to apply updates from the original source if the updated
files simply had to be dropped in place.
About me: I've developed a couple templates and modules, but never
touched core files.