Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 52247 Details for
Bug 82199
[Request] The style=printable URL option become hereditary
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Extended stickyness
sticky.printable.patch (text/plain), 6.76 KB, created by
Xavier Neys (RETIRED)
on 2005-02-27 10:19:01 UTC
(
hide
)
Description:
Extended stickyness
Filename:
MIME Type:
Creator:
Xavier Neys (RETIRED)
Created:
2005-02-27 10:19:01 UTC
Size:
6.76 KB
patch
obsolete
>Index: guide.xsl >=================================================================== >RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/guide.xsl,v >retrieving revision 1.143 >diff -u -t -r1.143 guide.xsl >--- guide.xsl 7 Feb 2005 16:45:27 -0000 1.143 >+++ guide.xsl 27 Feb 2005 18:03:30 -0000 >@@ -1192,7 +1192,14 @@ > <xsl:choose> > <xsl:when test="($TTOP = 'book') and ($full = 0) and (starts-with(@link, '?'))"> > <!-- Handbook link pointing to another part/chapter, normal case --> >- <a href="{$LINK}{@link}"><xsl:apply-templates/></a> >+ <xsl:choose> >+ <xsl:when test="$style != 'printable'"> >+ <a href="{$LINK}{@link}"><xsl:apply-templates/></a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a href="{$LINK}{@link}&style=printable"><xsl:apply-templates/></a> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:when> > <xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '?'))"> > <!-- Handbook link pointing to another part/chapter >@@ -1240,7 +1247,57 @@ > </xsl:choose> > </xsl:when> > <xsl:otherwise> >- <a href="{@link}"><xsl:apply-templates/></a> >+ <!-- Strip http://www.gentoo.org from links but leave links to viewcvs intact >+ Has no effect on actual www.g.o but helps when surfing on a local copy --> >+ <xsl:variable name="llink"> >+ <xsl:choose> >+ <xsl:when test="starts-with(@link, 'http://www.gentoo.org/cgi-bin/')"><xsl:value-of select="@link" /></xsl:when> >+ <xsl:when test="starts-with(@link, 'http://www.gentoo.org/')"><xsl:value-of select="substring-after(@link, 'http://www.gentoo.org')" /></xsl:when> >+ <xsl:otherwise><xsl:value-of select="@link" /></xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <!-- Now, insert style=printable in the URL if necessary --> >+ <xsl:variable name="alink"> >+ <xsl:choose> >+ <xsl:when test="$style != 'printable' or contains($llink, 'style=printable')"> >+ <!-- Not printable style or style=printable already in URL, copy link --> >+ <xsl:value-of select="$llink" /> >+ </xsl:when> >+ <xsl:when test="contains($llink, '://')"> >+ <!-- External link, copy link --> >+ <xsl:value-of select="$llink" /> >+ </xsl:when> >+ <xsl:when test="starts-with($llink, '#')"> >+ <!-- Anchor, copy link --> >+ <xsl:value-of select="$llink" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <!-- We should have eliminated all other cases, >+ style printable, local link, then insert ?style=printable --> >+ <xsl:choose> >+ <xsl:when test="starts-with($llink, '?')"> >+ <xsl:value-of select="concat( '?style=printable&', substring-after($llink, '?'))" /> >+ </xsl:when> >+ <xsl:when test="contains($llink, '.xml?')"> >+ <xsl:value-of select="concat(substring-before($llink, '.xml?'), '.xml?style=printable&', substring-after($llink, '.xml?'))" /> >+ </xsl:when> >+ <xsl:when test="contains($llink, '.xml#')"> >+ <xsl:value-of select="concat(substring-before($llink, '.xml#'), '.xml?style=printable#', substring-after($llink, '.xml#'))" /> >+ </xsl:when> >+ <xsl:when test="substring-after($llink, '.xml') = ''"> >+ <xsl:value-of select="concat($llink, '?style=printable')" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <!-- Have I forgotten anything? >+ Copy link --> >+ <xsl:value-of select="$llink" /> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <a href="{$alink}"><xsl:apply-templates/></a> > </xsl:otherwise> > </xsl:choose> > </xsl:when> >Index: handbook.xsl >=================================================================== >RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/handbook.xsl,v >retrieving revision 1.25 >diff -u -t -r1.25 handbook.xsl >--- handbook.xsl 5 Feb 2005 12:42:14 -0000 1.25 >+++ handbook.xsl 27 Feb 2005 18:03:30 -0000 >@@ -49,12 +49,21 @@ > <xsl:for-each select="part"> > <xsl:variable name="curpart" select="position()" /> > <li> >- <xsl:if test="$full = 0"> >- <b><a href="{/book/@link}?part={$curpart}&chap=0"><xsl:value-of select="title" /></a></b> >- </xsl:if> >- <xsl:if test="$full = 1"> >- <b><a href="#book_part{$curpart}"><xsl:value-of select="title" /></a></b> >- </xsl:if> >+ <xsl:choose> >+ <xsl:when test="$full = 0"> >+ <xsl:choose> >+ <xsl:when test="$style != 'printable'"> >+ <b><a href="{/book/@link}?part={$curpart}&chap=0"><xsl:value-of select="title" /></a></b> >+ </xsl:when> >+ <xsl:otherwise> >+ <b><a href="{/book/@link}?part={$curpart}&chap=0&style=printable"><xsl:value-of select="title" /></a></b> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:when> >+ <xsl:otherwise> >+ <b><a href="#book_part{$curpart}"><xsl:value-of select="title" /></a></b> >+ </xsl:otherwise> >+ </xsl:choose> > <xsl:if test="abstract"> > <br /> > <xsl:value-of select="abstract" /> >@@ -63,12 +72,21 @@ > <xsl:for-each select="chapter"> > <xsl:variable name="curchap" select="position()" /> > <li> >- <xsl:if test="$full = 0"> >- <b><a href="{/book/@link}?part={$curpart}&chap={$curchap}"><xsl:value-of select="title" /></a></b> >- </xsl:if> >- <xsl:if test="$full = 1"> >- <b><a href="#book_part{$curpart}_chap{$curchap}"><xsl:value-of select="title" /></a></b> >- </xsl:if> >+ <xsl:choose> >+ <xsl:when test="$full = 0"> >+ <xsl:choose> >+ <xsl:when test="$style != 'printable'"> >+ <b><a href="{/book/@link}?part={$curpart}&chap={$curchap}"><xsl:value-of select="title" /></a></b> >+ </xsl:when> >+ <xsl:otherwise> >+ <b><a href="{/book/@link}?part={$curpart}&chap={$curchap}&style=printable"><xsl:value-of select="title" /></a></b> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:when> >+ <xsl:otherwise> >+ <b><a href="#book_part{$curpart}_chap{$curchap}"><xsl:value-of select="title" /></a></b> >+ </xsl:otherwise> >+ </xsl:choose> > <xsl:if test="abstract"> > <br/> > <xsl:value-of select="abstract" />
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 82199
:
52105
|
52106
| 52247