Changeset 34093

Show
Ignore:
Timestamp:
22.03.2020 23:09:20 (9 days ago)
Author:
davidb
Message:

update to validateQuickSearchForm; google-analytics/tags refinement; tidy up on berry/favourite Basket

Location:
main/trunk/model-interfaces-dev/heritage-nz/transform
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/heritage-nz/transform/layouts/header.xsl

    r33268 r34093  
    7575      <xsl:choose> 
    7676        <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'"> 
    77           <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery"> 
     77          <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery" onsubmit="return validateQuickSearchForm()"> 
    7878        <!-- This parameter says that we have come from the quick search area --> 
    7979        <input type="hidden" name="qs" value="1"/> 
  • main/trunk/model-interfaces-dev/heritage-nz/transform/layouts/main.xsl

    r33272 r34093  
    3737              </gsf:script> 
    3838 
     39              <gsf:script> 
     40                function gtag_trigger_download_event(elem,source_file) { 
     41                  gtag('event', 'download_report', { 'event_category' : 'download', 'event_label': source_file }); 
     42                } 
     43 
     44                function gtag_trigger_search_event(query) { 
     45                  gtag('event', 'search', { 'search_term': query }); 
     46                } 
     47 
     48                function validateQuickSearchForm() { 
     49                  var $query = $('#quicksearcharea input[name="s1.query"]'); 
     50                  if ($query.length > 0) { 
     51                    var query = $query.val(); 
     52                    if (query != "" ) { 
     53                      gtag_trigger_search_event(query); 
     54                  return true; 
     55                } 
     56                  } 
     57                  return false; 
     58                } 
     59 
     60 
     61                function validateAdvancedSearchForm() { 
     62                  var $query = $('#quicksearcharea input[name="s1.query"]'); 
     63 
     64                  var $query_term_elems = $('form[name="QueryForm"] input[name="s1.fqv"]'); 
     65 
     66                  if ($query_term_elems.length > 0) { 
     67 
     68                    var query_terms = []; 
     69                $query_term_elems.each(function() {  
     70                  var q = $(this).val();  
     71                  if (q != "") {  
     72                    query_terms.push(q)  
     73                  } 
     74                }); 
     75 
     76                    var query = query_terms.join(' '); 
     77                    if (query != "" ) { 
     78                      gtag_trigger_search_event(query); 
     79                  return true; 
     80                } 
     81                  } 
     82 
     83                  return false; 
     84                } 
     85              </gsf:script> 
     86               
    3987                <!-- ***** in header.xsl ***** --> 
    4088                <xsl:call-template name="create-html-header"/> 
     
    84132 
    85133                  #gs_footer { 
     134                    font-size: 90%; 
     135                  } 
     136/* 
     137                  #gs_footer { 
    86138                    position: absolute; 
    87139                    bottom: -30px; 
     
    89141                    width: 99.8%; 
    90142                  } 
    91  
     143*/ 
    92144                  #quicksearcharea ul { 
    93145                    margin-top: 10px; 
  • main/trunk/model-interfaces-dev/heritage-nz/transform/pages/berry.xsl

    r33269 r34093  
    1010   
    1111  <!-- set page title --> 
    12   <xsl:template name="pageTitle"><a href="{$library_name}/collection/pdf-reports/page/about">Digital Library Home</a><gslib:rightArrow/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.title')"/></xsl:template> 
     12  <xsl:template name="pageTitle"><a href="{$library_name}/collection/pdf-reports/page/about">Digital Library Home</a><gslib:rightArrow/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.title')"/></xsl:template> 
     13 
     14  <!-- optional cgi-params for links to document pages --> 
     15  <!-- here because collectionConfig.xml defined a template in 
     16       its *global* section that uses gsf:link, which in turn then 
     17       generates XSL tags that refer to opt-doc-link-arg --> 
     18  <!-- not strictly necessary in berry.xsl as currently used 
     19       in the HeritageDL, which is to access the berryBasket/favouriteBasket 
     20       without a c=xxx argument, and so doesn't draw in the 
     21       collectionConfig.xml file, however added here as a catch-all 
     22       in case this changes in the future and c=xxxx added in --> 
     23 
     24  <xsl:variable name="opt-doc-link-args"></xsl:variable> 
    1325 
    1426  <xsl:template name="customJavascript"> 
  • main/trunk/model-interfaces-dev/heritage-nz/transform/pages/classifier.xsl

    r33271 r34093  
    4444    <xsl:comment>Filler needed for div</xsl:comment> 
    4545    <xsl:call-template name="viewOptions"/> 
    46     <xsl:if test="$berryBasketOn or $favouritesBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))"> 
     46    <xsl:if test="$berryBasketOn or $favouriteBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))"> 
    4747      <xsl:if test="$berryBasketOn"> 
    4848        <!-- show the berry basket if it's turned on --> 
     
    5353      </xsl:if> 
    5454 
    55       <xsl:if test="$favouritesBasketOn"> 
     55      <xsl:if test="$favouriteBasketOn"> 
    5656        <!-- show the favourites 'basket' if it's turned on --> 
    5757        <div class="tableOfContentsContainer" style="position:relative; z-index: 2;"> <!-- **** --> 
  • main/trunk/model-interfaces-dev/heritage-nz/transform/pages/query.xsl

    r33271 r34093  
    2222--> 
    2323<!-- **** --> 
    24     <div id="float-anchor" style="position: absolute; width: 29%; min-width:180px; top: 105px; right:20px; margin: 0 0 10px 20px;"> 
     24    <div id="float-anchor" style="position: absolute; width: 29%; min-width:180px; /*top: 105px;*/ right:20px; margin: 0 0 10px 20px;"> 
    2525      <xsl:comment>Filler needed for div</xsl:comment> 
    26       <xsl:call-template name="viewOptions"/> 
     26     <!-- <xsl:call-template name="viewOptions"/>--> 
    2727 
    28       <xsl:if test="$berryBasketOn or $favouritesBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))"> 
     28      <xsl:if test="$berryBasketOn or $favouriteBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))"> 
    2929    <div id="rightSidebar" style="margin: 0 0 5px 5px; width: 100%"> 
    3030<!-- 
     
    4646      </xsl:if> 
    4747 
    48       <xsl:if test="$favouritesBasketOn"> 
     48      <xsl:if test="$favouriteBasketOn"> 
    4949        <!-- show the favourites 'basket' if it's turned on --> 
    5050        <div class="tableOfContentsContainer" style="position:relative; z-index: 2;"> <!-- **** --> 
     
    127127--> 
    128128<!-- **** --> 
    129             <div id="facetSelector" style="position: relative; float: right; top: 100px;"> 
     129            <div id="facetSelector" style="position: relative; float: right; top: 100px;"><b>Refine Your Search:</b> 
    130130                <xsl:for-each select="/page/pageResponse/facetList/facet"> 
    131131                    <xsl:if test="count(count) > 0"> 
  • main/trunk/model-interfaces-dev/heritage-nz/transform/pages/verify.xsl

    r33270 r34093  
    1111  <xsl:template name="pageTitle"><a href="{$library_name}/collection/pdf-reports/page/about">Digital Library Home</a><gslib:rightArrow/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'verify.title')"/></xsl:template> 
    1212 
     13  <!-- optional cgi-params for links to document pages --> 
     14  <!-- needed here because collectionConfig.xml defined a template in 
     15       its *global* section that uses gsf:link, which in turn then 
     16       generates XSL tags that refer to opt-doc-link-arg --> 
     17  <xsl:variable name="opt-doc-link-args"></xsl:variable> 
     18 
    1319</xsl:stylesheet>