From 0379e2677e49b4b0a9bd1fc393645840886ce046 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Mon, 10 Sep 2001 13:26:36 +0000 Subject: [PATCH] More hacking, mostly. Added support for absolutely positioned footers that works in most browsers and should be harmless in others. This should make it possible to avoid multiframe. Also added "support" for NS6 and IE6. I hope. --- slides/browser/list.js | 129 ++++++++++------- slides/browser/overlay.js | 106 ++++++++++++++ slides/browser/slides.js | 21 ++- slides/tests/.cvsignore | 1 + slides/tests/Makefile | 36 +++-- slides/tests/test.xml | 23 +++- slides/xsl/frames.xsl | 282 +++++++++++++++++++++++++++++--------- slides/xsl/slides.xsl | 241 ++++++++++++++++++++++++-------- 8 files changed, 652 insertions(+), 187 deletions(-) create mode 100644 slides/browser/overlay.js create mode 100644 slides/tests/.cvsignore diff --git a/slides/browser/list.js b/slides/browser/list.js index 3d3f0cfc6..ede93897f 100644 --- a/slides/browser/list.js +++ b/slides/browser/list.js @@ -6,6 +6,7 @@ if (parseInt(navigator.appVersion.charAt(0)) >= 4) { isNav4 = (navigator.appName == "Netscape") ? true : false; isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? true : false; } + function List(visible, width, height, bgColor) { this.setIndent = setIndent; this.addItem = addItem; @@ -44,11 +45,20 @@ function List(visible, width, height, bgColor) { else this.bgColor = null; _mLists[_id++] = this; } + function _listSetFont(i,j) { this.fontIntro = i; this.fontOutro = j; } -function setIndent(indent) { this.i = indent; if(this.i < 0) { this.i = 0; this.space = false; } } + +function setIndent(indent) { + this.i = indent; + if (this.i < 0) { + this.i = 0; + this.space = false; + } +} + function setClip(layer, l, r, t, b) { if(isNav4) { layer.clip.left = l; layer.clip.right = r; @@ -59,38 +69,44 @@ function setClip(layer, l, r, t, b) { layer.style.clip = "rect("+t+","+r+","+b+","+l+")"; } } + function _writeList() { - self.status = "List: Writing list..."; - var layer, str, clip; - for(var i = 0; i < this.types.length; i++) { - layer = this.items[i]; - if(isNav4) layer.visibility = "hidden"; - else layer.style.visibility = "hidden"; - str = ""; - if(isNav4) layer.document.open(); - str += ""; - if(this.types[i] == "list") { - str += ""; - _pid++; - } else if(this.space) - str += ""; - if(this.l>0 && this.i>0) str += ""; - str += "
  "; - if(this.fontIntro) str += this.fontIntro; - str += this.strs[i]; - if(this.fontOutro) str += this.fontOutro; - str += "
"; - if(isNav4) { - layer.document.writeln(str); - layer.document.close(); - } else layer.innerHTML = str; - if(this.types[i] == "list" && this.lists[i].visible) - this.lists[i]._writeList(); - } - this.built = true; - this.needsRewrite = false; - self.status = ''; + self.status = "List: Writing list..."; + var layer, str, clip; + for (var i = 0; i < this.types.length; i++) { + layer = this.items[i]; + if (isNav4) layer.visibility = "hidden"; + else layer.style.visibility = "hidden"; + str = ""; + + alert(layer); + + if(isNav4) layer.document.open(); + + str += ""; + if(this.types[i] == "list") { + str += ""; + _pid++; + } else if(this.space) + str += ""; + if(this.l>0 && this.i>0) str += ""; + str += "
  "; + if(this.fontIntro) str += this.fontIntro; + str += this.strs[i]; + if(this.fontOutro) str += this.fontOutro; + str += "
"; + if(isNav4) { + layer.document.writeln(str); + layer.document.close(); + } else layer.innerHTML = str; + if(this.types[i] == "list" && this.lists[i].visible) + this.lists[i]._writeList(); + } + this.built = true; + this.needsRewrite = false; + self.status = ''; } + function _showList() { var layer; for(var i = 0; i < this.types.length; i++) { @@ -107,6 +123,7 @@ function _showList() { this.shown = true; this.needsUpdate = false; } + function _updateList(pVis, x, y) { var currTop = y, layer; for(var i = 0; i < this.types.length; i++) { @@ -142,6 +159,7 @@ function _updateList(pVis, x, y) { } return currTop; } + function _updateParent(pid, l) { var layer; if(!l) l = 0; @@ -151,43 +169,57 @@ function _updateParent(pid, l) { if(this.types[i] == "list") this.lists[i]._updateParent(pid, l+1); } + function expand(i) { _mLists[i].visible = !_mLists[i].visible; if(_mLists[i].onexpand != null) _mLists[i].onexpand(_mLists[i].id); _mLists[_mLists[i].pid].rebuild(); if(_mLists[i].postexpand != null) _mLists[i].postexpand(_mLists[i].id); } + function build(x, y) { + alert("got here1"); + this._updateParent(this.id); this._writeList(); this._showList(); this._updateList(true, x, y); this.x = x; this.y = y; } -function rebuild() { this._updateList(true, this.x, this.y); } + +function rebuild() { + this._updateList(true, this.x, this.y); +} + function addItem(str, bgColor, layer) { - var testLayer = false; - if(!document.all) document.all = document.layers; - if(!layer) { - if(isIE4 || !this.parLayer) testLayer = eval('document.all.lItem'+_lid); - else { - _pLayer = this.parLayer; - testLayer = eval('_pLayer.document.layers.lItem'+_lid); + var testLayer = false; + if(!document.all) document.all = document.layers; + if(!layer) { + if(isIE4 || !this.parLayer) { + alert('document.all.lItem'+_lid); + testLayer = eval('document.all.lItem'+_lid); + } else { + _pLayer = this.parLayer; + testLayer = eval('_pLayer.document.layers.lItem'+_lid); + } + if(testLayer) { + layer = testLayer; + } else { + if(isNav4) { + if(this.parLayer) layer = new Layer(this.width, this.parLayer); + else layer = new Layer(this.width); + } else { + return; + } + } } - if(testLayer) layer = testLayer; - else { - if(isNav4) { - if(this.parLayer) layer = new Layer(this.width, this.parLayer); - else layer = new Layer(this.width); - } else return; - } - } if(bgColor) layer.oBgColor = bgColor; this.items[this.items.length] = layer; this.types[this.types.length] = "item"; this.strs[this.strs.length] = str; _lid++; } + function addList(list, str, bgColor, layer) { var testLayer = false; if(!document.all) document.all = document.layers; @@ -212,4 +244,5 @@ function addList(list, str, bgColor, layer) { this.strs[this.strs.length] = str; list.parent = this; _lid++; -} \ No newline at end of file +} + diff --git a/slides/browser/overlay.js b/slides/browser/overlay.js new file mode 100644 index 000000000..11cd1babd --- /dev/null +++ b/slides/browser/overlay.js @@ -0,0 +1,106 @@ +/* Overlay.js, adapted from Floating image II on dynamicdrive.com */ +/* Usage: + + + +...rest of head... + + +
+...body of overlay... +
+...rest of page... +*/ + +var overlayLx = 0; +var overlayLy = 0; + +var overlayNS4 = document.layers ? 1 : 0; +var overlayIE = document.all ? 1 : 0; +var overlayNS6 = document.getElementById && !document.all ? 1 : 0; + +var overlayX = 0; +var overlayY = 0; +var overlayW = 0; +var overlayH = 0; +var overlayPadX = 15; +var overlayPadY = 5; + +var overlayDelay=60; + +var overlayCorner = 'ur'; // ul, ll, ur, lr, uc, lc, cl, cr + +function overlayRefresh() { + if (overlayIE) { + overlayLx = document.body.clientWidth; + overlayLy = document.body.clientHeight; + overlayH = overlayDiv.offsetHeight; + overlayW = overlayDiv.offsetWidth; + } else if (overlayNS4) { + overlayLy = window.innerHeight; + overlayLx = window.innerWidth; + overlayH = document.overlayDiv.clip.height; + overlayW = document.overlayDiv.clip.width; + } else if (overlayNS6) { + overlayLy = window.innerHeight; + overlayLx = window.innerWidth; + overlayH = document.getElementById('overlayDiv').offsetHeight; + overlayW = document.getElementById('overlayDiv').offsetWidth; + } + + if (overlayCorner == 'ul') { + overlayX = overlayPadX; + overlayY = overlayPadY; + } else if (overlayCorner == 'cl') { + overlayX = overlayPadX; + overlayY = (overlayLy - overlayH) / 2; + } else if (overlayCorner == 'll') { + overlayX = overlayPadX; + overlayY = (overlayLy - overlayH) - overlayPadY; + } else if (overlayCorner == 'ur') { + overlayX = (overlayLx - overlayW) - overlayPadX; + overlayY = overlayPadY; + } else if (overlayCorner == 'cr') { + overlayX = (overlayLx - overlayW) - overlayPadX; + overlayY = (overlayLy - overlayH) / 2; + } else if (overlayCorner == 'lr') { + overlayX = (overlayLx - overlayW) - overlayPadX; + overlayY = (overlayLy - overlayH) - overlayPadY; + } else if (overlayCorner == 'uc') { + overlayX = (overlayLx - overlayW) / 2; + overlayY = overlayPadY; + } else { // overlayCorner == 'lc' + overlayX = (overlayLx - overlayW) / 2; + overlayY = (overlayLy - overlayH) - overlayPadY; + } + + if (overlayIE) { + overlayDiv.style.left=overlayX; + overlayDiv.style.top=overlayY+document.body.scrollTop; + } else if (overlayNS4) { + document.overlayDiv.pageX=overlayX; + document.overlayDiv.pageY=overlayY+window.pageYOffset; + document.overlayDiv.visibility="visible"; + } else if (overlayNS6) { + var div = document.getElementById("overlayDiv"); + div.style.left=overlayX; + div.style.top=overlayY+window.pageYOffset; + } +} + +function onad() { + loopfunc(); +} + +function loopfunc() { + overlayRefresh(); + setTimeout('loopfunc()',overlayDelay); +} + +function overlaySetup(corner) { + overlayCorner = corner; + + if (overlayIE || overlayNS4 || overlayNS6) { + onad(); + } +} diff --git a/slides/browser/slides.js b/slides/browser/slides.js index cb6f0068b..e9a9ad896 100644 --- a/slides/browser/slides.js +++ b/slides/browser/slides.js @@ -5,10 +5,20 @@ function selectBrowser() { var browserVersion = parseFloat(navigator.appVersion); var userAgent = navigator.userAgent;; + if (browserName == "Netscape" && browserVersion>=5) { + // Netscape 6 is Mozilla 5 + return "ns6"; + } + if (browserName == "Netscape" && browserVersion>=4) { return "ns4"; } + if (browserName == "Microsoft Internet Explorer" + && userAgent.indexOf("MSIE 6") > 0) { + return "ie6"; + } + if (browserName == "Microsoft Internet Explorer" && userAgent.indexOf("MSIE 5") > 0) { return "ie5"; @@ -17,11 +27,16 @@ function selectBrowser() { return null; } -function newPage(filename) { - if (selectBrowser() != "ie5") { +function newPage(filename,overlay) { + if (selectBrowser() != "ie5" + && selectBrowser() != "ie6") { return; } + if (overlay != 0) { + overlaySetup('ll'); + } + var parent = self.parent; var gparent = null; @@ -48,7 +63,7 @@ function newPage(filename) { } } -function navigate (bk,fw) { +function navigate (bk,fw,overlay) { var frame = window; if (frame.name != "foil") { frame = frame.parent; diff --git a/slides/tests/.cvsignore b/slides/tests/.cvsignore new file mode 100644 index 000000000..2d19fc766 --- /dev/null +++ b/slides/tests/.cvsignore @@ -0,0 +1 @@ +*.html diff --git a/slides/tests/Makefile b/slides/tests/Makefile index 639947ce1..a80c7078d 100644 --- a/slides/tests/Makefile +++ b/slides/tests/Makefile @@ -1,33 +1,41 @@ include ../../cvstools/Makefile.incl -HTMLSTYLE=../xsl/slides.xsl +NOFRAMESTYLE=../xsl/slides.xsl +FRAMESTYLE=../xsl/frames.xsl FOSTYLE=../xsl/fo-plain.xsl VARS= FORMATTER=xep BROWSER= MULTIFRAME=0 +FRAMES=0 +OVERLAY=1 TIDY=1 -all: - @echo Select a target +ifeq ($(FRAMES),0) + HTMLSTYLE=$(NOFRAMESTYLE) +else + HTMLSTYLE=$(FRAMESTYLE) +endif -test: test.xml - $(XJPARSE) test.xml ifeq ($(BROWSER),) - $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME) + PARAMS=$(VARS) multiframe=$(MULTIFRAME) overlay=$(OVERLAY) else - $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) + PARAMS=$(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) overlay=$(OVERLAY) endif -testcust: - $(XJPARSE) test.xml +all: + @echo Select a target + +test: test.xml + $(XJPARSE) $< + $(XSLT) $< $(HTMLSTYLE) $(PARAMS) + make tidy dbgentext: dbgentext.xml $(XJPARSE) $< -ifeq ($(BROWSER),) - $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) multiframe=$(MULTIFRAME) -else - $(XSLT) $< $(HTMLSTYLE) /dev/null $(VARS) $(BROWSER)=1 multiframe=$(MULTIFRAME) -endif + $(XSLT) $< $(HTMLSTYLE) $(PARAMS) + make tidy + +tidy: ifeq ($(TIDY),1) for i in *.html; do \ if [ "$$i" != "ns4toc.html" ] ; then \ diff --git a/slides/tests/test.xml b/slides/tests/test.xml index 02d4750f8..f5400ea02 100644 --- a/slides/tests/test.xml +++ b/slides/tests/test.xml @@ -3,17 +3,36 @@ Test Slides Title + 2001Norman Walsh -Test Slides Title +
Section 1 + +Test Slides Title 1 +... + + +Test Slides Title 2 +... + +this is a screen + + + +
+
Section 2 + +Test Slides Title 1 ... -Test Slides Title +Test Slides Title 2 ... this is a screen +
+
diff --git a/slides/xsl/frames.xsl b/slides/xsl/frames.xsl index ea08fac77..025bfe4fd 100644 --- a/slides/xsl/frames.xsl +++ b/slides/xsl/frames.xsl @@ -6,8 +6,8 @@ - - + + @@ -27,6 +27,12 @@ + + + Multiframe and overlay are mutually exclusive. + + + @@ -38,7 +44,8 @@ - <body class="frameset" xsl:use-attribute-sets="body-attrs"> + <body class="frameset"> + <xsl:call-template name="body.attributes"/> <a href="titleframe.html"> <xsl:text>Your browser doesn't support frames.</xsl:text> </a> @@ -66,9 +73,16 @@ <xsl:call-template name="slides.js"/> </xsl:attribute> </script> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="toc" xsl:use-attribute-sets="body-attrs" - onload="newPage('toc.html');"> + <body class="toc" onload="newPage('toc.html',{$overlay});"> + <xsl:call-template name="body.attributes"/> <div class="toc"> <xsl:apply-templates mode="toc"/> </div> @@ -124,8 +138,8 @@ function init() { </xsl:text> </style> </head> - <body class="toc" xsl:use-attribute-sets="body-attrs" - onload="init();"> + <body class="toc" onload="init({$overlay});"> + <xsl:call-template name="body.attributes"/> <div id="spacer"></div> </body> </html> @@ -165,8 +179,16 @@ if (selectBrowser() == "ie5") { ]]></xsl:text> </xsl:if> </script> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="toc" xsl:use-attribute-sets="body-attrs"> + <body class="toc"> + <xsl:call-template name="body.attributes"/> <div class="toc"> <xsl:apply-templates mode="toc"/> </div> @@ -180,7 +202,8 @@ if (selectBrowser() == "ie5") { <xsl:template match="slidesinfo"> <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename" select="concat($base.dir,$titlefoil.html)"/> + <xsl:with-param name="filename" + select="concat($base.dir,$titlefoil.html)"/> <xsl:with-param name="content"> <html> <head> @@ -197,25 +220,58 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> - </head> - <body class="titlepage" xsl:use-attribute-sets="body-attrs"> - <xsl:if test="$ie5!='0'"> - <xsl:attribute name="onload"> - <xsl:text>newPage('</xsl:text> - <xsl:value-of select="$titlefoil.html"/> - <xsl:text>');</xsl:text> - </xsl:attribute> - <xsl:attribute name="onkeypress"> - <xsl:text>navigate('','foil01.html');</xsl:text> - </xsl:attribute> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> </xsl:if> + </head> + <body class="titlepage"> + <xsl:call-template name="body.attributes"/> + <xsl:choose> + <xsl:when test="$ie5 != 0"> + <xsl:attribute name="onload"> + <xsl:text>newPage('</xsl:text> + <xsl:value-of select="$titlefoil.html"/> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>);</xsl:text> + </xsl:attribute> + <xsl:attribute name="onkeypress"> + <xsl:text>navigate('','foil01.html',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> + </xsl:attribute> + </xsl:when> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:when> + </xsl:choose> <div class="{name(.)}"> <xsl:apply-templates mode="titlepage.mode"/> </div> <xsl:choose> <xsl:when test="$multiframe=0"> - <div class="navfoot" style="padding-top: 2in;"> + <div id="overlayDiv" class="navfoot"> + <xsl:choose> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + <hr/> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="style"> + <xsl:text>padding-top: 2in;</xsl:text> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Navigation"> @@ -311,6 +367,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <xsl:choose> <xsl:when test="$multiframe != 0"> @@ -348,7 +411,8 @@ if (selectBrowser() == "ie5") { <frame src="body-{$thissection}" name="body" marginheight="0" frameborder="0"/> <frame src="bot-{$thissection}" name="bottom" marginheight="0" scrolling="no" frameborder="0"/> <noframes> - <body class="frameset" xsl:use-attribute-sets="body-attrs"> + <body class="frameset"> + <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> @@ -382,6 +446,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <body class="navigation" bgcolor="{$multiframe.top.bgcolor}"> <xsl:call-template name="section-top-nav"> @@ -442,6 +513,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> <style type="text/css">div.section { margin-top: 3em }</style> </head> <xsl:apply-templates select="." mode="singleframe"/> @@ -498,6 +576,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <body class="navigation" bgcolor="{$multiframe.bottom.bgcolor}"> <xsl:call-template name="section-bottom-nav"/> @@ -537,21 +622,33 @@ if (selectBrowser() == "ie5") { </xsl:choose> </xsl:variable> - <body class="section" xsl:use-attribute-sets="body-attrs"> - <xsl:if test="$ie5!='0'"> - <xsl:attribute name="onload"> - <xsl:text>newPage('</xsl:text> - <xsl:value-of select="$thissection"/> - <xsl:text>');</xsl:text> - </xsl:attribute> - <xsl:attribute name="onkeypress"> - <xsl:text>navigate('</xsl:text> - <xsl:value-of select="$prevfoil"/> - <xsl:text>','</xsl:text> - <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> - </xsl:attribute> - </xsl:if> + <body class="section"> + <xsl:call-template name="body.attributes"/> + <xsl:choose> + <xsl:when test="$ie5 != 0"> + <xsl:attribute name="onload"> + <xsl:text>newPage('</xsl:text> + <xsl:value-of select="$thissection"/> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>);</xsl:text> + </xsl:attribute> + <xsl:attribute name="onkeypress"> + <xsl:text>navigate('</xsl:text> + <xsl:value-of select="$prevfoil"/> + <xsl:text>','</xsl:text> + <xsl:value-of select="$nextfoil"/> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> + </xsl:attribute> + </xsl:when> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:when> + </xsl:choose> <div class="{name(.)}" id="{$id}"> <a name="{$id}"/> <xsl:if test="$multiframe=0"> @@ -565,8 +662,15 @@ if (selectBrowser() == "ie5") { </div> <xsl:if test="$multiframe=0"> - <hr/> - <xsl:call-template name="section-bottom-nav"/> + <div id="overlayDiv"> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + </xsl:if> + <hr/> + <xsl:call-template name="section-bottom-nav"/> + </div> </xsl:if> </div> </body> @@ -622,6 +726,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <xsl:choose> <xsl:when test="$multiframe != 0"> @@ -676,7 +787,9 @@ if (selectBrowser() == "ie5") { <xsl:value-of select="$prevfoil"/> <xsl:text>','</xsl:text> <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> </xsl:attribute> <frame src="top-{$thisfoil}" name="top" marginheight="0" scrolling="no" frameborder="0"> <xsl:attribute name="onkeypress"> @@ -684,7 +797,9 @@ if (selectBrowser() == "ie5") { <xsl:value-of select="$prevfoil"/> <xsl:text>','</xsl:text> <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> </xsl:attribute> </frame> <frame src="body-{$thisfoil}" name="body" marginheight="0" frameborder="0"> @@ -693,7 +808,9 @@ if (selectBrowser() == "ie5") { <xsl:value-of select="$prevfoil"/> <xsl:text>','</xsl:text> <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> </xsl:attribute> </frame> <frame src="bot-{$thisfoil}" name="bottom" marginheight="0" scrolling="no" frameborder="0"> @@ -702,11 +819,14 @@ if (selectBrowser() == "ie5") { <xsl:value-of select="$prevfoil"/> <xsl:text>','</xsl:text> <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> </xsl:attribute> </frame> <noframes> - <body class="frameset" xsl:use-attribute-sets="body-attrs"> + <body class="frameset"> + <xsl:call-template name="body.attributes"/> <p> <xsl:text>Your browser doesn't support frames.</xsl:text> </p> @@ -738,6 +858,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <body class="navigation" bgcolor="{$multiframe.top.bgcolor}"> <xsl:call-template name="foil-top-nav"> @@ -773,6 +900,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <xsl:apply-templates select="." mode="singleframe"/> </html> @@ -803,6 +937,13 @@ if (selectBrowser() == "ie5") { </xsl:attribute> </script> </xsl:if> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> <body class="navigation" bgcolor="{$multiframe.bottom.bgcolor}"> <xsl:call-template name="foil-bottom-nav"/> @@ -845,21 +986,33 @@ if (selectBrowser() == "ie5") { </xsl:choose> </xsl:variable> - <body class="foil" xsl:use-attribute-sets="body-attrs"> - <xsl:if test="$ie5!='0'"> - <xsl:attribute name="onload"> - <xsl:text>newPage('</xsl:text> - <xsl:value-of select="$thisfoil"/> - <xsl:text>');</xsl:text> - </xsl:attribute> - <xsl:attribute name="onkeypress"> - <xsl:text>navigate('</xsl:text> - <xsl:value-of select="$prevfoil"/> - <xsl:text>','</xsl:text> - <xsl:value-of select="$nextfoil"/> - <xsl:text>')</xsl:text> - </xsl:attribute> - </xsl:if> + <body class="foil"> + <xsl:call-template name="body.attributes"/> + <xsl:choose> + <xsl:when test="$ie5 != 0"> + <xsl:attribute name="onload"> + <xsl:text>newPage('</xsl:text> + <xsl:value-of select="$thisfoil"/> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>);</xsl:text> + </xsl:attribute> + <xsl:attribute name="onkeypress"> + <xsl:text>navigate('</xsl:text> + <xsl:value-of select="$prevfoil"/> + <xsl:text>','</xsl:text> + <xsl:value-of select="$nextfoil"/> + <xsl:text>',</xsl:text> + <xsl:value-of select="$overlay"/> + <xsl:text>)</xsl:text> + </xsl:attribute> + </xsl:when> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:when> + </xsl:choose> <div class="{name(.)}" id="{$id}"> <a name="{$id}"/> @@ -871,8 +1024,15 @@ if (selectBrowser() == "ie5") { <xsl:apply-templates/> <xsl:if test="$multiframe=0"> - <hr/> - <xsl:call-template name="foil-bottom-nav"/> + <div id="overlayDiv"> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + </xsl:if> + <hr/> + <xsl:call-template name="foil-bottom-nav"/> + </div> </xsl:if> </div> </body> diff --git a/slides/xsl/slides.xsl b/slides/xsl/slides.xsl index 228f2f82c..b36164593 100644 --- a/slides/xsl/slides.xsl +++ b/slides/xsl/slides.xsl @@ -17,25 +17,28 @@ <xsl:param name="left.image" select="'left.gif'"/> <xsl:param name="script.dir" select="''"/> +<xsl:param name="overlay.js" select="'overlay.js'"/> <xsl:param name="slides.js" select="'slides.js'"/> <xsl:param name="list.js" select="'list.js'"/> <xsl:param name="resize.js" select="'resize.js'"/> <xsl:param name="titlefoil.html" select="'index.html'"/> +<xsl:param name="toc.html" select="'toc.html'"/> <xsl:param name="toc.bg.color">#FFFFFF</xsl:param> <xsl:param name="toc.width">250</xsl:param> <xsl:param name="toc.hide.show" select="0"/> +<xsl:param name="overlay" select="0"/> <xsl:param name="ie5" select="0"/> -<xsl:attribute-set name="body-attrs"> +<xsl:template name="body.attributes"> <xsl:attribute name="bgcolor">white</xsl:attribute> <xsl:attribute name="text">black</xsl:attribute> <xsl:attribute name="link">#0000FF</xsl:attribute> <xsl:attribute name="vlink">#840084</xsl:attribute> <xsl:attribute name="alink">#0000FF</xsl:attribute> -</xsl:attribute-set> +</xsl:template> <!-- ============================================================ --> @@ -121,6 +124,13 @@ </xsl:call-template> </xsl:template> +<xsl:template name="overlay.js"> + <!-- danger will robinson: template shadows parameter --> + <xsl:call-template name="script-file"> + <xsl:with-param name="js" select="$overlay.js"/> + </xsl:call-template> +</xsl:template> + <!-- ============================================================ --> <xsl:template match="/"> @@ -129,7 +139,7 @@ <xsl:template match="slides"> <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename" select="concat($base.dir, 'toc.html')"/> + <xsl:with-param name="filename" select="concat($base.dir, $toc.html)"/> <xsl:with-param name="content"> <html> <head> @@ -139,8 +149,22 @@ <xsl:call-template name="css-stylesheet"/> </xsl:attribute> </link> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="tocpage" xsl:use-attribute-sets="body-attrs"> + <body class="tocpage"> + <xsl:call-template name="body.attributes"/> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:if> + <h1> <a href="{$titlefoil.html}"> <xsl:value-of select="/slides/slidesinfo/title"/> @@ -148,7 +172,21 @@ </h1> <xsl:apply-templates select="." mode="toc"/> - <div class="navfoot" style="padding-top: 2in;"> + <div id="overlayDiv" class="navfoot"> + <xsl:choose> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + <hr/> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="style"> + <xsl:text>padding-top: 2in;</xsl:text> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Navigation"> @@ -185,7 +223,8 @@ <xsl:template match="slidesinfo"> <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename" select="concat($base.dir, $titlefoil.html)"/> + <xsl:with-param name="filename" + select="concat($base.dir, $titlefoil.html)"/> <xsl:with-param name="content"> <html> <head> @@ -195,14 +234,27 @@ <xsl:call-template name="css-stylesheet"/> </xsl:attribute> </link> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="titlepage" xsl:use-attribute-sets="body-attrs"> + <body class="titlepage"> + <xsl:call-template name="body.attributes"/> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:if> <div class="navhead"> <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="Navigation"> <tr> <td align="left" width="10%"> - <a href="toc.html"> + <a href="{$toc.html}"> <xsl:text>Contents</xsl:text> </a> </td> @@ -220,7 +272,21 @@ <xsl:apply-templates mode="titlepage.mode"/> </div> - <div class="navfoot" style="padding-top: 2in;"> + <div id="overlayDiv" class="navfoot"> + <xsl:choose> + <xsl:when test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + <hr/> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="style"> + <xsl:text>padding-top: 2in;</xsl:text> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Navigation"> @@ -336,8 +402,21 @@ <xsl:call-template name="css-stylesheet"/> </xsl:attribute> </link> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="section" xsl:use-attribute-sets="body-attrs"> + <body class="section"> + <xsl:call-template name="body.attributes"/> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:if> <div class="{name(.)}" id="{$id}"> <a name="{$id}"/> <xsl:call-template name="section-top-nav"/> @@ -348,8 +427,16 @@ <xsl:apply-templates select="title"/> </div> - <hr/> - <xsl:call-template name="section-bottom-nav"/> + <div id="overlayDiv"> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + </xsl:if> + + <hr/> + <xsl:call-template name="section-bottom-nav"/> + </div> </div> </body> </xsl:with-param> @@ -419,8 +506,21 @@ <xsl:call-template name="css-stylesheet"/> </xsl:attribute> </link> + <xsl:if test="$overlay != '0'"> + <script type="text/javascript" language="JavaScript"> + <xsl:attribute name="src"> + <xsl:call-template name="overlay.js"/> + </xsl:attribute> + </script> + </xsl:if> </head> - <body class="foil" xsl:use-attribute-sets="body-attrs"> + <body class="foil"> + <xsl:call-template name="body.attributes"/> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="onload"> + <xsl:text>overlaySetup('lc')</xsl:text> + </xsl:attribute> + </xsl:if> <div class="{name(.)}" id="{$id}"> <a name="{$id}"/> <xsl:call-template name="foil-top-nav"/> @@ -428,8 +528,16 @@ <xsl:apply-templates/> - <hr/> - <xsl:call-template name="foil-bottom-nav"/> + <div id="overlayDiv"> + <xsl:if test="$overlay != 0"> + <xsl:attribute name="style"> + <xsl:text>position:absolute;visibility:visible;</xsl:text> + </xsl:attribute> + </xsl:if> + + <hr/> + <xsl:call-template name="foil-bottom-nav"/> + </div> </div> </body> </xsl:with-param> @@ -633,18 +741,25 @@ </xsl:variable> <xsl:text>myList.addItem('</xsl:text> - <div id="{$id}" class="toc-slidesinfo"> - <a href="{$titlefoil.html}" target="foil"> - <xsl:choose> - <xsl:when test="titleabbrev"> - <xsl:value-of select="titleabbrev"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="title"/> - </xsl:otherwise> - </xsl:choose> - </a> - </div> + + <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text> + <xsl:value-of select="$id"/> + <xsl:text disable-output-escaping="yes">" class="toc-slidesinfo"&gt;</xsl:text> + + <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text> + <xsl:value-of select="$titlefoil.html"/> + <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text> + + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:value-of select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text> <xsl:text>');&#10;</xsl:text> </xsl:template> @@ -660,20 +775,23 @@ <xsl:apply-templates select="foil" mode="ns-toc"/> <xsl:text>myList.addList(subList, '</xsl:text> - <div class="toc-section"> - <a href="{$foil}" target="foil"> - <xsl:choose> - <xsl:when test="titleabbrev"> - <xsl:value-of select="titleabbrev"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="title"/> - </xsl:otherwise> - </xsl:choose> - </a> - </div> - <xsl:text>');&#10;</xsl:text> + <xsl:text disable-output-escaping="yes">&lt;div class="toc-section"&gt;</xsl:text> + + <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text> + <xsl:value-of select="$foil"/> + <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text> + + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:value-of select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text> + <xsl:text>');&#10;</xsl:text> </xsl:template> <xsl:template match="foil" mode="ns-toc"> @@ -691,25 +809,30 @@ </xsl:otherwise> </xsl:choose> - <div id="{$id}" class="toc-foil"> - <img alt="-"> - <xsl:attribute name="src"> - <xsl:call-template name="graphics.dir"/> - <xsl:text>/</xsl:text> - <xsl:value-of select="$bullet.image"/> - </xsl:attribute> - </img> - <a href="{$foil}" target="foil"> - <xsl:choose> - <xsl:when test="titleabbrev"> - <xsl:value-of select="titleabbrev"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="title"/> - </xsl:otherwise> - </xsl:choose> - </a> - </div> + <xsl:text disable-output-escaping="yes">&lt;div id="</xsl:text> + <xsl:value-of select="$id"/> + <xsl:text disable-output-escaping="yes">" class="toc-foil"&gt;</xsl:text> + + <xsl:text disable-output-escaping="yes">&lt;img alt="-" src="</xsl:text> + <xsl:call-template name="graphics.dir"/> + <xsl:text>/</xsl:text> + <xsl:value-of select="$bullet.image"/> + <xsl:text disable-output-escaping="yes">"&gt;</xsl:text> + + <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text> + <xsl:value-of select="$foil"/> + <xsl:text disable-output-escaping="yes">" target="foil"&gt;</xsl:text> + + <xsl:choose> + <xsl:when test="titleabbrev"> + <xsl:value-of select="titleabbrev"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:text disable-output-escaping="yes">&lt;/a&gt;&lt;/div&gt;</xsl:text> <xsl:text>');&#10;</xsl:text> </xsl:template> -- 2.40.0