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.

MediaWiki:Common.js: 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
Pianoforte (talk | contribs)
No edit summary
Pianoforte (talk | contribs)
Blanked the page
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */


/* skilldata.js object code to gf-table conversion */
$(document).ready(function() {
calculator_element = document.getElementById("convertDiv");
data = calculator_element.innerHTML;
output = "{| class=gf-table<br>";
$.each(data.split("\n"), function(index, value) {
if (value.charAt(0) !== "") {
key = value.substring(0,value.lastIndexOf(":")).trim();
output = output + "! " + key + "<br>";
if (key == "text") {
output = output + "| colspan=10 | " + value.substring(value.indexOf("\"")+1, value.lastIndexOf("\"")) + "<br>|-<br>";
console.log(output);
} else if (key == "initial") {
output = output + "| colspan=10 | " + value.substring(value.indexOf(":")+1, value.lastIndexOf(",")) + "<br>|-<br>";
} else {
output = output + "| " + value.substring(value.indexOf("[")+1, value.lastIndexOf("]")).split(",").join(" ||") + "<br>|-<br>";
}
}
});
output = output.substring(0, output.length - 6) + "|}";
output = output.split("\'").join("");
document.getElementById("convertedDiv").innerHTML = output;
});

Latest revision as of 12:40, 31 July 2017