Changeset 37053
- Timestamp:
- 2022-12-23T11:24:13+13:00 (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r37023 r37053 20 20 21 21 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/> 22 23 <!-- 24 The 'bookswitch' variable was invented for the Flash-based Realistic Books project: 25 26 * If set to 'on' then this triggers in JavaScript loadBook(), which creates a version 27 of the document URL that sets 'bookswitch; to flashxml (&book=flashxml) 28 The Flash plugin uses this version of the URL to load in the doc for the Flash plugin 29 30 * If not set, then defaults to 'off' 31 32 * Subsequent to its invention for Realistic Books, the book/bookswitch variable has 33 been extended to other alternative (richly interative) views of the document, such 34 as with the Mirador document viewer, for IIIF compliant books 35 --> 22 36 23 37 <xsl:variable name="bookswitch"> … … 83 97 <!-- content of a simple document. Will not be used for editing mode --> 84 98 <xsl:template name="documentContent"> 85 <div id="gs-document"> 86 <xsl:call-template name="documentPre"/> 87 <xsl:call-template name="wrappedSectionImage"/> 88 <div id="gs-document-text"> 89 <xsl:call-template name="documentNodeText"/> 90 </div> 91 <xsl:call-template name="documentPost"/> 92 </div> 99 <div id="gs-document"> 100 <xsl:call-template name="documentPre"/> 101 <xsl:call-template name="wrappedSectionImage"/> 102 <div id="gs-document-text"> 103 <xsl:call-template name="documentNodeText"/> 104 </div> 105 <xsl:call-template name="documentPost"/> 106 </div> 107 </xsl:template> 108 109 <!-- For symmetry reasons, companion template to wrappedDocumentTopLevel --> 110 <xsl:template name="documentContentTopLevel"> 111 <xsl:call-template name="documentContent"/> 93 112 </xsl:template> 94 113 … … 108 127 109 128 <xsl:template name="wrappedSectionTextForEditing"> 110 < br /><br />129 <!-- <br /><br /> --> <!-- **** better to do with CSS .sectionText --> 111 130 <div id="text{@nodeID}" class="sectionText" style="display:block;"><!-- *** --> 112 131 <xsl:attribute name="contenteditable"> … … 118 137 119 138 <xsl:template name="wrappedSectionText"> 120 < br /><br />139 <!-- <br /><br /> --> <!-- **** better to do with CSS .setionText --> 121 140 122 141 <div id="text{@nodeID}" class="sectionText"><!-- *** --> … … 401 420 <!-- the page content --> 402 421 <xsl:template match="/page/pageResponse/document"> 403 <xsl:if test="$bookswitch = 'off' ">422 <xsl:if test="$bookswitch = 'off' or ($bookswitch != 'on' and $bookswitch != 'flashxml')"> <!-- true when bookswitch=mirador, for example --> 404 423 <xsl:call-template name="javascriptForDocumentView"/> 405 424 <gslib:langfrag name="doc"/> … … 409 428 if(document.URL.indexOf("book=on") != -1) 410 429 { 411 loadBook();430 loadBook(); 412 431 } 413 432 </xsl:text> … … 421 440 </xsl:if> 422 441 423 <xsl:if test="$bookswitch = 'off' ">442 <xsl:if test="$bookswitch = 'off' or ($bookswitch != 'on' and $bookswitch != 'flashxml')"> 424 443 <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div> 425 444 … … 437 456 <script type="text/javascript"> 438 457 if (keep_editing_controls_visible) { 439 $(function() {440 moveScroller();441 });458 $(function() { 459 moveScroller(); 460 }); 442 461 } 443 462 </script> … … 457 476 <xsl:when test="$bookswitch = 'on'"> 458 477 <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div> 459 <!-- *** in document-scripts.js *** -->460 478 <script type="text/javascript"> 461 479 <xsl:text disable-output-escaping="yes"> 462 480 if(document.URL.indexOf("book=on") != -1) 463 481 { 464 loadBook(); 482 <!-- in document_scripts.js --> 483 loadBook(); 465 484 } 466 485 </xsl:text> … … 489 508 <xsl:when test="@docType='simple'"> 490 509 <xsl:call-template name="documentHeading"/><br/> 491 <xsl:call-template name="documentContent "/>510 <xsl:call-template name="documentContentTopLevel"/> 492 511 <br /><xsl:call-template name="userCommentsSection"/> 493 512 </xsl:when> 494 513 <xsl:otherwise> <!-- display the standard greenstone document --> 495 <xsl:call-template name="wrappedDocument "/>514 <xsl:call-template name="wrappedDocumentTopLevel"/> 496 515 <br /><xsl:call-template name="userCommentsSection"/> 497 516 </xsl:otherwise> … … 588 607 <div class="clear"><xsl:text> </xsl:text></div> 589 608 </xsl:template> 609 610 <!-- 611 The follow is a useful template to redefine in an interface/site/collection 612 through which extra tests can be introduced to drive new document displays, 613 such as the IIIF Manifest based Mirador viewer 614 --> 615 <xsl:template name="wrappedDocumentTopLevel"> 616 <xsl:call-template name="wrappedDocument"/> 617 </xsl:template> 590 618 591 619 <xsl:template name="editBar"> … … 640 668 <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable> 641 669 <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable> 670 <gsf:variable name="docNodeID"><xsl:value-of select="@nodeID"/></gsf:variable> <!-- used to make each 'tidyDiv' unique --> 642 671 643 672 <xsl:choose> 644 673 <!-- **** Should the test of 'Source' perhaps be changed to 'Image' to be more consistent with usage else where for showing an web friendy Image--> 645 <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'Source']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')">646 <gsf:div id="tidyDiv " />674 <xsl:when test="metadataList/metadata[@name = 'Screen'] and (metadataList/metadata[@name = 'Source'] or metadataList/metadata[@name = 'Image']) 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')"> 675 <gsf:div id="tidyDiv-{@nodeID}" /> 647 676 <!-- adding a div with clear:both when the image doesn't nicely fit in beside the side bar. Otherwise, the divs stays up, but the image moves down and everything looks and acts weird. --> 648 677 <script type="text/javascript"> … … 650 679 651 680 var containerWidth = document.getElementById("container").offsetWidth; 652 var sidebarWidth = document.getElementById("rightSidebar").offsetWidth; 653 if (containerWidth - sidebarWidth < </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) { 654 $("#tidyDiv").css("clear", "both"); 681 var rightSidebar = document.getElementById("rightSidebar"); 682 if (rightSidebar) { 683 var rightSidebarWidth = rightSidebar.offsetWidth; 684 if (containerWidth - rightSidebarWidth < </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) { 685 $("#tidyDiv-"+gs.variables.docNodeID).css("clear", "both"); 686 } 655 687 } 656 688 </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.