Changeset 26226


Ignore:
Timestamp:
2012-09-20T11:31:03+12:00 (12 years ago)
Author:
sjm84
Message:

Added an option to fix the table of contents to the right side of the page

Location:
main/trunk/greenstone3/web
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/WEB-INF/classes/interface_default.properties

    r26220 r26226  
    1616prev_image=interfaces/__INTERFACE_NAME__/images/previous.png
    1717zoom_image=interfaces/__INTERFACE_NAME__/images/zoom.png
     18left_arrow_image=interfaces/__INTERFACE_NAME__/images/leftarrow.png
     19float_toc_image=interfaces/__INTERFACE_NAME__/images/floattoc.png
    1820
    1921#***** TEXT FRAGMENTS *****
     
    135137doc.zoomTooltip=Enable or disable zooming images in the standard view
    136138doc.slideshowTooltip=Enable or disable the slide show view
     139doc.floatingTooltip=Fix the table of contents to the right side of the screen
    137140
    138141doc.document=Document
  • main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js

    r26212 r26226  
    12491249}
    12501250
     1251function floatMenu(enabled)
     1252{
     1253    var menu = $(".tableOfContentsContainer");
     1254    if(enabled)
     1255    {
     1256        menu.data("position", menu.css("position"));
     1257        menu.data("width", menu.css("width"));
     1258        menu.data("right", menu.css("right"));
     1259        menu.data("top", menu.css("top"));
     1260        menu.data("max-height", menu.css("max-height"));
     1261        menu.data("overflow", menu.css("overflow"));
     1262        menu.data("z-index", menu.css("z-index"));
     1263       
     1264        menu.css("position", "fixed");
     1265        menu.css("width", "300px");
     1266        menu.css("right", "0px");
     1267        menu.css("top", "100px");
     1268        menu.css("max-height", "600px");
     1269        menu.css("overflow", "auto");
     1270        menu.css("z-index", "200");
     1271       
     1272        $("#unfloatTOCButton").show();
     1273    }
     1274    else
     1275    {
     1276        menu.css("position", menu.data("position"));
     1277        menu.css("width", menu.data("width"));
     1278        menu.css("right", menu.data("right"));
     1279        menu.css("top", menu.data("top"));
     1280        menu.css("max-height", menu.data("max-height"));
     1281        menu.css("overflow", menu.data("overflow"));
     1282        menu.css("z-index", menu.data("z-index"));
     1283       
     1284        $("#unfloatTOCButton").hide();
     1285        $("#floatTOCToggle").attr("checked", false);
     1286    }
     1287}
     1288
    12511289function showSlideShow()
    12521290{
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl

    r26220 r26226  
    3939            <table class="tocTable ui-widget-content">
    4040                <tr>
     41                    <td id="unfloatTOCButton" style="display:none;">
     42                        <a href="javascript:floatMenu(false);">
     43                            <img class="icon" style="padding-top:3px;">
     44                                <xsl:attribute name="src">
     45                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'left_arrow_image')"/>
     46                                </xsl:attribute>
     47                            </img>
     48                        </a>
     49                    </td>
    4150                    <td style="vertical-align:top; text-align:right;">
    4251                        <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
     
    288297                </xsl:if><xsl:text> </xsl:text>
    289298               
     299                <!-- Zoom on/off button -->
    290300                <li id="zoomOptions" style="display:none;">
    291301                    <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoomTooltip')"/></xsl:attribute>
     
    303313                    </script>
    304314                </li>
     315
     316                <!-- Floating TOC on/off button -->
     317                <xsl:if test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
     318                    <li id="floatingTOCOptions">
     319                        <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.floatingTooltip')"/></xsl:attribute>
     320                        <img>
     321                            <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'float_toc_image')"/></xsl:attribute>
     322                        </img>
     323                        <input id="floatTOCToggle" type="checkbox"/>
     324                        <script type="text/javascript">
     325                            <xsl:text disable-output-escaping="yes">
     326                                $("#floatTOCToggle").attr("checked", false);
     327                                $("#floatTOCToggle").click(function()
     328                                {
     329                                    floatMenu($("#floatTOCToggle").attr("checked"));
     330                                });
     331                            </xsl:text>
     332                        </script>
     333                    </li>
     334                </xsl:if>
    305335            </ul>
    306336            <div style="clear:both;"><xsl:text> </xsl:text></div>
Note: See TracChangeset for help on using the changeset viewer.