tsunami
log in
email
password
links
newest items
tag list
syntax reference
tag:time
history
item name
tags
{{ // Checkboxes follow the below order: // unchecked -> checked (ascending sort) -> checked (descending sort) -> unchecked // Checkboxes get a number such that the lowest number was the earliest checked and the numbers // are always consecutive from '1'. The suffix 'D' is appended if the sort is descending. function OnSortClick(e, that) { that = that || this; var label = that.nextSibling; var jqf = GetJQF(that); if (jqf.Sort > 0 && !(jqf.Flags & QueryFieldFlags.SortDesc)) { label.innerHTML += 'D'; jqf.Flags |= QueryFieldFlags.SortDesc; SetJQF(that, jqf); return false; // cancel uncheck } var checkboxes = GetNthInput('checkbox', 1, true); // we weren't just SortDesc, so we're removing this sort; // we probably need to change other numbers if (!this.checked) { var removedSortLevel = jqf.Sort; if (removedSortLevel < checkboxes.length + 1) { for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i] == that) continue; var label2 = checkboxes[i].nextSibling; var jqf2 = GetJQF(checkboxes[i]); if (jqf2.Sort >= removedSortLevel) { label2.innerHTML = --jqf2.Sort + (jqf2.Flags & QueryFieldFlags.SortDesc ? 'D' : ''); SetJQF(checkboxes[i], jqf2); } } } jqf.Sort = 0; jqf.Flags &= ~QueryFieldFlags.SortDesc; label.innerHTML = ''; SetJQF(that, jqf); } else { label.innerHTML = jqf.Sort = checkboxes.length; SetJQF(that, jqf); } } }}
some permissive license goes here
contact