#1: Lucky Star
#100: Higurashi no Naku Koro ni Kira
Sort Columns Script
IMPORTANT: To run this script, go to inspect element console and enter the big box of text, AFTERWARDS enter this into console:
mal_sortColumn(<PLACECOLUMNNUMBER>)
function mal_sortColumn(col) {
// The table in the HTML page, should only represent one
let table = $(".list-table");
// These are the rows in the table.
let rows = table.children();
// Header row in use for later
let header = $(rows[0]);
// Lambdas for later
const mal_parseMetric = function (elem) {
const text = elem.text().trim();
// If it is a season...
const SEASONS = [ "winter", "spring", "summer", "autumn" ];
let tokens = text.split(' ');
if (tokens.length == 2) {
const season = tokens[0].toLowerCase();
const year = parseInt(tokens[1]);
let index = SEASONS.indexOf(season);
if (!isNaN(year) && index != -1) {
return 10*year + index;
}
}
// If it is a Number
const NUMREGEX = /^[0-9]+$/g;
if (NUMREGEX.test(text)) {
return parseInt(text);
}
// otherwise, let the crazy js handler handle it
return text;
}
const mal_getMetric = function (tbod) {
// Row is inside tbody and represents one row within
let row = $(tbod.children()[0]);
// "Cells" represent intersection between rows and columns
let cells = row.children();
// Good cell
let cell = $(cells[col]);
// Return all the cool elements
return { "tbody": tbod, "row": row, "cell": cell };
};
const mal_getRow = function (rownum) {
// TBODY wraps (generally) one row
let tbod = $(rows[rownum]);
return mal_getMetric(tbod);
};
// We're going to use a weird insertion sort using document fragments
let fragment = $( document.createDocumentFragment() );
const SIZE = rows.length - 1;
let arr = [];
// Loop all elements (beside the first one because it is a header)
for (let i = 1; i < rows.length; i++) {
// Get the TBODY
let row = mal_getRow(i);
if (arr.length == 0) {
arr.push(row.tbody[0]);
continue;
}
// Find a place in the array (yes I know its bad but I cbf to make a linkedlist)
let data = mal_parseMetric(row.cell);
let index = arr.length - 1;
// Check for null or no values
if (data == null || data == "" || data.length < 1) {
index = 0;
} else {
// Loop the list, add for rows
for (let j = 0; j < arr.length; j++) {
// Get the rows, deduct type.
let elem = $(arr[j]);
let current = mal_getMetric(elem);
let compData = mal_parseMetric(current.cell);
// If lesser or equal, add. Equal to reduce time spent
if (data <= compData) {
index = j;
break;
}
}
}
// Insert, weird javascript function
arr.splice(index, 0, row.tbody[0]);
}
// Add into the fragment.
for (let i = 0; i < arr.length; i++) {
let tbody = arr[i];
let row = $(tbody.firstChild);
// Set new number
row.find(".number").text(i + 1);
// Add the fragment
fragment.append(tbody);
}
// Kill Children
table.children().not("tbody:first").empty();
// Create Children
table.append(fragment);
}
I just saw your review of Gakuen Utopia Manabi Straight!
and I couldn't agree more with you, it's an anime that I really loved, I had it on my to-watch list for several years. I regret not having seen it before. And for me it's also a 10/10.
By the way, very good favorites.
Unfortunate to say this but yotsubato ain't getting an adaptation if you didn't know. The author himself said that "The stories doesn't fit well when animated".
THIS PERSON BELOW IS A NOTORIOUS SCAMMER!
PLEASE BLOCK AND MUTE FROM NOW ON!
AGAIN DO N.O.T. INTERACT WITH "Imma_draw" IF YOU HAVE THE CHOICE.
STAND FAR FAR AWAY!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
VVVVVVVVVVVVVVVVVVVVVVVVVVVVV NO GOOD! VVVVVVVVVVVVVVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
All Comments (11) Comments
and I couldn't agree more with you, it's an anime that I really loved, I had it on my to-watch list for several years. I regret not having seen it before. And for me it's also a 10/10.
By the way, very good favorites.
I also noticed you are still the only Kou Yasaka favorite, maybe someday she'll get more love from the community. :^)
PLEASE BLOCK AND MUTE FROM NOW ON!
AGAIN DO N.O.T. INTERACT WITH "Imma_draw" IF YOU HAVE THE CHOICE.
STAND FAR FAR AWAY!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
VVVVVVVVVVVVVVVVVVVVVVVVVVVVV NO GOOD! VVVVVVVVVVVVVVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
ratio confirmed by Ham_Real