Welcome to IOPWiki, Commander.
We are searching for new editors to keep track of Girls' Frontline 2 content, as well as veteran players to complete existing Girls' Frontline and Project Neural Cloud articles.
You can contribute without an account. Learn how to contribute and join our Discord server.

Widget:indexSorterGrouper/sandbox: 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 Messing with data moved page Widget:indexSorterGrouper/sanbox to Widget:indexSorterGrouperSanbox without leaving a redirect: Subpages for widgets not working?
Removing first function
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><script>
<includeonly><script>
RLQ.push(['jquery', function () {
RLQ.push(['jquery', function () {
console.log("Debug0-2");
   $(document).ready(function() {
   $(document).ready(function() {
    console.log("debug1");
console.log("Debug1");
     // initially remove the paragraph
     // initially remove the paragraph
     var parents = $(".mw-headline").closest("h2");
     var parents = $(".mw-headline").closest("h2");
Line 10: Line 11:
       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!)
$(".gfl-doll-card").each(function() {
try {
console.log("Debug3-1");
  var element = $(this);
  var name = element.find('.name').first().text();
  var index = parseInt(element.find('.index').last().text());
  var srcStr = element.attr("class");
  var myRegexp = /doll\-rarity\-(.*?) doll\-classification\-(.*?)$/g;
  var match = myRegexp.exec(srcStr);
  var classification = match[2];
  var rarity = match[1];
console.log("Debug3-2");
          var serverDataSpans = $("span.serverdata[data-server-doll='" + name + "']");
          serverDataSpans.each(function() {
            var serverDataSpan = $(this);
            var serverShort = serverDataSpan.attr('data-server-released');
            var serverDollName = serverDataSpan.attr('data-server-releasename');
            element.attr("data-server-" + serverShort, serverDollName);
          });
          serverDataSpans.remove();


     console.log("debug2");
  element.attr('data-server-WIKI', name);
  element.data('name', name);
  element.data('index', index);
  element.data('classification', classification);
  element.data('rarity', rarity);
console.log("Debug3-3");
  }
  catch(error) {
    console.log("Error handling index entry", error);
  }
});
      
console.log("Debug4");
     // Once everything is ready, default-sort it
     // Once everything is ready, default-sort it
     $('[data-initialsort]').click();
     $('[data-initialsort]').click();
    console.log("debug3");
      
      
     // Activate ui for user  
     // Activate ui for user  
Line 21: Line 55:
   });
   });
}]);
}]);
function getFirstLetterGroup(element) {
  if (!element || element == null) {
    return " ";
  }
 
  var letter = element.charAt(0);
  if (letter >= "0" && letter <= "9") {
    letter = "#";
  }
  return letter.toLowerCase();
}
</script><div style="display:inline-block">
</script><div style="display:inline-block">
<button class="gf-button" data-tdollsortbutton="true" disabled data-initialsort="true" onclick="orderByClassRarityName(this);">By Class&gt;Rarity&gt;Name</button>
<button class="gf-button" data-tdollsortbutton="true" disabled data-initialsort="true" onclick="orderByClassRarityName(this);">By Class&gt;Rarity&gt;Name</button>

Latest revision as of 00:23, 27 July 2024


 

Released on this server:

Some heading