Dear visitors, IOP Wiki is currently the target of a denial of service campaign. We are investigating countermeasures. In the meantime, the Wiki may experience periods of unplanned downtime.

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 Regex with old-school call maybe?
Removing debug logs
Line 1: Line 1:
<includeonly><script>
<includeonly><script>
console.log("Debug0-1");
RLQ.push(['jquery', function () {
RLQ.push(['jquery', function () {
console.log("Debug0-2");
   $(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 11: 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();
  var index = parseInt(element.find('.index').last().text());
  var index = parseInt(element.find('.index').last().text());
  var srcStr = element.attr("class");
  var srcStr = element.attr("class");
  var myRegexp = new RegExp("doll\-rarity\-(.*?) doll\-classification\-(.*?)$");
  var myRegexp = /doll\-rarity\-(.*?) doll\-classification\-(.*?)$/g;
  var match = myRegexp.exec(srcStr);
  var match = myRegexp.exec(srcStr);
  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 40: 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 47: 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();

Revision as of 00:29, 27 July 2024


 

Released on this server:

Some heading