assets/index.xsl in cobench-0.0.45 vs assets/index.xsl in cobench-0.0.46

- old
+ new

@@ -42,11 +42,19 @@ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js"> <xsl:text> </xsl:text> </script> <script type="text/javascript"> $(function() { - $("#metrics").tablesorter(); + $("#metrics").tablesorter({ + textExtraction: function(node) { + var attr = $(node).attr('data-sort-value'); + if (typeof attr !== 'undefined' &amp;&amp; attr !== false) { + return attr; + } + return $(node).text(); + } + }); }); $(function() { let params = (new URL(document.location)).searchParams; let org = params.get('org'); if (org) { @@ -200,10 +208,11 @@ <xsl:text>.</xsl:text> </p> <p> <xsl:text>Score = </xsl:text> <xsl:for-each select="cobench/weights/w[. != '0']"> + <xsl:sort select="@id" data-type="number" order="descending"/> <xsl:if test="position() &gt; 1"> <xsl:text> + </xsl:text> </xsl:if> <xsl:value-of select="."/> <xsl:text>×</xsl:text> @@ -368,9 +377,19 @@ <xsl:value-of select="$value"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <td class="num"> + <xsl:attribute name="data-sort-value"> + <xsl:choose> + <xsl:when test="@actual"> + <xsl:value-of select="@actual"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$value"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> <xsl:choose> <xsl:when test="@actual"> <span class="firebrick"> <xsl:copy-of select="$body"/> </span>