summaryrefslogtreecommitdiff
path: root/rannak/mangud/arimees/soome/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'rannak/mangud/arimees/soome/script.js')
-rw-r--r--rannak/mangud/arimees/soome/script.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/rannak/mangud/arimees/soome/script.js b/rannak/mangud/arimees/soome/script.js
new file mode 100644
index 0000000..25ffedd
--- /dev/null
+++ b/rannak/mangud/arimees/soome/script.js
@@ -0,0 +1,66 @@
+document.addEventListener('DOMContentLoaded', () => {
+ let btn = document.querySelector('.modalButton');
+ btn.click();
+});
+
+
+let map = {};
+map["Moikka"] = "tere";
+map["puhuda"] = "rääkida";
+map["Pulma"] = "probleem";
+map["ostoksille"] = "ostlema";
+map["halba"] = "odavat";
+map["pibod"] = "kootudsuusamütsid";
+map["Tpaitad"] = "t-särgid";
+//map["kesähousut"] = "t-särgid";
+map["puserod"] = "sametistdressipluusid"
+map["takkid"] = "joped"
+map["purukummi"] = "nätsu"
+map["pulma"] = "probleemi";
+map["kassi"] = "koti";
+map["puhelin"] = "telefon";
+map["kaikkiKunnossa"] = "kõikkorras";
+map["KaikkiParhaat"] = "kõikehead";
+
+
+let total = Object.keys(map).length;
+rightOnes = new Array();
+
+
+const words = document.querySelectorAll("span");
+
+for (let w of words){
+ w.addEventListener('DOMSubtreeModified', () => {
+
+ sone = w.id;
+
+ let x = w.innerText.replace(/\s/g, "");
+ let ignoringSpaces = x.toLowerCase();
+
+ if (ignoringSpaces == map[sone]) {
+
+ let index = rightOnes.indexOf(sone);
+ if (index == -1) {
+ rightOnes.push(sone);
+ }
+
+ w.setAttribute("contenteditable", false);
+ w.style.color = "lime";
+ }
+
+
+ if (rightOnes.length == total)
+ moveOnEnable();
+ });
+}
+
+
+
+// If All Else Done
+
+function moveOnEnable(){
+ const btn = document.querySelector(".moveOn");
+ btn.disabled = false;
+ btn.onclick = () => location.href = "";
+}
+