JS: "Unvoting" in up/down form style
Super G - June 17, 2008 - 02:33
| Project: | Extra Voting Forms |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | sicjoy |
| Status: | postponed |
Jump to:
Description
Thanks for the impressive module!
I'm using the up/down form style for my site and I would like to give my readers the option to "unvote". For example, if a user has previously voted up a comment, clicking on the up arrow again would reset the form (changing it from a +1 to a 0). Right now, all they can do to "cancel" their vote is click on the down arrow (changing a +1 to a -1 instead of a 0).
I thought of trying a select box with choices -1, 0, and +1, but it seems like I would have to give up the nifty arrow interface.
I apologize if this functionality is already implemented and I somehow missed it.

#1
Hi,
It's not implemented, and yes, it probably should be.
The problem is that it requires some changes to both the javascript and the PHP code, so it's a bit tricky.
I have to be honest, it might be a (long) while before this is done...
Merc.
#2
Hi,
Cedric, I was thinking that implementing this would probably break the existing voting form's CSS. Or maybe not? Maybe it would just be an extra radio button with "unvote", and the existing voting forms would still work?
Cedric, can you please look into this? I am thinking that we should do it now, because this could only apply to the DRUPAL-6-1 branch if the CSS ends up not being backward-compatible.
So, I think there should be a permission called "cancel cast votes using extra_voting_forms". Then, if the permission is there, there should be an extra option in the checkboxes or elect boxes. So, not just "up" or "down", but "delete" or something like that. Then, the backend should see if "delete" is selected.
Cedric, also please note that the guy who ported extra_voting_form to D6 screwed up the theming. So, please start playing with this in the DRUPAL-5 branch. If you see that there is no need to change the CSS, *great* -- let's just do it. However, if you notice that the CSS for the voting forms needs to change, then let's wait a day or two till the guys fix the DRUPAL-6-1 branch, and fix it only for the DRUPAL-6-1 branch.
Bye,
Merc.
Bye,
Merc.
#3
Hi,
Sorry to change the instructions so quickly...
Cedric, as far as extra_voting_forms is concerned, please only ever change the DRUPAL-6--1 branch (which obviously needs Drupal 6).
I have worked extensively on the Drupal 6 branch, improving it. So, from now on, the D5 should only have major bugs and security problems fixed.
Bye,
Merc.
#4
#5
Hi,
Cedric, does this mean that you aree actually installing Drupal 6 and using the D6 version of extra voting form?
Congratulations!
Merc.
#6
As far as I understand, extra_voting_forms create a very simple form with radio button and mainly extra_voting_forms.js modifies the form to render it as it is now.
If you wish to add a delete your vote, you'd probably have to modify also the css to render it correctly.
So this means : * change form in extra_votings_forms, have a look at the js and create a new css style to apply to it. We also have to take care of the permission.
#7
Hi,
I agree. And I think that this should be done at the Drupal 6 branch of the module -- the D5 won't have this feature.
I won't release a stable release of the module till this is done.
Cedric, having a testing enviironment for this is immensely simple:
* Download Drupal 6
* Checkout the DRUPAL-6--1 version of the extra voting form in "sites/all/modules"
* Enable it
* Set a node type as voteable configuring extra_voting_form
* Create a node with "blah" as contents
* Vote
That's it!
I am a little anxious about this module because it's one of the few nice voting modules available for Drupal 6, and people are using it even though it's a development release... when you create the patch, it will break existing custom-made widgets.
Bye!
Merc.
#8
I prefer not doing this one tough...
#9
Hi,
OK no worries!
Merc.
#10
Hi,
Sicjoy, since Cedric is not able to work on this, and I know zip about Javascript, are you able to look into this one?
I'd love to get this one sorted out... since it's one of the last things I am not actually able to work on (since it's Javascript) AND it's stopping me from releasing the D6 branch of the module as a stable release.
Bye!
Merc.
#11
I have a new angle on this. Instead of adding a third button or drop-down, why not have the up arrow increment up by one, and the down arrow increment down by one. This would require one click if you wanted to cancel your vote (unvoting) and two clicks if you wanted to reverse your vote.
That seems more intuitive to me. Anyone else care to chime in?
--sicjoy
#12
Hi,
I *LOVE* this idea.
Merc.
#13
Hi,
sicjoy, when you code this, watch out: EVF can be configured so that it assigns for example 2 votes per vote. However, this mechanism should work even if the number of votes *changes* between interactions.
So for example:
* You vote something up. The karma amount is 1. the story goes to +1.
* You get privileges, or whatever, and your voting power goes to 2
* You vote the same story down once. HERE, it should go to 0 and NOT -1!
So, basically be backend should check if the given vote is positive whereas the previous one was negative -- if that's the case, then the vote is reset.
Makes sense?
Bye!
Merc.
#14
Makes sense.
--sicjoy
#15
It's a good idea. But will it work with the fact that user can only vote one time ?
#16
Hi,
If the user can only vote one time, then "tough" -- he won't be able to unvote.
It seems like a sensible design decision.
Merc.
#17
Hi,
I am not able to code this, and I am therefore postponing it.
Chipping in most welcome.
Merc.
#18