Big patch here against 6.x-1.1 ...

- Changes the database to use a serialized data field to hold more information on the link state such as width/height
- Cleaned up admin interface with fieldgroups
- Make link states toggle-able
- remove PHP warning notices
- Prevent spritemenu overwriting classes that have already been set on the menu item by other modules
- Some general cleaning of cruft/code repetition

Comments

justafish’s picture

StatusFileSize
new2 KB

Here's a patch for the install file also, no upgrade path from 6.x-1.1 yet though so you would need to disable and uninstall first

justafish’s picture

StatusFileSize
new12.47 KB

Adds generic "spritemenu" class to all spritemenu menu item, patched against original file

justafish’s picture

StatusFileSize
new2 KB
new13.57 KB

Updated patches to allow removal of images to function correctly (patched against 6.x-1.1)

Still no upgrade path...

nfavrod’s picture

subscribe

nfavrod’s picture

Hello,
I can't patch the module cause of "clipboard" stuff. Is it normal that the first lines of the patch are:

--- spritemenu.module
+++ (clipboard)

Strange isn't it?

Thanks, I hope your work will be soon applied!!

+++nico

nfavrod’s picture

Hello,

I still have on more question: as you specified differents CSS etc for visited, hover,. would it be complicated to put a different image for each kind?

Now, I did and image in witch half top is normal and half bottom is hover & active and I change the position.

Maybe I could help in the help when your patch will be OK!

Thanks
nico

justafish’s picture

StatusFileSize
new13.68 KB

hi nfavrod,

A sprite should be one image that changes it's visible viewport to appear as different images, so I think this is out of scope for this module.

I've attached another patch that fixes the order of the menu states and also makes this module more compatible with other menu item altering modules (in particular http://drupal.org/project/menu_item_container )

aenw’s picture

Your work is really helpful, justafish. But when I use it, I don't see that the position or height are written out to the css file, and width is always written as 100%. Am I missing something? I assumed that they'd be written out in _spritemenu_build_css().
thanks,
aenw

justafish’s picture

aenw, have you clicked the enabled checkbox and filled out the desired width and height of the sprite? (as opposed to leaving it on auto)

aenw’s picture

Yup, did all that. When I debugged and stepped through the code, nowhere was the width or height written to $css (the output string in _spritemenu_build_css() ).

justafish’s picture

aenw, yes it does...

+        if(is_numeric($state_width)) {
+          $state_width .= 'px';
+          $display = 'display: block;';
+        }

Have you refreshed the menu page and cleared your cache?

bgilhome’s picture

StatusFileSize
new14.84 KB

I've updated the patch to add the following:

  • 'normal' state with separate CSS rules
  • CSS rules for items with state class (eg. a.active) as well as state pseudo-class (eg. a:active)
  • 'auto' size calculates pixel size assuming vertically-stacked equal-height sprites, based on the number of unique positions of enabled states:
  • eg. for positions {'normal'->'left top', 'hover'->'left bottom' & 'active'->'left bottom'}, each state's sprite height is calculated as $image_height/2 (2 unique positions for 3 enabled states)

I think this is all good? Needs approval, bit of a quick fix.

quicksketch’s picture

Status: Needs review » Needs work

Hey guys, it's been a while since this patch was filed. I'm helping maintain the module now and I'm interesting in seeing what this patch provides. Unfortunately it's going to need a reroll to work with #1188714: Drupal 7 port of Sprite Graphic Menu, and the latest patch is full of tabs and has a few code styling issues. Anyone still interested in a reroll?

justafish’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)