Changeset 26205

Show
Ignore:
Timestamp:
18.09.2012 16:43:05 (7 years ago)
Author:
sjm84
Message:

The AJAX that tries to get the page/toc dynamically will now try again when it fails

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

Legend:

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

    r26203 r26205  
    345345{ 
    346346    var ajax = gs.functions.ajaxRequest(); 
    347      
     347 
    348348    var url = gs.xsltParams.library_name + "?a=d&c=" + gs.cgiParams.c + "&excerptid=gs-document"; 
    349349    if(gs.cgiParams.d && gs.cgiParams.d.length > 0) 
     
    364364        ajax.open("GET", url, true); 
    365365    } 
     366 
    366367    ajax.onreadystatechange = function() 
    367368    { 
     
    387388        else if(ajax.readyState == 4) 
    388389        { 
    389             var targetElem = document.getElementById("gs-document"); 
    390             targetElem.innerHTML = targetElem.innerHTML + "<br/> <br/> FAILED TO LOAD PAGE"; 
     390            setTimeout(function(){loadTopLevelPage(callbackFunction, customURL);}, 1000); 
    391391        } 
    392392    }; 
     
    434434        else if(ajax.readyState == 4) 
    435435        { 
    436             var loading = document.getElementById("tocLoadingImage"); 
    437             loading.parentNode.removeChild(loading); 
    438             console.log("Error Loading TOC"); 
     436            setTimeout(retrieveFullTableOfContents, 1000); 
    439437        } 
    440438    } 
     
    605603        else if(ajax.readyState == 4) 
    606604        { 
    607             var loading = document.getElementById("tocLoadingImage"); 
    608             loading.parentNode.removeChild(loading); 
    609             console.log("Error Loading TOC"); 
     605            setTimeout(function(){retrieveTableOfContentsAndTitles();}, 1000); 
    610606        } 
    611607    } 
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r26200 r26205  
    314314        <xsl:choose> 
    315315            <!-- NOTE: alb = ajax load bypass --> 
     316            <!--  
     317                If the docType is hierarchy and the we want to bypass the ajax load then do this  
     318                OR If the docType is hierarchy and we have asked for the expanded document OR we have asked for the top level document then do this  
     319            --> 
    316320            <xsl:when test="/page/pageResponse/document/@docType = 'hierarchy' and (/page/pageRequest/paramList/param[@name = 'alb']/@value = '1' or (string-length(/page/pageRequest/paramList/param[@name = 'd']/@value) > 0 and (/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or not(util:contains(/page/pageResponse/document/@selectedNode, '.')))))"> 
    317321                <div id="gs-document">