Changeset 31531

Show
Ignore:
Timestamp:
23.03.2017 11:28:55 (2 years ago)
Author:
kjdon
Message:

expand and contract doc links are now outside the toc and generated in the page so that google can see them. link to get tableofcontents data now uses ec=1 instead of ed=1 - we don't need the text content of each section just to make toc

Files:
1 modified

Legend:

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

    r31523 r31531  
    559559     
    560560    var url = "cgi-bin/document-extract.pl?a=extract-archives-doc&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&json-sections=" + sectionString + "&site=" + gs.xsltParams.site_name;// + "&json-metadata=[{"metaname":"dc.Title","metavalue":"All Black Rugy Success","metamode":"accumulate"]" 
    561     $("#extractDocButton").attr("disabled", "disabled").html("Exracting document..."); 
     561    $("#extractDocButton").attr("disabled", "disabled").html("Extracting document..."); 
    562562    $.ajax(url) 
    563563    .success(function(response) 
     
    639639    ilt += '</xsl:template>'; 
    640640     
    641     var url = gs.xsltParams.library_name + "?a=d&ed=1&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&ilt=" + ilt.replace(/ /g, "%20"); 
     641    var url = gs.xsltParams.library_name + "?a=d&ec=1&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&ilt=" + ilt.replace(/ /g, "%20"); 
    642642 
    643643    $.ajax(url) 
    644644    .success(function(response) 
    645645    { 
    646         $("#tableOfContents").html(response); 
    647         replaceLinksWithSlider(); 
    648         addExpandContractButtons(); 
    649         var loading = $("#tocLoadingImage"); 
    650         loading.remove(); 
     646        var tableOfContents = $("#tableOfContents"); 
     647        tableOfContents.append(response); 
     648        replaceLinksWithSlider(); 
     649         
     650        var loading = $("#tocLoadingImage"); 
     651        loading.remove(); 
    651652    }) 
    652653    .error(function() 
     
    656657} 
    657658 
    658 function addExpandContractButtons()  
    659 { 
    660     var tableOfContents = $("#tableOfContents"); 
    661     var table = "<table style=\"width:100%; text-align:center;\"><tr><td><a href=\"javascript:expandOrCollapseAll(true);\">"+gs.text.doc.expand_doc+"</a></td><td><a href=\"javascript:expandOrCollapseAll(false);\">"+gs.text.doc.collapse_doc+"</a></td></tr></table>" ; 
    662      
    663    tableOfContents.prepend(table); 
    664  
    665 } 
     659 
    666660function replaceLinksWithSlider() 
    667661{ 
     
    870864      $(matchingTitles[i][1].cell).css("display", "table-cell"); 
    871865    } 
    872 } 
     866    } 
    873867 
    874868    var setUpFilterBox = function()