ctucx.git: webmusic-nginx

nginx xslt-based index files optimized for music, inspired by https://git.ztn.sh/zotan/webmusic

commit 863b2b2817e180c3db9f64e59db3201dcfd527e1
parent 4abc74c024995fb508c0493a8fcf1207a0b78b4a
Author: ctucx <c@ctu.cx>
Date: Sat, 6 Mar 2021 22:52:12 +0100

add class 'dir' to folders, class 'file' to files
1 file changed, 9 insertions(+), 3 deletions(-)
M
webmusic.xslt
|
12
+++++++++---
diff --git a/webmusic.xslt b/webmusic.xslt
@@ -77,6 +77,9 @@
 	<li>
 	<a class="action">[--] </a>
 	<xsl:element name="a">
+		<xsl:attribute name="class">
+			<xsl:text>dir</xsl:text>
+		</xsl:attribute>
 		<xsl:attribute name="href">
 			<xsl:call-template name="url-encode">
 				<xsl:with-param name="str" select="concat($path, current())" />

@@ -89,7 +92,6 @@
 
 	<xsl:template match="file">
 	<li>
-	<script>queue.push('<xsl:call-template name="url-encode"><xsl:with-param name="str" select="concat($path, current())" /></xsl:call-template>')</script>
 	<xsl:element name="a">
 		<xsl:attribute name="class">
 			<xsl:text>action</xsl:text>

@@ -103,8 +105,12 @@
 		</xsl:attribute>
 		<xsl:text>[DL] </xsl:text>
 	</xsl:element>
-	<a href="#">
-		<xsl:attribute name="onclick">playSong('<xsl:call-template name="url-encode"><xsl:with-param name="str" select="concat($path, current())" /></xsl:call-template>')</xsl:attribute>
+	<a class="file">
+		<xsl:attribute name="href">
+			<xsl:call-template name="url-encode">
+				<xsl:with-param name="str" select="concat($path, current())" />
+			</xsl:call-template>
+		</xsl:attribute>
 		<xsl:value-of select="." />
 	</a>
 	</li>