Widget:indexSorterGrouper: Difference between revisions
Jump to navigation
Jump to search
Damn you, MediaWiki! |
m Maybe small fix as it still relied on h2 headings |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
// initially remove the paragraph | // initially remove the paragraph | ||
var parents = $(".mw- | var parents = $(".mw-heading2"); | ||
parents.each(function() { | parents.each(function() { | ||
var parent = $(this); | var parent = $(this); | ||
| Line 90: | Line 90: | ||
var letter = element.charAt(0); | var letter = element.charAt(0); | ||
if (letter >= "0" | if (letter >= "0") if (letter <= "9") { | ||
letter = "#"; | letter = "#"; | ||
} | } | ||
| Line 261: | Line 261: | ||
var currentIdxShow = currentTen; | var currentIdxShow = currentTen; | ||
if (sortOrder != -1 | if (sortOrder != -1) if (currentIdxShow > 1) currentIdxShow += 1; | ||
var groupHeaderText = getNumberText(currentIdxShow) + "..." + getNumberText(nextElementTen); | var groupHeaderText = getNumberText(currentIdxShow) + "..." + getNumberText(nextElementTen); | ||
| Line 307: | Line 307: | ||
$('.addedbysorter').remove(); | $('.addedbysorter').remove(); | ||
var parents = $(".mw- | var parents = $(".mw-heading2"); | ||
parents.each(function() { | parents.each(function() { | ||
var parent = $(this); | var parent = $(this); | ||
// All elements inside the paragraph after the | // All elements inside the paragraph after the .mw-heading2 which have special class | ||
var elements = parent.nextUntil(" | var elements = parent.nextUntil(".mw-heading2", ".gfl-doll-card"); | ||
elements.detach().sort(comparer); | elements.detach().sort(comparer); | ||
| Line 343: | Line 343: | ||
{{#widget:indexSorterGrouper|}} | {{#widget:indexSorterGrouper|}} | ||
== Some heading == | == Some heading == | ||
</noinclude> | </noinclude> | ||
Latest revision as of 22:46, 30 July 2025
Released on this server:
