Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
add parameters to manage hotspot shape and text color
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-Amplexor committed May 7, 2020
1 parent d2d04a0 commit ea90cea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Some limitation exists with FOP (tested with FOP 2.4): internal link between ima
- DITA-OT 3.1 and older: run `dita --install https://github.com/Amplexor/com.amplexor.imagemap-pdf/releases/download/v1.0/com.amplexor.imagemap-pdf-v1.1.zip`

## Parameters
* **imagemap.hotspot.enabled** set to "yes" to enable imagemap hotspot insertion in the generated PDF.
- **imagemap.hotspot.enabled**: set to "yes" to enable imagemap hotspot insertion in the generated PDF.
- **imagemap.hotspot.shape.color**: defines hotspot shape color. The default value is 'blue'.
- **imagemap.hotspot.text.color**: defines hotspot text color. The default value is 'white'.


## Usage with Antenna House
Expand Down
14 changes: 7 additions & 7 deletions imagemap/ut-domain-attr.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0">

<xsl:variable name="defaultSvgShapeStrokeColor" select="'blue'" as="xs:string"/>
<xsl:variable name="defaultSvgHotspotTextColor" select="'white'" as="xs:string"/>
<xsl:param name="imagemap.hotspot.shape.color" select="'blue'" as="xs:string"/>
<xsl:param name="imagemap.hotspot.text.color" select="'white'" as="xs:string"/>

<xsl:attribute-set name="svg_shape_container">
<xsl:attribute name="absolute-position">absolute</xsl:attribute>
Expand All @@ -16,7 +16,7 @@
</xsl:attribute-set>

<xsl:attribute-set name="svg_shape">
<xsl:attribute name="stroke"><xsl:value-of select="$defaultSvgShapeStrokeColor"/></xsl:attribute>
<xsl:attribute name="stroke"><xsl:value-of select="$imagemap.hotspot.shape.color"/></xsl:attribute>
<xsl:attribute name="stroke-width">1</xsl:attribute>
<xsl:attribute name="fill-opacity">0</xsl:attribute>
<xsl:attribute name="stroke-opacity">1</xsl:attribute>
Expand All @@ -29,15 +29,15 @@
<xsl:attribute-set name="svg_shape_circle" use-attribute-sets="svg_shape"/>

<xsl:attribute-set name="svg_hotspot_circle">
<xsl:attribute name="stroke"><xsl:value-of select="$defaultSvgShapeStrokeColor"/></xsl:attribute>
<xsl:attribute name="fill"><xsl:value-of select="$defaultSvgShapeStrokeColor"/></xsl:attribute>
<xsl:attribute name="stroke"><xsl:value-of select="$imagemap.hotspot.shape.color"/></xsl:attribute>
<xsl:attribute name="fill"><xsl:value-of select="$imagemap.hotspot.shape.color"/></xsl:attribute>
<xsl:attribute name="stroke-width">1</xsl:attribute>
<xsl:attribute name="fill-opacity">1</xsl:attribute>
<xsl:attribute name="stroke-opacity">1</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="svg_hotspot_circle_content">
<xsl:attribute name="fill"><xsl:value-of select="$defaultSvgHotspotTextColor"/></xsl:attribute>
<xsl:attribute name="fill"><xsl:value-of select="$imagemap.hotspot.text.color"/></xsl:attribute>
<xsl:attribute name="font-size">0.4em</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-family">sans-serif</xsl:attribute>
Expand Down
2 changes: 2 additions & 0 deletions params.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension>
<param name="imagemap.hotspot.enabled" expression="${imagemap.hotspot.enabled}" if:set="imagemap.hotspot.enabled" xmlns:if="ant:if"/>
<param name="imagemap.hotspot.shape.color" expression="${imagemap.hotspot.shape.color}" if:set="imagemap.hotspot.shape.color" xmlns:if="ant:if"/>
<param name="imagemap.hotspot.text.color" expression="${imagemap.hotspot.text.color}" if:set="imagemap.hotspot.text.color" xmlns:if="ant:if"/>
</extension>

2 changes: 2 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
<val desc="No" default="true">no</val>
<val desc="Yes">yes</val>
</param>
<param name="imagemap.hotspot.shape.color" desc="Hotspot shape color for imagemap. The default value is 'blue'." type="string"/>
<param name="imagemap.hotspot.text.color" desc="Hotspot text color for imagemap. The default value is 'white'." type="string"/>
</transtype>
</plugin>

0 comments on commit ea90cea

Please sign in to comment.