Changeset 32072

Show
Ignore:
Timestamp:
16.11.2017 15:06:55 (2 years ago)
Author:
kjdon
Message:

as we are now no longer including <gsf:metadata='all' in the xslt, we need to make sure Thumb metadata is loaded for teh document_scripts javascript. It doesn't work putting it into the inline template as this is processed after all the metadata is gotten for the page

Location:
main/trunk/greenstone3/web/interfaces/default
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js

    r32066 r32072  
    11/** Javascript file for viewing documents */ 
     2 
     3/** NOTE, this file uses inline templates which look for httpPath, assocfilepath, Source, Thumb, Title metadata. These need to be added into any xsl file that uses this javascript (using <gsf:metadata name="xx" hidden="true"/> if they are not already being collected. */ 
    24 
    35var _imageZoomEnabled = false; 
     
    855857     
    856858    var getImage = function(page, attemptNumber) 
    857     { 
     859    { 
    858860        var href = page.getAttribute("href"); 
    859861        var startHREF = href.indexOf("'") + 1; 
     
    864866        var template = ''; 
    865867        template += '<xsl:template match="/">'; 
    866         template +=   '<gsf:metadata name=\"Thumb\"/>'; 
    867868        template +=   '<html>'; 
    868869        template +=     '<img>'; 
     
    884885        $.ajax(url) 
    885886        .success(function(text) 
    886         { 
     887             { 
    887888            var hrefStart = text.indexOf("src=\"") + 5; 
    888889            if(hrefStart == -1) 
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r32065 r32072  
    251251    <xsl:template name="javascriptForDocumentView"> 
    252252        <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script> 
     253      <gsf:metadata name="Thumb" hidden="true"/> 
    253254        <script type="text/javascript"> 
    254255            <xsl:text disable-output-escaping="yes">