Template:Voting Gauntlet/script.js

/*   Divs with name "tournaments-art-name-[side]" contain information about units, including their name and score. They are divided into two parts, corresponding to the left and right side of the page. Each div is composed of a single unnamed div, itself compose of two parts. The first one contain the name of the unit, while the second one contain its score. (function {   "use strict";    const leftDivs = document.getElementsByClassName('tournaments-art-name-left');    const rightDivs = document.getElementsByClassName('tournaments-art-name-right');    // First battle result are contain on rows 4 to 7    var res1 = [];    for (let i = 3; i < 7; i++) {        res1.push(leftDivs[i].children[0].children[1].innerText);        res1.push(rightDivs[i].children[0].children[1].innerText);    }

// Second battle result are contain on rows 2 and 3 var res2 = []; for (let i = 1; i < 3; i++) { res2.push(leftDivs[i].children[0].children[1].innerText); res2.push(rightDivs[i].children[0].children[1].innerText); }

// Third battle result are contain on the first row var res3 = [] res3.push(leftDivs[0].children[0].children[1].innerText); res3.push(rightDivs[0].children[0].children[1].innerText);

let wikitext = "|scores1=" + res1.join(';') + "\n|scores2=" + res2.join(';') + "\n|scores3=" + res3.join(';') console.log(wikitext); });