- Timestamp:
- 2019-07-02T12:01:22+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
r33253 r33261 28 28 29 29 <xsl:variable name="berry_icon">berry.png</xsl:variable> 30 <xsl:variable name="unselected_favourite_icon">favourite-star-transparent-unselected32.png</xsl:variable> 31 <xsl:variable name="selected_favourite_icon">favourite-star-transparent-selected32.png</xsl:variable> 32 30 33 <!-- every pages ....................................................................... --> 31 34 … … 54 57 <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/> 55 58 </xsl:variable> 59 <xsl:variable name="favouritesbasketswitch"> 60 <xsl:value-of select="/page/pageRequest/paramList/param[@name='favouritesbasket']/@value"/> 61 </xsl:variable> 56 62 57 63 <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/> 64 <xsl:variable name="favouritesBasketOn" select="/page/pageRequest/paramList/param[@name='favouritesbasket' and @value='on']"/> 58 65 <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/> 59 66 … … 750 757 </xsl:template> 751 758 759 <!-- 760 Goto Favourites Template 761 This gets used on many different pages to add the 762 goto favourites check-out functionality to the site 763 --> 764 <xsl:template name="gotoFavourites"> 765 <xsl:if test="$favouritesBasketOn"> 766 <div id="berrybasket" class="hide"> 767 <img src="interfaces/{$interface_name}/images/{$selected_favourite_icon}" title="click to add to favourites" width="16" height="16" border="0" /> 768 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.title')"/><xsl:text> </xsl:text></span> 769 <span id="favouritesCountDisplay">...</span> 770 771 <div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div> 772 </div> 773 <gsf:script> 774 //set url and show full view link 775 var fullView = YAHOO.util.Dom.get('favouritesFullViewLink'); 776 //Find the collection in the cgi parameters 777 var url = window.location.href; 778 var colstart = url.indexOf("&c="); 779 var collectionName = ""; 780 if (colstart != -1) 781 { 782 var colend = url.indexOf("&", (colstart + 1)); 783 if (colend == -1) 784 { 785 colend = url.length - 1; 786 } 787 collectionName = url.substring(colstart + 3, colend); 788 } 789 790 fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&sa=berry&c=&s=DisplayList&rt=r&p.c=" + collectionName); 791 fullView.style.display='block'; 792 793 </gsf:script> 794 </xsl:if> 795 </xsl:template> 796 797 798 799 752 800 <!-- put the drag&drop document basket on the page --> 753 801 <xsl:template name="documentBasket"> … … 777 825 778 826 <!-- include the required javascript and css for berry baskets --> 779 <xsl:template name="b erryBasketHeadTags">827 <xsl:template name="basketHeadTags"> 780 828 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script> 781 829 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script> … … 815 863 <xsl:if test="$berryBasketOn"> 816 864 <img class="pick" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"> 865 <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute> 866 </img> 867 </xsl:if> 868 </xsl:template> 869 870 <xsl:template name="documentFavouriteForClassifierOrSearchPage"> 871 872 <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable> 873 <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable> 874 875 <xsl:if test="$favouritesBasketOn"> 876 <img src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" title="click to add to favourites" width="20" height="20" border="0" onclick="toggleFavourite(this)" data-is-favourite="false"> 817 877 <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute> 818 878 </img> … … 842 902 </xsl:if> 843 903 </xsl:template> 904 905 <xsl:template name="documentFavouriteForDocumentPage"> 906 <xsl:variable name="selectedNode"> 907 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/> 908 </xsl:variable> 909 <xsl:variable name="rootNode"> 910 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/> 911 </xsl:variable> 912 <xsl:if test="$favouritesBasketOn"> 913 <div id="documentberries"> 914 <img id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" alt="in basket" width="15" height="15" border="0"/> 915 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span> 916 <!--<xsl:if test="$selectedNode != $rootNode"> 917 <img id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/> 918 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span> 919 </xsl:if>--> 920 </div> 921 </xsl:if> 922 </xsl:template> 844 923 845 924 <!-- document page -->
Note:
See TracChangeset
for help on using the changeset viewer.