GNOME Bugzilla – Bug 159564
Py-slice should be able to generate simple dhtml animation and link stubs
Last modified: 2005-09-25 21:48:03 UTC
For however makes html pages on the old fashioned way, perl-o-tine and py-slice are great. However, even for a simple "hover" effect, the ammount of html to be written can become huge. So, I added to py-slice the ability to auto-build a simple DHTML animation for onmouseover and onmousedown, picking the bitmaps from the bottom-most image visible layers. I also added stubs for the html anchor tabs that would surround a normal image inside a table.
Created attachment 34158 [details] new proposed py-slice The changes are somewhat big, and the whole file will bemore readable than a patch.
The point about a patch is not being readable but that it allows to see the changes and that it can be merged with other changes. If one wants to see the complete file, that's as simple as applying the patch.
i am wondering if it would be better named "py-dyslice.py" instead.
I will post a patch after I fine tune some more of the html attributes into css them. As for the menu entry "py-slice" I actually find it misleading - there is no way one could find out what it does without trying it - the only hint is that it is something "web related", since it goes in filters->web.
I have installed this plug-in. My earlier suggestion was silly. This plug-in does all of the old stuff and some new also. Sorry.
setting to NEEDINFO because this awaits input from Joao
Created attachment 37915 [details] [review] Patch which adds the new behavior to py-slice Oops, I thought I had done this already.
Hm, why'd you remove the tag capitalization feature?
I was worried about not clutering the GUI very much. And, now, thinking on it, I think I have something personal against uppercase html tags. But it is ok to add it back - it just did not occur me that people might actually use it.
Removing NEEDINFO (Joao, you should have done that when adding the requested information).
I recall that people were asking for this sort of thing on the mailing lists and/or IRC, so we should consider to add it for 2.4. I'm going to test if it still works...
I had a recent conflict in a recent CVS UP with the Capital Letters option i removed from the plug-in. Besides that, it still works. If people think that having an option for capitalizing html tags is worth the UI clutter I can add it back. (The current way capitalization is done will not work wtih my version IIRC)
Could you attach an updated patch? The attached one doesn't apply anymore.
Re capitalization: afaik xhtml requires lowercase, doesn't it?
Created attachment 48881 [details] [review] Updated patch, diffed from CVS HEAD today. I was away from home the other day. Here goes the patch.
I've tried the patch and it seems to work fine. There are some details that could be improved (for example, alt=" " could be alt="", and maybe some rules from the CSS style attributes could be extracted into CSS classes). But one thing is IMO important: Either - there should be a warning (ALL UPPERCASE, and very prominent in general) that this are just building blocks for a document or - the output from this script should be a complete, 100% XHTML strict compliant document
In regard to #16: I will review the code later to check for such details. AS for xhmtl compliance that is a problem I would like to know a work around to: There is javascript embeded into he output. The correct way to embed javascript is to put it into a CDATA field, so that it can hold '>' and '<' characters - but a few mainstream browsers do not support this CDATA field (at this moment I do not even know what exactly is and what is the sintax for this CDATA - I am just remebering something I read a while ago) - if you can point me somwhere to read about this, I will be fine. Or else, we could just insert the suggested warning.
The syntax is describe in the "Differences with HTML 4" section of the XHTML 1.0 specs: http://www.w3.org/TR/2000/REC-xhtml1-20000126/#diffs (see subsection 4.8) As an alternative to inline scripts, it is recommended to use an external script if certain characters may appear inside the script (see Appdendix C.4). BTW, what mainstream browsers can't handle CDATA?
Joao, do you have any changes already or should I have a look at this this weekend?
I was working on it today, but I had a probelm with indexed images. I am using gimp_layer_new_from_drawable- but it has a bug for indexed images - it comes all black. And people will want to use this script to generate indexed PNGs (I do) - I jave to close ont hisother bug before this script gets really ready. Moreover, I have to special case RGB + gif and INDEXED + jpg - they are not working currently. As for the sugestions in #16, I opted for puttin a warning comment. A fum xhtml document has to have a <head> and <body> and can't be simply embedded in another HTML document (using server side includes for example). I worked a little on the html style, however, so it can now be embeded in xhtml without problems. I also added a new feature: when saving to an already existing py-slice generated file, it will read the URLs that may have been hand-edited in the file that will be overwritten and preserves them.
Created attachment 49310 [details] [review] Latest patch.I think it is fine now. There it is. I updated the text that is displayed on the dialog to give a clue on the new feature. As for the problem with indexed images: I was using gimp_layer_new_from_drawable, but I can't do it for layers that will live o n new images, because these new images don't have a colormap yet. I worked around it. Any combination of RGB, GRAY and INDEXED is working fine with either image type as well. (I think that the version on CVS now will fail if one picks .gif with an RGB image)
I committed this patch to cvs: 2005-09-25 Carol Spears <carol@gimp.org> * plug-ins/pygimp/plug-ins/py-slice.py added the patch from Joao S. O. Bueno Calligaris that was attached to http://bugzilla.gnome.org/show_bug.cgi?id=159564 Now, we need only to await for xhtml validation errors from people using the CAPS option (if it is still there).
Any problems with the oputput of the script should go into new reports. Resolving as FIXED.