[Phpmyadmin-devel] Problems in Sprites implementation
Rouslan Placella
rouslan at placella.com
Tue Sep 27 18:35:06 CEST 2011
Hi there,
I find that there are a number of problems with the current
implementation of the CSS sprites in phpMyAdmin. So I took the time fix
them and I'd appreciate some feedback on this.
First of all, adding/removing icons to/from the sprites, as described in
the Wiki[1] is a cumbersome manual process. So I've created a shell
script, "scripts/generate-sprites", that completely automates this
process (requires ImageMagick). This script is also called from
"create-release.sh" for good measure.
Another issue is that PMA is not aware of the presence of the sprites.
This means that all themes for older versions of PMA won't display any
icons, since PMA will just blindly apply the new sprites classes (which
don't exists in these older themes) to icons. Also, developers are
required to pass an extra argument to "PMA_getIcon()" to indicate that a
particular icon is not available as a sprite. This IMO should be
avoided. To fix these issues I created two new function, both are called
"PMA_getImage()". One is for PHP and another is for JavaScript. These
functions read data that is generated by the "generate-sprites" script
and make PMA aware of which icons are available as sprites and which
ones aren't for every theme.
The code is available for scrutiny in the "sprites" branch of my public
repo [2].
So, if there are no objections, I will merge with master in a few days
time and update the relevant Wiki page to reflect this change.
Rouslan
[1]:
http://wiki.phpmyadmin.net/pma/Icons/Sprites_Usage#How_to_add_new_Icons.3F
[2]:
http://repo.or.cz/w/phpmyadmin/roccivic.git/shortlog/refs/heads/sprites
More information about the Developers
mailing list