diff options
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/weabotxt.js | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index 734a5ae..93850d9 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -234,35 +234,45 @@ document.addEventListener("DOMContentLoaded", function() { } } - if (document.body.clientWidth < 600 && head) { - var navlink = head.getElementsByTagName("a"); + if (document.body.clientWidth < 600) { + if (head) { + var navlink = head.getElementsByTagName("a"); + + var sel = document.createElement("select"); + sel.id = head.id + "_sel"; + sel.addEventListener("change", function(e){ + window.location.href = this.value; + }); + + for (var i=1; i<navlink.length; i++) { + var c = document.createElement("option"); + c.text = navlink[i].textContent; + c.value = navlink[i].href; + if (navlink[i].className == "cur_brd") { + c.selected = true; + } + sel.options.add(c); + } - var sel = document.createElement("select"); - sel.id = head.id + "_sel"; - sel.addEventListener("change", function(e){ - window.location.href = this.value; - }); + head.textContent = "" + var home = document.createElement("a"); + home.text = "Bienvenido a Internet"; + home.href = "/home.html"; + head.appendChild(home); + head.appendChild(document.createTextNode(" ★ ")); + head.appendChild(sel); - for (var i=1; i<navlink.length; i++) { - var c = document.createElement("option"); - c.text = navlink[i].textContent; - c.value = navlink[i].href; - if (navlink[i].className == "cur_brd") { - c.selected = true; - } - sel.options.add(c); + head.className = "mob"; + document.body.style.marginTop = "2em"; } - head.textContent = "" - var home = document.createElement("a"); - home.text = "Bienvenido a Internet"; - home.href = "/home.html"; - head.appendChild(home); - head.appendChild(document.createTextNode(" ★ ")); - head.appendChild(sel); - - head.className = "mob"; - document.body.style.marginTop = "2em"; + var sjis = /( \| /|\ |/ | ̄ ̄|| | ||\| | \|)/; + var msg = document.getElementsByClassName("msg"); + for (var i=0; i < msg.length; i++) { + if (msg[i].textContent.match(sjis)) { + msg[i].classList.add("sjis-mob"); + } + } } var forms = document.getElementsByTagName("form"); |