Changeset 35171 for main


Ignore:
Timestamp:
2021-05-20T14:14:47+12:00 (3 years ago)
Author:
kjdon
Message:

when we are doing search term highlighting, and we want it in the section titles, need to make sure that p.s argument is added, otherwise the ajax calls don't know that they should be doing search term highlighting

File:
1 edited

Legend:

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

    r33184 r35171  
    115115
    116116    template = makeURLComponentSafe(template);
    117     var url = gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?ilt=" + template;
     117    var url = gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?ilt=" + template;
     118
     119    if (gs.cgiParams.p_s && gs.cgiParams.p_s.length > 0) {
     120    url += "&p.s=" + gs.cgiParams.p_s;
     121    }
    118122
    119123       if(gs.documentMetadata.docType == "paged")
     
    443447        if(gs.cgiParams.d && gs.cgiParams.d.length > 0)
    444448        {
    445             url += "&d=" + gs.cgiParams.d.replace(/([^.]*)\..*/, "$1");
     449            url += "&d=" + gs.cgiParams.d.replace(/([^.]*)\..*/, "$1");
     450            // in case we are doing search term highlighting, want p.s here too (e/g/ p.s=TextQuery)
     451            if (gs.cgiParams.p_s && gs.cgiParams.p_s.length > 0) {
     452            url += "&p.s=" + gs.cgiParams.p_s;
     453            }
     454           
    446455        }
    447456        else if(gs.cgiParams.href && gs.cgiParams.href.length > 0)
     
    688697    ilt = makeURLComponentSafe(ilt);
    689698
    690 
    691     var url = gs.xsltParams.library_name + "?a=d&ec=1&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&ilt=" + ilt;
     699    var url = gs.xsltParams.library_name + "?a=d&ec=1&c=" + gs.cgiParams.c + "&d=" + gs.cgiParams.d + "&ilt=" + ilt;
     700
     701    if (gs.cgiParams.p_s && gs.cgiParams.p_s.length > 0) {
     702    url += "&p.s=" + gs.cgiParams.p_s;
     703    }
    692704
    693705    $.ajax(url)
Note: See TracChangeset for help on using the changeset viewer.