- Timestamp:
- 2018-10-09T15:49:21+13:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r32133 r32504 444 444 var docID = sectionID.replace(/([^.]*)\..*/, "$1"); 445 445 var url = gs.xsltParams.library_name + "?a=d&c=" + gs.cgiParams.c + "&excerptid=gs-document&dt=hierarchy&d=" + docID; 446 if(gs.cgiParams.p_s) { 447 url += "&p.s="+gs.cgiParams.p_s; 448 } 446 449 loadTopLevelPage(callbackFunction, url); 447 450 }); … … 530 533 </xsl:template> 531 534 532 <!-- Highlight annotations if requested --> 533 <xsl:template name="displayAnnotation"> 534 <xsl:choose> 535 <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off' or /page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true'"> 536 <span class="noTermHighlight"><xsl:value-of select="."/></span> 537 </xsl:when> 538 <xsl:otherwise> 539 <span class="termHighlight"><xsl:value-of select="."/></span> 540 </xsl:otherwise> 541 </xsl:choose> 542 </xsl:template> 543 535 544 536 <!-- The default template for displaying section titles --> 545 537 <xsl:template name="sectionTitle"> … … 555 547 <xsl:choose> 556 548 <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'SourceFile'] and ($imageWidth div $screenImageWidth > 1.2) and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false')"> 557 558 549 <div id="image{@nodeID}"> 559 <!-- when we ask for an individual section content we set ed=1. putting this test here prevents downloading all the screen and full images for each section of the document when we are just looking at t eh contents list-->560 <xsl:if test="/page/pageRe quest/paramList/param[@name = 'ed']/@value='1'">550 <!-- when we ask for an individual section content we set ed=1. putting this test here prevents downloading all the screen and full images for each section of the document when we are just looking at the contents list. ed is not set for simple docs, so do this if doctype is simple --> 551 <xsl:if test="/page/pageResponse/document[@docType='simple'] or /document/page/pageRequest/paramList/param[@name = 'ed']/@value='1'"> 561 552 562 553 <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;"> … … 622 613 <!-- equivalent to gsf:text --> 623 614 <xsl:template name="documentNodeText"> 615 <xsl:param name="force">1</xsl:param> 624 616 <!-- Hides the "This document has no text." message --> 625 617 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable> 626 618 <xsl:choose> 627 <xsl:when test=" not($noText = '1')">619 <xsl:when test="$force = '1' or not($noText = '1')"> 628 620 629 621 <!-- Section text --> 630 622 <xsl:for-each select="nodeContent"> 631 <xsl:for-each select="node()"> 632 <xsl:choose> 633 <xsl:when test="not(name())"> 634 <xsl:value-of select="." disable-output-escaping="yes"/> 635 </xsl:when> 636 <xsl:when test="name() = 'annotation'"> 637 <xsl:call-template name="displayAnnotation"/> 638 </xsl:when> 639 <xsl:otherwise> 640 <xsl:apply-templates/> 641 </xsl:otherwise> 642 </xsl:choose> 643 </xsl:for-each> 623 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/> 644 624 </xsl:for-each> 645 625 </xsl:when> 646 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='Image '])">626 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])"> 647 627 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> 648 628 </xsl:when> … … 651 631 </xsl:template> 652 632 633 <!-- display the text content of a node (content node or metadata node), marking up the annotations --> 634 <xsl:template name="displayMarkedUpTextAndAnnotations"> 635 <xsl:variable name="annotation_class"> 636 <xsl:choose> 637 <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off' or /page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true'">noTermHighlight</xsl:when> 638 <xsl:otherwise>termHighlight</xsl:otherwise> 639 </xsl:choose> 640 </xsl:variable> 641 <xsl:for-each select="node()"> 642 <xsl:choose> 643 <xsl:when test="not(name())"> 644 <xsl:value-of select="." disable-output-escaping="yes"/> 645 </xsl:when> 646 <xsl:when test="name() = 'annotation'"> 647 <span class="{$annotation_class}"><xsl:value-of select="."/></span> 648 </xsl:when> 649 <xsl:otherwise> 650 <xsl:apply-templates/> 651 </xsl:otherwise> 652 </xsl:choose> 653 </xsl:for-each> 654 </xsl:template> 655 656 653 657 <!-- The default template for displaying the document node text in 654 658 editing mode -->
Note:
See TracChangeset
for help on using the changeset viewer.