Is it possible to (manually) add hover text to the up and down voting buttons? I notice that the cursor changes on hover, can text also be added? Is there a particular place I should look for this?

Thanks

breaklaw

CommentFileSizeAuthor
#4 extra_voting_forms-241950-1.patch10.37 KBsikjoy

Comments

breaklaw’s picture

Category: feature » support
sikjoy’s picture

Assigned: Unassigned » sikjoy

I'm hesitant to make this a module feature because I don't want to have an overwhelming module settings form (feature creep.)

Unfortunately, the XHTML markup is embedded into the module here. It really needs to be wrapped in a theme function. That way a title attribute can be set in your theme to give you the functionality that you want.

It might take me a little while, but it really should be done. I'll yank the XHTML out of the function that it's embedded in and package it in a theme function so you can get at it without hacking the module. How does that sound?

--sicjoy

mercmobily’s picture

Hi

I think this is the perfect solution.

(An an aside: I am a little drigged-out after yesterday... BTW. 14 hours straight made me go a little "peculiar". I wasn't even able to do any paid work today. So, I will take it easy over the week end.)

Merc.

sikjoy’s picture

Status: Active » Fixed
StatusFileSize
new10.37 KB

OK - I have your theme functions. Assuming you are using the drigg_theme and the 2 button voting form, here's what you need to do:

  1. Apply the included patch: $>patch -p0 < extra_voting_forms-241950-1.patch
  2. Open extra_voting_forms.module in a text editor. At the bottom you'll see a section called theme functions.
  3. Open the template.php file in your themes/drigg_theme/ folder.
  4. Copy the entire function, theme_extra_voting_forms_3, including the opening { the closing } and everything in between, from the module and add it to the bottom of your template file.
  5. Rename the new function in your template file to: drigg_theme_extra_voting_forms_3.
  6. You have now overridden the original function. If and when you upgrade your extra_voting_forms module, it won't blow away the changes we are about to make.
  7. Look for two tags starting with <label. The first is for the up arrow and the second is for the down arrow
  8. Add title attributes to each of these label tags, for example:
    • <label title="Hello, world!" class="karma_up'.($default>0?'_clicked':'not_clicked').$clickable_string.'" for="u'.$o->sk_id.'">
  9. Save your template file and visit one of your scoops. If you followed my example, when you hover the mouse over the vote up button, you should see "Hello, world!".

Thats it!

--sicjoy

mercmobily’s picture

Hi,

Sincjoy, for consistency, I would make sure all of them have a number at the end, even _1 and _2. So, we end up having:

theme_extra_voting_forms_1
theme_extra_voting_forms_2
theme_extra_voting_forms_3
theme_extra_voting_forms_4

Even if one of them is a stub. Just for consistency!

But, _great_ patch! This should be committed before we release the new Drigg (still battling Drupal so that we don't get gazillions of support requests...)

Merc.

mercmobily’s picture

Status: Fixed » Needs work

Hi,

Sicjoy, I noticed that you marked this as "fixed", but didn't actually commit the code to CVS!
I assume it was a mistake... marking it as "patch needs work" (although it needs a TINY amount of work :D )

Merc.

sikjoy’s picture

Hi,

I did commit this to 5.x-dev, but I mistakenly put the wrong issue number in the comment. Do you know how to alter the comment for a previous CVS commit?

--sicjoy

sikjoy’s picture

Version: 5.x-1.9 » 5.x-1.x-dev
Status: Needs work » Fixed

OK - I added separate theme functions for form 1 & form 2 - committed it to 5.x-dev - marking fixed.

mercmobily’s picture

Fantastic, thanks sicjoy!

Merc.

mercmobily’s picture

Status: Fixed » Active

Hi,

sicjoy, I don't see the code committed to the DRUPAL-5 branch.
Maybe you forgot or...?

Please apply this patch to the DRUPAL-5 branch of extra_voting_forms!

Merc,

sikjoy’s picture

mercmobily’s picture

Hi,

?!?!?!?
How come I don't get an updated module when I run:

cvs update -dP

...?!?

Merc.

mercmobily’s picture

Hi sicjoy,

Any chances of you coming to IM for a minute, before I go completely bonkers?

Have a look here:

http://drupal.org/project/cvs/202707

Merc.

mercmobily’s picture

Hi,

I *think* there is a chance you applied the patch to the dead DRUPAL-5-2 branch of the module...

Merc,

mercmobily’s picture

Hi,

...except, there is no 5-2 branch for this. OK, I just don't know...

Merc.

mercmobily’s picture

Hi,

From the CVS messages, it's apparent that I have been committing to the wrong branch, HEAD, rather than DRUPAL-5.
All of the releases have been based on HEAD. Ugh.

sicjoy... help. Can you please:

* Check out the latest extra_voting_forms (1.9)
* Make sure *that* becomes the DRUPAL-5 version of extra_voting_forms, so that we ABANDON HEAD
* Reapply your patches (sorry...)

...?
That way, I will just checkout the DRUPAL-5 version of the module, check that the code is what I expect it to be, and we will be working on the same branch (DRUPAL-5) from now on...

This is totally my fault. I apologise.

Merc.

mercmobily’s picture

Hi,

Sicjoy, did you see this?
Please let me know, so that we can get this out of the way!

Merc.

sikjoy’s picture

Status: Active » Closed (fixed)

I believe our CVS issues are straightened out now.