aboutsummaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorLibravatar Señor X 2019-03-31 04:51:31 -0300
committerLibravatar Señor X 2019-03-31 04:51:31 -0300
commit2535cc0e31382f4ecc16aa6a1988a80455356270 (patch)
treed836677edf472e42a3152869282aa41ea093a4d3 /static/js
parent7a28fa5875bec5dcb6736fb58d95b939e85f0e5e (diff)
downloadweabot-2535cc0e31382f4ecc16aa6a1988a80455356270.tar.gz
weabot-2535cc0e31382f4ecc16aa6a1988a80455356270.tar.xz
weabot-2535cc0e31382f4ecc16aa6a1988a80455356270.zip
Cambiando #themeSelector a que tome todo select
Diffstat (limited to 'static/js')
-rw-r--r--static/js/weabotxt.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js
index 91e2ab0..9cd407c 100644
--- a/static/js/weabotxt.js
+++ b/static/js/weabotxt.js
@@ -243,7 +243,7 @@ function togglepost(e) {
}
function applyTheme(){
- var newTheme = document.getElementById("themeSelector").value;
+ var newTheme = document.getElementById("styles").value;
set_stylesheet(newTheme);
}
@@ -251,30 +251,31 @@ document.addEventListener("DOMContentLoaded", function() {
if (localStorage.hasOwnProperty("weabot")) weabot = JSON.parse(localStorage.getItem("weabot"));
else weabot = {"name":null,"email":null,"password":null};
- board = document.getElementsByName("board")[0].value;
-
- if(localStorage.getItem("shobon_time") != "false") {
- changeDate();
- }
+ board = document.body.dataset.brd;
var ids = document.getElementsByClassName("num");
- for(var i=0;i<ids.length;i++) ids[i].addEventListener('click', postClick);
+ for(var i=0;i<ids.length;i++) ids[i].addEventListener("click", postClick);
var forms = document.getElementsByTagName("form");
for(var i=0;i<forms.length;i++) { if(forms[i].id.startsWith("postform")) setInputs(forms[i].id); }
if (document.body.className == "mainpage") {
- var themeSelector = document.getElementById("themeSelector");
- themeSelector.addEventListener("change", applyTheme, false);
- themeSelector.value = localStorage.getItem(style_cookie);
+ var styleSelect = document.getElementById("styles");
+ if (styleSelect) {
+ styleSelect.addEventListener("change", applyTheme, false);
+ styleSelect.value = localStorage.getItem(style_cookie);
+ }
+
+ var where = document.getElementById(board);
+ if (where) where.className = "cur_brd";
}
+ if(localStorage.getItem("shobon_time") != "false")
+ changeDate();
+
var dds = document.getElementsByClassName("del");
for(var i=0;i<dds.length;i++) { dds[i].children[1].addEventListener("click", deletePost); }
- var where = document.getElementById(document.getElementsByName("board")[0].value);
- if (where) where.className = "cur_brd";
-
if (document.body.className == "threads") {
var srt = document.getElementsByClassName("l_s");
for(var i=0;i<srt.length;i++){ srt[i].addEventListener("click",function(e){ e.preventDefault(); opcs.sort=this.textContent; listSort(); }); }
@@ -294,7 +295,6 @@ document.addEventListener("DOMContentLoaded", function() {
console.log(pps[i].dataset.unix);
hidepost(pps[i].parentElement.parentElement);
}
-
- pps[i].parentElement.addEventListener('dblclick', togglepost);
+ pps[i].parentElement.addEventListener("dblclick", togglepost);
}
}); \ No newline at end of file