Difference between revisions of "Widget:indexSorterGrouper"

From Girls' Frontline Wiki
Jump to navigation Jump to search
m (Missing dot)
(Different approach)
(4 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
  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.find("img").eq(2).attr("src");
+
  var srcStr = element.find("img.rarity-class").attr("src");
 
  var myRegexp = /^.*Icon_(.*)_(.*)star.*$/g;
 
  var myRegexp = /^.*Icon_(.*)_(.*)star.*$/g;
 
  var match = myRegexp.exec(srcStr);
 
  var match = myRegexp.exec(srcStr);
Line 283: Line 283:
 
       nameToSet = element.attr('data-server-wiki');
 
       nameToSet = element.attr('data-server-wiki');
 
     }
 
     }
     element.find('name').first().text(nameToSet);
+
     element.find('.name').first().text(nameToSet);
 
   });
 
   });
 
    
 
    
Line 295: Line 295:
 
   parents.each(function() {
 
   parents.each(function() {
 
     var parent = $(this);
 
     var parent = $(this);
     var elements = parent.nextUntil("h2", ".card-bg-small");
+
    // All elements inside the paragraph after the h2 which have special class
 +
     var elements = parent.next().children().nextUntil("h2", ".card-bg-small");
 
    
 
    
 
     elements.detach().sort(comparer);
 
     elements.detach().sort(comparer);

Revision as of 03:11, 10 November 2019


 

Released on this server:

Some heading