I have checked the issue queue but haven't found anything like this. Sorry if I missed it.
It would be great to provide a feedback to a user that his vote is being saved. Something like "Thanks for your vote!" shown next to a voting widget would be just great.
Actually I have hacked the 5.x-1.10 version of this module, but the site I use this hacked version is not live yet so I cannot provide a link. Plus, it was quick and dirty and most likely made in a wrong way. :-(
Anyway, this could be as simple as a tiny addition in the jquery.rating.js file, in the $stars.click
function. Something like $('fivestar-confirm-widget').slideDown("slow");
and in the fivestarDefaultResult
we could have something like setTimeout("$('fivestar-confirm-widget').slideDown("slow");", 1000);
'fivestar-confirm-widget' could be:
<div id="fivestar-confirm-widget">Thanks for your vote!</div>
This way the confirmation text would be visible for at least 1 second and no longer than a second after the vote was saved. It could be extended even more like this:
fivestarDefaultResult
:
$('fivestar-confirm-widget').html('Your vote has been saved.');
setTimeout("$('fivestar-confirm-widget').slideDown("slow");", 1000);
Best regards,
Bartek
Comment | File | Size | Author |
---|---|---|---|
#7 | fivestar_confirmations.patch | 13.01 KB | quicksketch |
#6 | fivestar-confirmations.patch | 11.04 KB | bartekg |
#6 | fivestar 5.x-1-11 confirmations.zip | 77.65 KB | bartekg |
Comments
Comment #1
quicksketchThis would be a great feature to include, I agree. The likely location for the option would be under "Star Labels", even though it's not quite a star "label". Hmm. Either way, this needs to be a configuration option in the Fivestar content type settings, as it's something that is very likely to be changed on a per-site basis. If you can abstract out the feature and make a patch, I'd love to include it.
Comment #2
bartekg CreditAttribution: bartekg commentedI can try to implement this, however this is not going to happen before April. If that's fine with you we can get back to this later. Alternatively, if anyone else likes to do this I will be happy to review patches.
Comment #3
qingdao CreditAttribution: qingdao commentedyeah this would be a nice feature, i recently made some usertests on the page im developing right now, and many users were confused about fivestar rating. They didn't know if the rating was saved or not. A confirmation message would be very helpful. Thank you ...
Comment #4
bartekg CreditAttribution: bartekg commentedThat's why I believe its worth while to add this feature. I hope I will have some time to work on it during Easter time. :-)
Comment #5
qingdao CreditAttribution: qingdao commentedwould be nice :-)
Comment #6
bartekg CreditAttribution: bartekg commentedHere is a patch for 5.x-1.11 version.
New features:
All texts are passed on through t() so they can be easily translated.
Since this is my first patch and I am not sure if I prepared it properly there is also a complete module (zipped) attached.
Regards,
Bartek
Comment #7
quicksketchWow! Thanks bartekg. Works really quite well! However, I ran into a few snags that we'll need to clean up, plus a few small code style things.
First, I got a javascript error if Comment module was enabled and I disabled/enabled Fivestar support for a particular node type. Just looks like the new feedback variable needed to be passed in as a last argument when updating the Comment rating preview. No problem.
I changed all the PHP code to use underscores for variable names instead of camelCase. JavaScript uses camelCase but PHP uses underscore_variables. Yeah, weird I know :P
Lastly just a few minor changes to spacing in an IF statement.
The functionality it great here though! I like that it's added as an additional line of text instead of replacing the existing status text. Very nice.
One last thing I'd like to change though, how about changing the text for "Thank you for you vote!" to "Saving your vote...". I feel like I get double feedback if it thanks me for my vote before it's even saved. What do you think?
Comment #8
bartekg CreditAttribution: bartekg commentedI wasn't aware of this. Thanks for a tip. :-)
I am glad you like it. :-D
That's fine with me. It is also a more natural counterpart to the "Deleting your vote...". However, two questions here:
1) which version is better/correct from English grammar/spelling point of view: "Saving your vote..." or "Your vote is being saved..."?
2) if we are going to stick with the former should we say: "Saving your vote..." or "Saving Your vote..."?
Comment #9
quicksketchBoth are grammatically correct, but I think the shorter "Saving your vote..." will work better because it's less text to read and it can disappear pretty quickly. I'd prefer "Saving your vote" (instead of "Saving Your vote") because Drupal tries to have a convention of an uppercase letter only for the first letter of labels, and it reads more like a normal sentence.
Comment #10
bartekg CreditAttribution: bartekg commentedOK, so I guess we have a patch to commit. :-) Do you have any idea when a new version will be available?
Comment #11
quicksketchCommitted to both 5 and 6 versions of Fivestar. Amazingly the patch applied perfectly to the Drupal 6 version also.
I want to get the multi-axis voting into version 1.12 before releasing it. It's also only been a couple weeks since the last release, people might be getting a little irritated at the rapid pace of releases. :)
So I'd estimate 2-4 weeks yet before I put out the new version.
Great work once again. For a first patch it's flippin' awesome. Thanks for the help.
Comment #12
bartekg CreditAttribution: bartekg commentedThanks, that's great! Looking forward to the next release. :-)
Comment #13
quicksketchWhile trying to nail down http://drupal.org/node/211526, I found that the approach we used here didn't accommodate the combo set of stars very well (when both the average and user votes are displayed).
So I reworked this a bit to replace the existing text rather than display as a second line. Although I liked the amount of information given in the original version, the confirmation now takes up no additional space and looks a lot better when used with the combo widget. If you can try out the latest dev and see what you think I'd appreciate the additional review.
Comment #14
bartekg CreditAttribution: bartekg commentedRegarding the http://drupal.org/node/211526 issue: actually I had the same idea in mind as I use the combo set on my site. It's really nice to see how this module gets better and better. :-)
I will take a look at the latest dev tonight/tomorrow and let you know my thoughts. However, based on your description, I believe it is a good idea.
Comment #15
bartekg CreditAttribution: bartekg commentedI have just checked the latest version: the voting widget works perfectly and looks even better (I have checked the combo and average/user alternatives). Well done!
Plus I have noticed that the admin section works much faster now (I guess this is because IFrames are no longer used). Also 'Custom color widgets' look really promising (btw: I couldn't get the custom colors to work - after hitting 'Save' all color related settings get back to default values).
Comment #16
quicksketchYeah, glad to get those out of there, although the new solution of running RegEx on the CSS feels a little dirty still. :P
Eh, sure enough. I committed a fix for D6 but D5 missed it. It's now saving correctly.
Comment #17
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.