aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-03-31 17:41:31 -0300
committerLibravatar Renard 2019-03-31 17:41:31 -0300
commitf632cc408e50cff8714044021b683d18abe17a54 (patch)
tree7d9d61c461080a66444b7d879e1333eee494239f /static/js
parentda69561c644b860cb2ce0bf3fc608d8ca714245e (diff)
downloadweabot-f632cc408e50cff8714044021b683d18abe17a54.tar.gz
weabot-f632cc408e50cff8714044021b683d18abe17a54.tar.xz
weabot-f632cc408e50cff8714044021b683d18abe17a54.zip
Selector CSS para IB
Diffstat (limited to 'static/js')
-rw-r--r--static/js/weabot.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/static/js/weabot.js b/static/js/weabot.js
index da0ba83..0f27075 100644
--- a/static/js/weabot.js
+++ b/static/js/weabot.js
@@ -361,6 +361,11 @@ function catHidden() {
lbl.appendChild(shw); lbl.appendChild(document.createTextNode("]"));
}
+function applyTheme(){
+ var newTheme = document.getElementById("styles").value;
+ set_stylesheet(newTheme);
+}
+
document.addEventListener("DOMContentLoaded", function(e) {
checkhighlight();
if (localStorage.hasOwnProperty("weabot")) weabot = JSON.parse(localStorage.getItem("weabot"));
@@ -414,15 +419,11 @@ document.addEventListener("DOMContentLoaded", function(e) {
for(var i=0;i<tts.length;i++) {
tts[i].addEventListener('click', expandimg);
}
- var sss = document.getElementsByClassName("ss");
- for(var i=0;i<sss.length;i++) {
- sss[i].addEventListener('click', function() {
- var cur = document.getElementById("cur_stl");
- set_stylesheet(this.textContent);
- if (cur) cur.removeAttribute("id");
- this.id = "cur_stl";
- });
- if (sss[i].innerText == localStorage.getItem(style_cookie)) sss[i].id = "cur_stl";
+
+ var styleSelect = document.getElementById("styles");
+ if (styleSelect) {
+ styleSelect.addEventListener("change", applyTheme, false);
+ styleSelect.value = localStorage.getItem(style_cookie);
}
if (document.getElementById(board))