fix sorting for dokuwiki syntax

This commit is contained in:
Ville Rantanen
2024-02-04 20:12:46 +02:00
parent 5b63e27e84
commit 603dc90c8a

View File

@@ -131,6 +131,10 @@ function orderStringSorter(a,b) {
var bValue=b.children[1].innerHTML.substring(0,3); var bValue=b.children[1].innerHTML.substring(0,3);
if ( aValue == "[x]" && bValue == "[ ]" ) return 1; if ( aValue == "[x]" && bValue == "[ ]" ) return 1;
if ( aValue == "[ ]" && bValue == "[x]" ) return -1; if ( aValue == "[ ]" && bValue == "[x]" ) return -1;
var aDone = new RegExp("\\(.+\\)$").test(a.children[1].innerHTML);
var bDone = new RegExp("\\(.+\\)$").test(b.children[1].innerHTML);
if ( aDone && ! bDone ) return 1;
if ( bDone && ! aDone ) return -1;
return 0; return 0;
} }
@@ -149,4 +153,3 @@ document.onscroll = function(event) {
document.cookie = "position=" + window.scrollY + "; path=" + window.location.pathname; document.cookie = "position=" + window.scrollY + "; path=" + window.location.pathname;
} }
window.onload = scrollBack; window.onload = scrollBack;