Welcome to IOPWiki, Commander.
With the release of the new game, we encourage contributions to topics related to Girls' Frontline 2. Learn how to contribute, read the maintenance guide, and join our Discord server to discuss major changes.
If you or someone you know can help deciphering the game files, contact our administrator.

Widget:indexSorterGrouper: Difference between revisions

Welcome to IOP Wiki. This website is maintained by the Girls' Frontline community and is free to edit by anyone.
Jump to navigation Jump to search
m Adding debug logs
Damn you, MediaWiki!
 
(4 intermediate revisions by the same user not shown)
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 8:
       var paragraph = parent.next('p');
       var paragraph = parent.next('p');
       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 23: Line 20:
  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 38: Line 34:
  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 45: Line 40:
});
});
      
      
console.log("Debug4");
     // Once everything is ready, default-sort it
     // Once everything is ready, default-sort it
     $('[data-initialsort]').click();
     $('[data-initialsort]').click();
Line 68: Line 62:
   var grouper = function (parent, elements) {
   var grouper = function (parent, elements) {
     var currentLetter = getFirstLetterGroup($(elements).first().data('name'));
     var currentLetter = getFirstLetterGroup($(elements).first().data('name'));
     var groupHeader = $("<h3 />").text(currentLetter.toUpperCase() + "...").addClass("addedbysorter");
     var nativeGroupHeader = document.createElement("h3");
    var groupHeader = $(nativeGroupHeader);
    groupHeader.text(currentLetter.toUpperCase() + "...").addClass("addedbysorter");
     groupHeader.insertBefore(elements.first());
     groupHeader.insertBefore(elements.first());
      
      
Line 77: Line 73:
         var groupHeaderText = nextElementLetter.toUpperCase() + "...";
         var groupHeaderText = nextElementLetter.toUpperCase() + "...";
         if (groupHeaderText.trim() != "...") {
         if (groupHeaderText.trim() != "...") {
           var groupHeader = $("<h3 />").text(groupHeaderText).addClass("addedbysorter");
           var groupHeader = $(document.createElement("h3")).text(groupHeaderText).addClass("addedbysorter");
           groupHeader.insertAfter(element);
           groupHeader.insertAfter(element);
         }
         }
Line 154: Line 150:
   if (currentKey !== nextElementKey) {
   if (currentKey !== nextElementKey) {
     var groupHeaderText = $(nextElement).data('classification') + " " + getNumberForRarity(nextElement) + "-Star";
     var groupHeaderText = $(nextElement).data('classification') + " " + getNumberForRarity(nextElement) + "-Star";
     var groupHeader = $("<h3 />").text(groupHeaderText).addClass("addedbysorter");
     var groupHeader = $(document.createElement("h3")).text(groupHeaderText).addClass("addedbysorter");
     groupHeader.insertAfter(element1);
     groupHeader.insertAfter(element1);
   }
   }
Line 229: Line 225:
     var firstTen = Math.ceil(parseInt(firstIndex) / 10) * 10;
     var firstTen = Math.ceil(parseInt(firstIndex) / 10) * 10;
     if (sortOrder == -1) { firstTen -= 9; }
     if (sortOrder == -1) { firstTen -= 9; }
     var groupHeader = $("<h3 />").text(getNumberText(firstIndex) + "..." + getNumberText(firstTen)).addClass("addedbysorter");
     var groupHeader = $(document.createElement("h3")).text(getNumberText(firstIndex) + "..." + getNumberText(firstTen)).addClass("addedbysorter");
     groupHeader.insertBefore(elements.first());
     groupHeader.insertBefore(elements.first());
      
      
Line 268: Line 264:
       var groupHeaderText = getNumberText(currentIdxShow) + "..." + getNumberText(nextElementTen);
       var groupHeaderText = getNumberText(currentIdxShow) + "..." + getNumberText(nextElementTen);
        
        
       var groupHeader = $("<h3 />").text(groupHeaderText).addClass("addedbysorter");
       var groupHeader = $(document.createElement("h3")).text(groupHeaderText).addClass("addedbysorter");
       groupHeader.insertAfter(element);
       groupHeader.insertAfter(element);
     }
     }

Latest revision as of 00:40, 27 July 2024


 

Released on this server:

Some heading