Changeset 25720
- Timestamp:
- 2012-05-31T11:57:46+12:00 (12 years ago)
- 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 26 26 template += '</xsl:template>'; 27 27 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 28 43 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); 30 45 ajax.onreadystatechange = function() 31 46 { … … 911 926 * HIGHLIGHTING SCRIPTS * 912 927 ***********************/ 913 function addHighlight() 914 { 928 function 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 915 945 var spans = document.getElementsByTagName("span"); 916 946 for(var i = 0; i < spans.length; i++) 917 947 { 918 948 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 } 943 954 } 944 955 -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl
r25660 r25720 80 80 </xsl:choose> 81 81 </xsl:attribute> 82 <xsl:for-each select="documentNode"> <!--xxx<xsl:apply-templates select="documentNode" mode="TOC"/>-->82 <xsl:for-each select="documentNode"> 83 83 <xsl:call-template name="documentNodeTOC"/> 84 84 </xsl:for-each> … … 92 92 93 93 <!-- 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"> 95 95 96 96 <!-- check if this is the currently selected table of contents item --> … … 164 164 <xsl:text> </xsl:text> 165 165 </xsl:if> 166 <xsl:call-template name="sectionTitle"/> <!--xxx<xsl:apply-templates select="." mode="sectionTitle"/>-->166 <xsl:call-template name="sectionTitle"/> 167 167 </a> 168 168 </td> … … 182 182 </xsl:choose> 183 183 </xsl:attribute> 184 <xsl:for-each select="documentNode"> <!--xxx<xsl:apply-templates select="documentNode" mode="TOC"/>-->184 <xsl:for-each select="documentNode"> 185 185 <xsl:call-template name="documentNodeTOC"/> 186 186 </xsl:for-each> … … 235 235 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute> 236 236 </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> 251 241 </input> 252 242 </td> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r25711 r25720 90 90 <xsl:choose> 91 91 <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"/> 93 93 </xsl:when> 94 94 <xsl:otherwise> 95 <xsl:call-template name="sectionTitle"/> <!--<xsl:apply-templates select="." mode="sectionTitle"/>-->95 <xsl:call-template name="sectionTitle"/> 96 96 </xsl:otherwise> 97 97 </xsl:choose> … … 177 177 </xsl:attribute> 178 178 <!-- 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"/> 180 180 </div> 181 181 <xsl:if test="documentNode"> … … 242 242 </xsl:when> 243 243 <xsl:when test="$bookswitch = 'flashxml'"> 244 <xsl:call-template name="documentNodeFlashXML"/> <!--xxx<xsl:apply-templates mode="flashxml"/>-->244 <xsl:call-template name="documentNodeFlashXML"/> 245 245 </xsl:when> 246 246 <xsl:when test="$bookswitch = 'on'"> … … 338 338 </td> 339 339 </tr></table> 340 <gslib:langfrag name="dse"/> <!--<xsl:call-template name="document-editor-language-fragments"/>-->340 <gslib:langfrag name="dse"/> 341 341 </xsl:template> 342 342 343 343 <!-- Highlight annotations if requested --> 344 <xsl:template match="annotation">344 <xsl:template name="displayAnnotation"> 345 345 <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'"> 347 347 <span class="termHighlight"><xsl:value-of select="."/></span> 348 348 </xsl:when> … … 353 353 </xsl:template> 354 354 355 <xsl:template name="sectionTitleFormat"> <!--xxx<xsl:template match="documentNode" mode="sectionTitleFormat">-->355 <xsl:template name="sectionTitleFormat"> 356 356 <p> 357 357 <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute> … … 364 364 </xsl:if> 365 365 <!-- 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> 367 367 </p> 368 368 </xsl:template> … … 370 370 371 371 <!-- The default template for displaying section titles --> 372 <xsl:template name="sectionTitle"> <!--xxx<xsl:template match="documentNode" mode="sectionTitle">-->372 <xsl:template name="sectionTitle"> 373 373 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/> 374 374 </xsl:template> … … 439 439 440 440 <!-- 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"> 442 442 <!-- Hides the "This document has no text." message --> 443 443 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable> … … 452 452 </xsl:if> 453 453 </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> 454 460 <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/> 458 462 </xsl:otherwise> 459 463 </xsl:choose> … … 463 467 464 468 <!-- 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"> 466 470 <xsl:text disable-output-escaping="yes"> 467 471 <Section> … … 478 482 479 483 <xsl:for-each select="documentNode"> 480 <xsl:call-template name="documentNodeFlashXML"/> <!--<xsl:apply-templates select="documentNode" mode="flashxml"/>-->484 <xsl:call-template name="documentNodeFlashXML"/> 481 485 </xsl:for-each> 482 486
Note:
See TracChangeset
for help on using the changeset viewer.