annotate client/digitallibrary/relato/relato.xsl @ 446:323e7d7dc378

fixed problem with next/prev page button in oldskin (basically my bad for not properly adapting the new dllib.js)
author robcast
date Mon, 16 Jan 2006 20:36:29 +0100
parents 41de43a00bf8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
212
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
2
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
3 <xsl:output method="xml" indent="yes" encoding="iso-8859-1"
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
4 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
5 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
6
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
7 <!-- the start -->
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
8 <xsl:template match="relato">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
9 <html xmlns="http://www.w3.org/1999/xhtml">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
10 <head>
223
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
11 <script type="text/javascript" src="relato/relato.js">
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
12 // this comment has to be here, otherwise xerces translates this
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
13 // empty tag to a self-closing one, which is bad for HTML that
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
14 // needs a closing script-tag
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
15 </script>
212
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
16 <script type="text/javascript">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
17 <xsl:apply-templates select="functions" />
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
18 <xsl:apply-templates select="buttons" />
223
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
19 <xsl:apply-templates select="protected" />
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
20 <xsl:apply-templates select="default" />
212
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
21 </script>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
22 </head>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
23 <xsl:apply-templates select="frames" />
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
24 </html>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
25 </xsl:template>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
26
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
27 <xsl:template match="frames">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
28 <xsl:copy-of select="frameset" />
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
29 </xsl:template>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
30
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
31 <xsl:template match="functions">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
32 <xsl:for-each select="function">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
33 function <xsl:value-of select="@name" />() {
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
34 if (frameSelected()) {
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
35 <xsl:for-each select="validInFrame">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
36 if (nameOfSelectedFrame() == "<xsl:value-of select="@name" />") {
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
37 id = selectedFrameObject();
223
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
38 if (typeof(id.<xsl:value-of select="../@name" />) == 'function') {
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
39 return id.<xsl:value-of select="../@name" />(<xsl:value-of select="../@name" />.arguments[0], <xsl:value-of select="../@name" />.arguments[1], <xsl:value-of select="../@name" />.arguments[2], <xsl:value-of select="../@name" />.arguments[3]);
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
40 }
212
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
41 }
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
42 </xsl:for-each>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
43 } else {
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
44 <xsl:choose>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
45 <xsl:when test="not(@quiet = 'true')">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
46 // alert message
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
47 noFrameSelected();
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
48 </xsl:when>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
49 <xsl:otherwise>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
50 // be quiet
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
51 return false;
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
52 </xsl:otherwise>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
53 </xsl:choose>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
54 }
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
55 }
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
56 </xsl:for-each>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
57 </xsl:template>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
58
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
59 <xsl:template match="buttons">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
60 function dynamicButtons() {
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
61 var btns = '';
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
62 <xsl:for-each select="button">
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
63 btns += '#<xsl:value-of select="@name" />|<xsl:value-of select="@command" />';</xsl:for-each>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
64 return btns.slice(1);
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
65 }
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
66 </xsl:template>
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
67
223
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
68 <xsl:template match="protected">
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
69 function protectedFrames() {
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
70 var frames = new Array ();
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
71 <xsl:for-each select="frame">
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
72 frames.push('<xsl:value-of select="@name" />');</xsl:for-each>
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
73 return frames;
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
74 }
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
75 </xsl:template>
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
76
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
77 <xsl:template match="default">
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
78 top.focused.name = '<xsl:value-of select="frame/@name" />';
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
79 </xsl:template>
41de43a00bf8 new relato import
luginbue
parents: 212
diff changeset
80
212
f1631db2ff3d relato juhuii
luginbue
parents:
diff changeset
81 </xsl:stylesheet>