Changeset 25720 for main/trunk


Ignore:
Timestamp:
2012-05-31T11:57:46+12:00 (12 years ago)
Author:
sjm84
Message:

Fixing missing annotations from searching

Location:
main/trunk/greenstone3/web/interfaces/default
Files:
3 edited

Legend:

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

    r25660 r25720  
    2626    template += '</xsl:template>';
    2727
     28    var hlCheckBox = document.getElementById("highlightOption");
     29   
     30    var hl = "";
     31    if(hlCheckBox)
     32    {
     33        if(hlCheckBox.checked)
     34        {
     35            hl = "on";
     36        }
     37        else
     38        {
     39            hl = "off";
     40        }
     41    }
     42   
    2843    var ajax = gs.functions.ajaxRequest();
    29     ajax.open("GET", gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?p.s=TextQuery&ilt=" + template.replace(" ", "%20"), true);
     44    ajax.open("GET", gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?hl=" + hl + "&p.s=TextQuery&ilt=" + template.replace(" ", "%20"), true);
    3045    ajax.onreadystatechange = function()
    3146    {
     
    911926* HIGHLIGHTING SCRIPTS *
    912927***********************/
    913 function addHighlight()
    914 {
     928function swapHighlight()
     929{
     930    var hlCheckbox = document.getElementById("highlightOption");
     931   
     932    var from;
     933    var to;
     934    if(hlCheckbox.checked)
     935    {
     936        from = "noTermHighlight";
     937        to = "termHighlight";
     938    }
     939    else
     940    {
     941        from = "termHighlight";
     942        to = "noTermHighlight";
     943    }
     944   
    915945    var spans = document.getElementsByTagName("span");
    916946    for(var i = 0; i < spans.length; i++)
    917947    {
    918948        var currentSpan = spans[i];
    919         if(currentSpan.getAttribute("class") == "noTermHighlight")
    920         {
    921             currentSpan.setAttribute("class", "termHighlight");
    922         }
    923     }
    924    
    925     var option = document.getElementById("highlightOption");
    926     option.setAttribute("onclick", "removeHighlight();");
    927 }
    928 
    929 function removeHighlight()
    930 {
    931     var spans = document.getElementsByTagName("span");
    932     for(var i = 0; i < spans.length; i++)
    933     {
    934         var currentSpan = spans[i];
    935         if(currentSpan.getAttribute("class") == "termHighlight")
    936         {
    937             currentSpan.setAttribute("class", "noTermHighlight");
    938         }
    939     }
    940    
    941     var option = document.getElementById("highlightOption");
    942     option.setAttribute("onclick", "addHighlight();");
     949        if(currentSpan.getAttribute("class") == from)
     950        {
     951            currentSpan.setAttribute("class", to);
     952        }
     953    }
    943954}
    944955
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl

    r25660 r25720  
    8080                                    </xsl:choose>
    8181                                </xsl:attribute>
    82                                 <xsl:for-each select="documentNode"><!--xxx<xsl:apply-templates select="documentNode" mode="TOC"/>-->
     82                                <xsl:for-each select="documentNode">
    8383                                    <xsl:call-template name="documentNodeTOC"/>
    8484                                </xsl:for-each>
     
    9292   
    9393    <!-- This template is used to display the table of contents -->
    94     <xsl:template name="documentNodeTOC"><!--xxx<xsl:template match="documentNode" mode="TOC">-->
     94    <xsl:template name="documentNodeTOC">
    9595
    9696        <!-- check if this is the currently selected table of contents item -->
     
    164164                            <xsl:text> </xsl:text>
    165165                        </xsl:if>
    166                         <xsl:call-template name="sectionTitle"/><!--xxx<xsl:apply-templates select="." mode="sectionTitle"/>-->
     166                        <xsl:call-template name="sectionTitle"/>
    167167                    </a>
    168168                </td>
     
    182182                        </xsl:choose>
    183183                    </xsl:attribute>
    184                     <xsl:for-each select="documentNode"><!--xxx<xsl:apply-templates select="documentNode" mode="TOC"/>-->
     184                    <xsl:for-each select="documentNode">
    185185                        <xsl:call-template name="documentNodeTOC"/>
    186186                    </xsl:for-each>
     
    235235                        <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
    236236                    </img>
    237                     <input id="highlightOption" type="checkbox" class="optionCheckBox">
    238                         <xsl:choose>
    239                             <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
    240                                 <xsl:attribute name="onclick">
    241                                     <xsl:text>removeHighlight();</xsl:text>
    242                                 </xsl:attribute>
    243                                 <xsl:attribute name="checked">true</xsl:attribute>
    244                             </xsl:when>
    245                             <xsl:otherwise>
    246                                 <xsl:attribute name="onclick">
    247                                     <xsl:text>addHighlight();</xsl:text>
    248                                 </xsl:attribute>
    249                             </xsl:otherwise>
    250                         </xsl:choose>
     237                    <input id="highlightOption" type="checkbox" class="optionCheckBox" onclick="swapHighlight();">
     238                        <xsl:if test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
     239                            <xsl:attribute name="checked">true</xsl:attribute>
     240                        </xsl:if>
    251241                    </input>
    252242                </td>
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r25711 r25720  
    9090                <xsl:choose>
    9191                    <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'dmd']) or /page/pageRequest/paramList/param[@name = 'dmd']/@value = 'false'">
    92                         <xsl:call-template name="sectionTitleFormat"/><!--<xsl:apply-templates select="." mode="sectionTitleFormat"/>-->
     92                        <xsl:call-template name="sectionTitleFormat"/>
    9393                    </xsl:when>
    9494                    <xsl:otherwise>
    95                         <xsl:call-template name="sectionTitle"/><!--<xsl:apply-templates select="." mode="sectionTitle"/>-->
     95                        <xsl:call-template name="sectionTitle"/>
    9696                    </xsl:otherwise>
    9797                </xsl:choose>
     
    177177                </xsl:attribute>
    178178                <!-- Get the section content from the document template -->
    179                 <xsl:call-template name="documentNodeContent"/><!--xxx<xsl:apply-templates select="." mode="document"/>-->
     179                <xsl:call-template name="documentNodeContent"/>
    180180            </div>
    181181            <xsl:if test="documentNode">
     
    242242            </xsl:when>
    243243            <xsl:when test="$bookswitch = 'flashxml'">
    244                 <xsl:call-template name="documentNodeFlashXML"/><!--xxx<xsl:apply-templates mode="flashxml"/>-->
     244                <xsl:call-template name="documentNodeFlashXML"/>
    245245            </xsl:when>
    246246            <xsl:when test="$bookswitch = 'on'">
     
    338338            </td>
    339339        </tr></table>
    340         <gslib:langfrag name="dse"/><!--<xsl:call-template name="document-editor-language-fragments"/>-->
     340        <gslib:langfrag name="dse"/>
    341341    </xsl:template>
    342342   
    343343    <!-- Highlight annotations if requested -->
    344     <xsl:template match="annotation">
     344    <xsl:template name="displayAnnotation">
    345345        <xsl:choose>
    346             <xsl:when test="/page/pageRequest/paramList/param[@name='hl' and @value='on']">
     346            <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
    347347                <span class="termHighlight"><xsl:value-of select="."/></span>
    348348            </xsl:when>
     
    353353    </xsl:template>
    354354   
    355     <xsl:template name="sectionTitleFormat"><!--xxx<xsl:template match="documentNode" mode="sectionTitleFormat">-->
     355    <xsl:template name="sectionTitleFormat">
    356356        <p>
    357357            <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
     
    364364            </xsl:if>
    365365            <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
    366             <span><xsl:call-template name="sectionTitle"/><!--xxx<xsl:apply-templates select="." mode="sectionTitle"/>--></span>
     366            <span><xsl:call-template name="sectionTitle"/></span>
    367367        </p>
    368368    </xsl:template>
     
    370370       
    371371    <!-- The default template for displaying section titles -->
    372     <xsl:template name="sectionTitle"><!--xxx<xsl:template match="documentNode" mode="sectionTitle">-->
     372    <xsl:template name="sectionTitle">
    373373        <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
    374374    </xsl:template>
     
    439439   
    440440    <!-- The default template for displaying the document content -->
    441     <xsl:template name="documentNodeContent"><!--xxx<xsl:template match="documentNode" mode="document">-->
     441    <xsl:template name="documentNodeContent">
    442442        <!-- Hides the "This document has no text." message -->
    443443        <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
     
    452452                        </xsl:if>
    453453                    </xsl:when>
     454                    <xsl:when test="name() = 'annotation'">
     455                        <xsl:call-template name="displayAnnotation"/>
     456                    </xsl:when>
     457                    <xsl:when test="name() = 'nodeContent'">
     458                        <xsl:call-template name="documentNodeContent"/>
     459                    </xsl:when>
    454460                    <xsl:otherwise>
    455                         <xsl:for-each select="nodeContent"><!--xxx<xsl:apply-templates select="."/>-->
    456                             <xsl:call-template name="documentNodeContent"/>
    457                         </xsl:for-each>
     461                        <xsl:apply-templates/>
    458462                    </xsl:otherwise>
    459463                </xsl:choose>
     
    463467   
    464468    <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
    465     <xsl:template name="documentNodeFlashXML"><!--xxx<xsl:template match="documentNode" mode="flashxml">-->
     469    <xsl:template name="documentNodeFlashXML">
    466470        <xsl:text disable-output-escaping="yes">
    467471            &lt;Section&gt;
     
    478482               
    479483        <xsl:for-each select="documentNode">
    480             <xsl:call-template name="documentNodeFlashXML"/><!--<xsl:apply-templates select="documentNode" mode="flashxml"/>-->
     484            <xsl:call-template name="documentNodeFlashXML"/>
    481485        </xsl:for-each>
    482486               
Note: See TracChangeset for help on using the changeset viewer.