Adding jsColor picker as jForm Field type?

156 views
Skip to first unread message

Feldon

unread,
Mar 13, 2011, 7:06:17 PM3/13/11
to Joomla! CMS Development
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.

Matt Thomas

unread,
Mar 13, 2011, 7:13:49 PM3/13/11
to joomla-...@googlegroups.com
Hi Feldon,

You might want to take a look at the Minima template for Joomla! 1.6  ( http://minimatemplate.com/ ), which has a nicely implemented color picker.

Best,

Matt Thomas
betweenbrain | Construct Unified Template Framework for Joomla! 1.5, 1.6, Molajo and Nooku Server




--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.


elin

unread,
Mar 14, 2011, 9:22:22 AM3/14/11
to joomla-...@googlegroups.com
I think it would be a great feature to add for 1.7--if you want to work on that put a note in the feature tracker.

 I did also see a "tool" in the JED the other day for adding a color picker field. I don't know if that team is interested in contributing to the core, though it might be worth asking if they would like to team up with you

Elin
Reply all
Reply to author
Forward
0 new messages