Widget:indexSorterGrouper: Difference between revisions
Jump to navigation
Jump to search
m Small typos corrected |
m Adding debug logs |
||
Line 2: | Line 2: | ||
RLQ.push(['jquery', function () { | RLQ.push(['jquery', function () { | ||
$(document).ready(function() { | $(document).ready(function() { | ||
console.log("Debug1"); | |||
// initially remove the paragraph | // initially remove the paragraph | ||
var parents = $(".mw-headline").closest("h2"); | var parents = $(".mw-headline").closest("h2"); | ||
Line 9: | Line 10: | ||
paragraph.replaceWith(paragraph.children()); | paragraph.replaceWith(paragraph.children()); | ||
}); | }); | ||
console.log("Debug2"); | |||
// For now, we have to make sure the data is there (Change the template, dammit!) | // For now, we have to make sure the data is there (Change the template, dammit!) | ||
$(".gfl-doll-card").each(function() { | $(".gfl-doll-card").each(function() { | ||
try { | try { | ||
console.log("Debug3-1"); | |||
var element = $(this); | var element = $(this); | ||
var name = element.find('.name').first().text(); | var name = element.find('.name').first().text(); | ||
Line 21: | Line 23: | ||
var classification = match[2]; | var classification = match[2]; | ||
var rarity = match[1]; | var rarity = match[1]; | ||
console.log("Debug3-2"); | |||
var serverDataSpans = $("span.serverdata[data-server-doll='" + name + "']"); | var serverDataSpans = $("span.serverdata[data-server-doll='" + name + "']"); | ||
serverDataSpans.each(function() { | serverDataSpans.each(function() { | ||
Line 36: | Line 38: | ||
element.data('classification', classification); | element.data('classification', classification); | ||
element.data('rarity', rarity); | element.data('rarity', rarity); | ||
console.log("Debug3-3"); | |||
} | } | ||
catch(error) { | catch(error) { | ||
Line 42: | Line 45: | ||
}); | }); | ||
console.log("Debug4"); | |||
// Once everything is ready, default-sort it | // Once everything is ready, default-sort it | ||
$('[data-initialsort]').click(); | $('[data-initialsort]').click(); |
Revision as of 00:00, 27 July 2024
Released on this server: