diff options
author | Renard | 2019-03-30 13:30:18 -0300 |
---|---|---|
committer | bai | 2019-03-30 20:58:09 +0000 |
commit | d854378da5648b14c5fb323f254a2b373eb705bb (patch) | |
tree | 7def49c0bf6f9d9993fd9401f24e454ecb8d186a /static/js | |
parent | 5f17e76c8f3288b5888e00cd08734e1c01680fae (diff) | |
download | weabot-d854378da5648b14c5fb323f254a2b373eb705bb.tar.gz weabot-d854378da5648b14c5fb323f254a2b373eb705bb.tar.xz weabot-d854378da5648b14c5fb323f254a2b373eb705bb.zip |
Selector de CSS
Fix 1
Fix 2
Conchetumadresan
Cleanup
ahorasi
Ajustes en selector y CSS
Ajustes CSS para Selector de estilo
Fix gif background
Arreglos finales
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/weabotxt.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index 37668d8..91e2ab0 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -1,5 +1,7 @@ var style_cookie = "weabot_style_txt"; -if(style_cookie && localStorage.hasOwnProperty(style_cookie)) { set_stylesheet(localStorage.getItem(style_cookie)); } +if(style_cookie && localStorage.hasOwnProperty(style_cookie)) { + set_stylesheet(localStorage.getItem(style_cookie)); +} var hiddenposts = Array(); @@ -240,6 +242,11 @@ function togglepost(e) { localStorage.setItem("hiddenposts", hiddenposts.join("!")); } +function applyTheme(){ + var newTheme = document.getElementById("themeSelector").value; + set_stylesheet(newTheme); +} + document.addEventListener("DOMContentLoaded", function() { if (localStorage.hasOwnProperty("weabot")) weabot = JSON.parse(localStorage.getItem("weabot")); else weabot = {"name":null,"email":null,"password":null}; @@ -256,16 +263,10 @@ document.addEventListener("DOMContentLoaded", function() { var forms = document.getElementsByTagName("form"); for(var i=0;i<forms.length;i++) { if(forms[i].id.startsWith("postform")) setInputs(forms[i].id); } - var sss = document.getElementsByClassName("ss"); - var style = localStorage.getItem(style_cookie); - for(var i=0;i<sss.length;i++) { - sss[i].addEventListener("click", function() { - set_stylesheet(this.textContent); - var cur = document.getElementById("cur_stl"); - if (cur) cur.removeAttribute("id"); - this.id = "cur_stl"; - }); - if (sss[i].innerText == style) sss[i].id = "cur_stl"; + if (document.body.className == "mainpage") { + var themeSelector = document.getElementById("themeSelector"); + themeSelector.addEventListener("change", applyTheme, false); + themeSelector.value = localStorage.getItem(style_cookie); } var dds = document.getElementsByClassName("del"); |