During the code sprint at DrupalCon Boston I started an implementation of a color picker for Fivestar. So far we plan to make 6 colors available to certain sets of stars. The stars should be able to support 3 different types of color: solid, linear gradient (top to bottom) and radial gradient. Each state (on, off, hover) gets two of the colors.

This feature should significantly reduce the number of implementations of Fivestar that need to have a special site-specific implementation of a color. Because these new "color enabled" sets of stars will likely replace existing sets of stars, I'll be reducing the number of stars that are accepted for inclusion with Fivestar if they are not color enabled. We should have an example of how to make a set of color enabled stars after the feature is completed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

FileSize
20.52 KB

A (very very) in-progress patch. Not recommended for use.

quicksketch’s picture

FileSize
188.28 KB
52.44 KB
35.08 KB

Here's an updated and *almost* working patch! I've very stoked about the prospect of including this in the next version.

I've included a patch, but because I bet the png files won't work for a lot of peeps I've attached a gzip for easy use. Screenshot also attached.

What works:
- You can choose colors from the picker
- New images are automatically generated and displayed in the preview
- Color picker color is applied to mask images, then an overlay is put over the mask.
- This patch also needed to fix the long outstanding issue with previews not showing up: http://drupal.org/node/197861

What doesn't:
- The generated images aren't saved to the files directory
- Um, you can't actually submit the form ;) Gives a "An illegal choice has been detected. Please contact the site administrator." error.

quicksketch’s picture

Status: Active » Fixed

Now that 1.11 has come out, I committed a completely working Color Picker to Fivestar. I can't produce any bugs in my testing, so let's open a new issue for all problems with the picker. Woot!

davemybes’s picture

Sorry to post to a "fixed" issue, but I just downloaded the 1.11 version and I don't see the color picker in there anywhere. From your last patch, there should be a fivestar_color.inc and a fivestar_color.js file included in the module, but they're not there. From your #3 post, it sounds like 1.11 is supposed to include the color picker, but maybe I'm missing something. Awesome idea, by the way.

*update* I checked through CVS and the fivestar.module version with the color picker is 1.2.2.76 and above, while the current 1.11 release is only 1.2.2.73.

quicksketch’s picture

Yes, I posted 1.11 which just focused on bug fixes since entering the beta period. I added the color picker the same day but after making the 1.11 release. I want to get this throughly tested before releasing another beta. Please let me know if you have any trouble!

davemybes’s picture

Ah, OK. Didn't realize that. I've played around with it a bit so far and no problems. I'll post an issue if something comes up.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.