Changeset 30700

Show
Ignore:
Timestamp:
12.08.2016 13:49:36 (3 years ago)
Author:
kjdon
Message:

added a span round the section title too, so that you can hide the number OR hide the heading. see en:user_advanced:gs3_custom_doc_display in wiki

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

Legend:

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

    r30478 r30700  
    10131013        if (title.search(/tocSectionNumber/) != -1) 
    10141014          { 
    1015             var matching_regex = /<span class=\"tocSectionNumber\">([0-9]+)<\/span>\s*(.+)$/;  
     1015            var matching_regex = /<span class=\"tocSectionNumber\">([0-9]+)<\/span>[\s\S]*<span class=\"tocSectionTitle\">(.+)<\/span>$/mg;  
    10161016            var matches_array = matching_regex.exec(title); 
    1017             if (matches_array.length == 3) { 
     1017            if (matches_array != null && matches_array.length == 3) { 
    10181018              t_section = matches_array[1]; 
    10191019              t_title = matches_array[2]; 
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl

    r30169 r30700  
    9797                                    <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text> 
    9898                                </div> 
    99                                 <label for="filterText"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text></label><span id="filterOnButtons" style="float: right;">xx</span><input id="filterText" type="text" style="width: 100%;"/> 
     99                                <label for="filterText"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text></label><span id="filterOnButtons" style="float: right;">...</span><input id="filterText" type="text" style="width: 100%;"/> 
    100100                                <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true'"> 
    101101                                  <a href="javascript:extractFilteredPagesToOwnDocument();"><button id="extractDocButton">Extract these pages to document</button></a> 
     
    208208                    <a id="toclink{@nodeID}" href="javascript:focusSection('{@nodeID}');"> 
    209209                        <xsl:if test="util:hashToSectionId(@nodeID)"> 
    210                           <span class="tocSectionNumber"><xsl:value-of select="util:hashToSectionId(@nodeID)"/><!--<xsl:text> </xsl:text>--></span></xsl:if><xsl:call-template name="sectionHeading"/> 
    211                     </a> 
     210                          <span class="tocSectionNumber"><xsl:value-of select="util:hashToSectionId(@nodeID)"/><!--<xsl:text> </xsl:text>--></span></xsl:if><span class="tocSectionTitle"><xsl:call-template name="sectionHeading"/></span></a> 
     211                     
    212212                </td> 
    213213            </tr></table>