Display the "external link" icon only if the link host is different from the project url (pom.url).

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@383444 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2006-03-06 01:10:45 +00:00
parent d9ad19e685
commit c12a872a0d
3 changed files with 26 additions and 8 deletions

View File

@ -194,17 +194,25 @@
@target
-->
<define:tag name="itemLink">
<x:element name="a">
<j:catch>
<j:new var="siteHost" className="java.net.URL"><j:arg value="${pom.url}"/></j:new>
</j:catch>
<x:element name="a" trim="true">
<x:attribute name="href">${pathTool.calculateLink(link,relativePath)}</x:attribute>
<j:choose>
<j:when test="${link.startsWith('http') or link.startsWith('https')}">
<j:catch>
<j:new var="hrefHost" className="java.net.URL"><j:arg value="${link}"/></j:new>
</j:catch>
<j:if test="${(siteHost != null) and (hrefHost != null) and (!siteHost.host.equalsIgnoreCase(hrefHost.host))}">
<x:attribute name="class">externalLink</x:attribute>
<x:attribute name="title">External Link</x:attribute>
</j:if>
</j:when>
<j:when test="${target != null and target.equals('_blank')}">
<x:attribute name="class">newWindow</x:attribute>
<x:attribute name="title">New Window</x:attribute>
</j:when>
<j:when test="${link.startsWith('http')}">
<x:attribute name="class">externalLink</x:attribute>
<x:attribute name="title">External Link</x:attribute>
</j:when>
</j:choose>
<j:if test="${!empty(target)}">
<x:attribute name="target">${target}</x:attribute>

View File

@ -35,6 +35,10 @@
<jsl:template match="document" trim="true">
<x:doctype name="html" publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" systemId="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<j:catch>
<j:new var="siteHost" className="java.net.URL"><j:arg value="${pom.url}"/></j:new>
</j:catch>
<j:useBean var="navbean" class="org.apache.maven.NavBean"/>
<j:set var="location" value="${outFile.substring(destdir.length())}"/>
<util:replace var="location" oldChar="\" newChar="/" value="${location}"/>
@ -615,9 +619,14 @@
</x:attribute>
</j:when>
<j:when test="${href.startsWith('http://') or href.startsWith('https://')}">
<j:catch>
<j:new var="hrefHost" className="java.net.URL"><j:arg value="${href}"/></j:new>
</j:catch>
<x:attribute name="href">${href}</x:attribute>
<x:attribute name="class">externalLink</x:attribute>
<x:attribute name="title">External Link</x:attribute>
<j:if test="${(siteHost != null) and (hrefHost != null) and (!siteHost.host.equalsIgnoreCase(hrefHost.host))}">
<x:attribute name="class">externalLink</x:attribute>
<x:attribute name="title">External Link</x:attribute>
</j:if>
</j:when>
<j:otherwise>
<x:attribute name="href">${href}</x:attribute>

View File

@ -27,6 +27,7 @@
</properties>
<body>
<release version="1.10-SNAPSHOT" date="in SVN">
<action dev="aheritier" type="fix">Display the "external link" icon only if the link host is different from the project url (pom.url).</action>
<action dev="aheritier" type="add">Fix generated pages titles: [nav.title | pom.name] - doc.title</action>
<action dev="aheritier" type="add">New attribute fileSuffix for the tag doc:registerReport allow to use another extension than '.html' for a report link.</action>
<action dev="ltheussl" type="add">Include instructions for ClearCase, Starteam and Perforce access in the scm-usage page.</action>