Thorsten Kampe wrote:
Hi,
I'm trying to integrate "Thumbscreen"[1] (basically a JavaScript
generating a self-expanding image) with AsciiDoc.
Basically what needs to be done is to reference two functions
("onmouseout" and "onmouseover") within "<a href><img src=[...]</a>" [2]
and to "include" the JavaScript[3].
Is this possible and what would be the best way to use (and re-use) the
JavaScript from AsciiDoc?
Include the JavaScript with:
pass::[<script src="thumbscreen.js" type="text/javascript"></script>]
Implement a block macro, probably like this (but I'm just guessing parameters
from your example):
[macros]
(?u)^(?P<name>thumbscreen)::(?P<target>\S*?)(\[(?P<attrlist>.*?)\])$=#
[thumbscreen-blockmacro]
<a href="{target}"><img src="full.png" width="{width}" height="{height}"·
alt="{alt}" border="0" id="screen{thumbid}"·
onmouseout="reducethumb(42); return false;" style="position: absolute;·
display: none;"><img src="thumb.png" width="{width}" height="{height}"·
alt="{alt}" border="0" id="thumb{thumbid}"·
onmouseover="expandthumb({thumbid}, 800, 600);"></a>
Example usage:
thumbscreen::full.png[thumbid=42, width=240, height=180, thumb="thumb.png",
alt="Thumbscreen example"]
Cheers, Stuart
Thorsten
[1] http://www.just-great-software.com/thumbscreen.html
[2]
<a href="full.png"><img src="full.png" width="240" height="180"
alt="Thumbscreen example" border="0" id="screen42"
onmouseout="reducethumb(42); return false;" style="position: absolute;
display: none;"><img src="thumb.png" width="240" height="180"
alt="Thumbscreen example" border="0" id="thumb42"
onmouseover="expandthumb(42, 800, 600);"></a>
[3] <script src="thumbscreen.js" type="text/javascript"></script>
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.