Project

General

Profile

root / branches / 1.6-sc50 / model / sources / mirage / web / transf / _xxx@countDown.xsl @ 1203

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:java="http://xml.apache.org/xslt/java" xmlns:redirect="com.scenari.xsldom.xalan.lib.Redirect" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="redirect" exclude-result-prefixes="sc sp java">
3
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
4
	<xsl:param name="vDialog"/>
5
	<xsl:param name="vAgent"/>
6
	<xsl:template match="*">
7
		<xsl:if test="*/sp:countDown">
8
<script type="text/JavaScript">
9
countDownMgr.fTime = <xsl:call-template name="get_time">
10
<xsl:with-param name="pNumber" select="*/sp:countDown/*/sp:time//sp:*"/>
11
</xsl:call-template>;
12
countDownMgr.fReset = <xsl:value-of select="if(local-name()='case','false','true')"/>;
13
countDownMgr.fActionAfterCountDown = <xsl:value-of select="if(*/sp:countDown/*/sp:actionAfterCountDown//sp:next,concat('&quot;',getUrl(gotoSubModel(*/sp:countDown/*/sp:actionAfterCountDown//sp:next)),'&quot;'),if(*/sp:countDown/*/sp:actionAfterCountDown//sp:end,'&quot;end&quot;',*/sp:countDown/*/sp:actionAfterCountDown//sp:attemptsNumber))"/>;<xsl:if test="*/sp:countDown/*/sp:display">
14
countDownMgr.fDisplay = "<xsl:value-of select="*/sp:countDown/*/sp:display"/>";</xsl:if><xsl:if test="*/sp:countDown/*/sp:appearance">
15
countDownMgr.fAppearance = "<xsl:value-of select="*/sp:countDown/*/sp:appearance"/>";</xsl:if>
16
<xsl:if test="*/sp:countDown/*/sp:behavior//sp:default">
17
countDownMgr.fVisibility = "<xsl:value-of select="*/sp:countDown/*/sp:behavior//sp:default"/>";</xsl:if>
18
<xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom">
19
countDownMgr.fCustomVisibility = {<xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom/sp:firstVisibility">firstappearance:<xsl:call-template name="get_time">
20
<xsl:with-param name="pNumber" select="*/sp:countDown/*/sp:behavior//sp:custom/sp:firstVisibility/sp:*"/>
21
</xsl:call-template><xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:intervalVisibility or */sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:durationVisibility">,</xsl:if>
22
</xsl:if><xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:intervalVisibility">intervalvisibility:<xsl:call-template name="get_time">
23
<xsl:with-param name="pNumber" select="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:intervalVisibility/sp:*"/>
24
</xsl:call-template><xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:durationVisibility">,</xsl:if>
25
</xsl:if>
26
<xsl:if test="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:durationVisibility">durationvisibility:<xsl:call-template name="get_time">
27
<xsl:with-param name="pNumber" select="*/sp:countDown/*/sp:behavior//sp:custom/sp:visibilityOptions/sp:durationVisibility/sp:*"/>
28
</xsl:call-template></xsl:if>};</xsl:if>
29
</script>
30
		</xsl:if>
31
	</xsl:template>
32
	<xsl:template name="get_time">
33
		<xsl:param name="pNumber"/>
34
		<xsl:value-of select="normalize-space(if(local-name($pNumber)='second', $pNumber,if(local-name($pNumber)='minute', $pNumber * 60, $pNumber * 3600)))"/>
35
	</xsl:template>
36
</xsl:stylesheet>
(1-1/13)