Skin change experience improved

main
Inga 🏳‍🌈 14 years ago
parent 8e197ab76a
commit 8c73972527
  1. 19
      templates/Full/Settings.xslt
  2. 2
      templates/Full/elems/Main.xslt

@ -3,6 +3,24 @@
<xsl:import href="elems\Main.xslt"/>
<xsl:template name="specificTitle">Íàñòðîéêè</xsl:template>
<xsl:template name="specific">
<script language="Javascript" type="text/javascript">
<xsl:text disable-output-escaping="yes"><![CDATA[
function changeSkin(newSkin) {
var links = document.getElementsByTagName("link");
for(i=0;i<links.length;i++) {
var link = links[i];
if((typeof(link.getAttribute) != "undefined") && (link.getAttribute("rel") == "stylesheet") && (link.getAttribute("skin") == "skin")) {
var newLink = document.createElement("link");
newLink.setAttribute("skin", "skin");
newLink.setAttribute("rel", "stylesheet");
newLink.setAttribute("type", "text/css");
newLink.setAttribute("href", "/static/css/" + newSkin + ".css");
link.parentNode.replaceChild(newLink, link);
}
}
}
]]></xsl:text>
</script>
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
@ -71,6 +89,7 @@
<xsl:text>Öâåòîâàÿ ñõåìà:</xsl:text>
<br/>
<select name="skinId">
<xsl:attribute name="onChange">changeSkin(this.options[this.selectedIndex].innerText);</xsl:attribute>
<xsl:apply-templates select="skins/skin" mode="skinOption">
<xsl:with-param name="currentSkin"><xsl:value-of select="settings/skinId"/></xsl:with-param>
</xsl:apply-templates>

@ -6,7 +6,7 @@
<html>
<head>
<link rel="stylesheet" href="/static/css/global.css" type="text/css" />
<link rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" skin="skin">
<xsl:attribute name="href">/static/css/<xsl:value-of select="skin/name"/>.css</xsl:attribute>
</link>
<link rel="shortcut icon" href="/static/favicons/smirk.ico" type="image/x-icon" />

Loading…
Cancel
Save