~ubuntu-branches/ubuntu/vivid/yelp-xsl/vivid-proposed

« back to all changes in this revision

Viewing changes to xslt/mallard/html/mal2html-ui.xsl

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2011-09-28 16:28:04 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: package-import@ubuntu.com-20110928162804-hkrsv2trn2z7q6d7
Tags: 3.2.0-1
* New upstream release.
* debian/control.in:
  - Update Vcs-* fields.
  - Add Build-Depends on itstool.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
 
2
<!--
 
3
This program is free software; you can redistribute it and/or modify it under
 
4
the terms of the GNU Lesser General Public License as published by the Free
 
5
Software Foundation; either version 2 of the License, or (at your option) any
 
6
later version.
 
7
 
 
8
This program is distributed in the hope that it will be useful, but WITHOUT
 
9
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
10
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 
11
details.
 
12
 
 
13
You should have received a copy of the GNU Lesser General Public License
 
14
along with this program; see the file COPYING.LGPL.  If not, write to the
 
15
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
16
02111-1307, USA.
 
17
-->
 
18
 
 
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
20
                xmlns:mal="http://projectmallard.org/1.0/"
 
21
                xmlns:ui="http://projectmallard.org/experimental/ui/"
 
22
                xmlns="http://www.w3.org/1999/xhtml"
 
23
                exclude-result-prefixes="mal ui"
 
24
                version="1.0">
 
25
 
 
26
<!--!!==========================================================================
 
27
Mallard to HTML - UI Extension
 
28
Support for Mallard UI extension elements.
 
29
 
 
30
This stylesheet contains templates to support features from the Mallard UI
 
31
extension.
 
32
-->
 
33
 
 
34
 
 
35
<!--**==========================================================================
 
36
mal2html.ui.expander.data
 
37
Output data for an expander.
 
38
:Revision:version="1.0" date="2011-06-14" status="final"
 
39
$node: The source element to output data for.
 
40
$expander: Whether ${node} is actually an expander.
 
41
 
 
42
This template outputs an HTML #{div} element with the #{class} attribute set to
 
43
#{"yelp-data yelp-data-ui-expander"}. All #{yelp-data} elements are hidden by
 
44
the CSS. The div contains information about text directionality, the default
 
45
expanded state, and optionally additional titles for the expanded and collapsed
 
46
states.
 
47
 
 
48
The expander information is only output if the ${expander} parameter is #{true}.
 
49
This parameter can be calculated automatically, but it will give false negatives
 
50
for blocks that produce automatic titles.
 
51
-->
 
52
<xsl:template name="mal2html.ui.expander.data">
 
53
  <xsl:param name="node" select="."/>
 
54
  <xsl:param name="expander" select="$node/mal:title and
 
55
                                     ($node/@ui:expanded or $node/self::ui:expander)"/>
 
56
  <xsl:if test="$expander">
 
57
    <xsl:variable name="title_e" select="$node/mal:info/mal:title[@type = 'ui:expanded'][1]"/>
 
58
    <xsl:variable name="title_c" select="$node/mal:info/mal:title[@type = 'ui:collapsed'][1]"/>
 
59
    <div class="yelp-data yelp-data-ui-expander">
 
60
      <xsl:attribute name="dir">
 
61
        <xsl:call-template name="l10n.direction"/>
 
62
      </xsl:attribute>
 
63
      <xsl:attribute name="data-yelp-expanded">
 
64
        <xsl:choose>
 
65
          <xsl:when test="$node/self::ui:expander/@expanded = 'no'">
 
66
            <xsl:text>no</xsl:text>
 
67
          </xsl:when>
 
68
          <xsl:when test="$node/@ui:expanded = 'no'">
 
69
            <xsl:text>no</xsl:text>
 
70
          </xsl:when>
 
71
          <xsl:otherwise>
 
72
            <xsl:text>yes</xsl:text>
 
73
          </xsl:otherwise>
 
74
        </xsl:choose>
 
75
      </xsl:attribute>
 
76
      <xsl:if test="$title_e">
 
77
        <div class="yelp-title-expanded">
 
78
          <xsl:apply-templates mode="mal2html.inline.mode" select="$title_e/node()"/>
 
79
        </div>
 
80
      </xsl:if>
 
81
      <xsl:if test="$title_c">
 
82
        <div class="yelp-title-collapsed">
 
83
          <xsl:apply-templates mode="mal2html.inline.mode" select="$title_c/node()"/>
 
84
        </div>
 
85
      </xsl:if>
 
86
    </div>
 
87
  </xsl:if>
 
88
</xsl:template>
 
89
 
 
90
</xsl:stylesheet>