Changeset 36371
- Timestamp:
- 2022-08-14T17:29:18+12:00 (20 months ago)
- Location:
- documented-examples/trunk/style-e
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
documented-examples/trunk/style-e/etc/collectionConfig.xml
r36370 r36371 19 19 </xsl:variable> 20 20 <!-- 21 <link href="{$httpCollection}/style/custom-style.css" rel="stylesheet" type="text/css"/> 21 <link href="{$httpCollection}/style/custom-style.css" rel="stylesheet" type="text/css"/> 22 22 --> 23 <link rel="stylesheet" href="{$httpCollection}/style/gs3-style-default-extra.css" type="text/css" 24 title="GS3 Style" id="custom-style" charset="UTF-8"/> 25 23 26 <script src="{$httpCollection}/script/custom-script.js" type="text/javascript"> 24 27 </script> … … 26 29 </xsl:template> 27 30 31 32 <xsl:template name="create-banner"> 33 <div class="choose_style"> 34 Choose a style: 35 <a href="#" onclick="replaceStyle('gs3-style-default-extra');return false;">Default Greenstone</a>, 36 <a href="#" onclick="replaceStyle('gs3-style-blue');return false;">Blue</a>, 37 <a href="#" onclick="replaceStyle('gs3-style-olive-purple');return false;">OlivePurple</a>, 38 <a href="#" onclick="replaceStyle('');return false;">None</a> 39 </div> 40 41 <div id="gs_banner" class="ui-widget-header ui-corner-bottom"> 42 <div id="titlesearchcontainer"> 43 44 <xsl:call-template name="page-title-area"/> 45 <xsl:call-template name="quick-search-area"/> 46 <div style="clear:both;"><xsl:text> </xsl:text></div> 47 </div> 48 <xsl:call-template name="browsing-tabs"/> 49 50 51 </div> 52 </xsl:template> 28 53 </format> 29 54 <search type="mgpp"> -
documented-examples/trunk/style-e/script/custom-script.js
r36370 r36371 1 function replaceStyle(stylesheet) { 2 //alert("In custom-sript.js::ReplaceStyle()"); 3 var body = document.getElementsByTagName('body')[0]; 4 var linkEl = document.getElementById("custom-style"); 5 var href = linkEl.getAttribute("href"); 6 var lastSlashIndex = href.lastIndexOf("/"); 7 var hrefPrefix = href.substring(0, lastSlashIndex); 8 9 href = hrefPrefix + "/" + stylesheet + ".css"; 10 linkEl.setAttribute("href", href); 11 12 13 // https://techstacker.com/how-to-remove-all-css-from-site-with-javascript/ 14 if(stylesheet == "") { /* gs3-style-red */ 15 document 16 .querySelectorAll('style,link[rel="stylesheet"]') 17 .forEach(item => item.remove()) 18 19 // https://code-boxx.com/dynamically-load-replace-css/ 20 //document.head.appendChild(linkEl); 21 } 22 23 //reloadCss(); // https://stackoverflow.com/questions/2024486/is-there-an-easy-way-to-reload-css-without-reloading-the-page 24 } 25 26 1 27 // This function copied from extra.dm of style-e DEC collection 2 28 // It changes the current stylesheet to the named one of parameter 3 29 function SetStyle(stylename) { 30 //alert("In custom-sript.js::SetStyle()"); 4 31 var body = document.getElementsByTagName('body')[0]; 5 32 body.style.backgroundImage = ""; … … 15 42 } 16 43 } 44
Note:
See TracChangeset
for help on using the changeset viewer.