aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/templates/base_top.html6
-rw-r--r--cgi/templates/board.html6
-rw-r--r--static/css/ib.css1
-rw-r--r--static/js/weabot.js19
4 files changed, 18 insertions, 14 deletions
diff --git a/cgi/templates/base_top.html b/cgi/templates/base_top.html
index 5389617..a95a257 100644
--- a/cgi/templates/base_top.html
+++ b/cgi/templates/base_top.html
@@ -40,11 +40,7 @@
<script type="text/javascript" src="#{static_url}js/autorefresh.js?v=3"></script>
</head>
<body#{' class="res"' if replythread else ''}>
- <div id="main_nav">[<a href="/" target="_top">Bienvenido a Internet</a>] [<?py include('templates/navbar.html') ?>]
- <?py if not force_css: ?>
- <span>[<span>Apariencia:</span>
- <?py for title in styles: ?> <a href="#" class="ss">#{title}</a><?py #endfor ?>]</span>
- <?py #endif ?></div>
+ <div id="main_nav">[<a href="/" target="_top">Bienvenido a Internet</a>] [<?py include('templates/navbar.html') ?>]</div>
<div class="logo">
<?py if board: ?>
#{board_long}
diff --git a/cgi/templates/board.html b/cgi/templates/board.html
index e91e187..6ded4c5 100644
--- a/cgi/templates/board.html
+++ b/cgi/templates/board.html
@@ -261,4 +261,10 @@
<?py if pagenav: ?>
<div class="pg">#{pagenav}</div>
<?py #endif ?>
+<?py if not force_css: ?>
+ <div class="selector"><b>Apariencia:</b><select id="styles">
+ <?py for title in styles: ?><option value="#{title}">#{title}</option><?py #endfor ?>
+ </select>
+ </div>
+<?py #endif ?>
<?py include('templates/base_bottom.html') ?> \ No newline at end of file
diff --git a/static/css/ib.css b/static/css/ib.css
index 1609e4d..55e8012 100644
--- a/static/css/ib.css
+++ b/static/css/ib.css
@@ -52,6 +52,7 @@ input[type="text"],input[type="password"],textarea{background:#FFF;border:1px in
.footer{clear:both;margin-top:8px;text-align:center}
.managertable th,.managertable td{padding:3px}
#q-p{position:absolute;border:1px dotted gray}
+.selector{font-size: 10pt}
@media(max-width:900px){.thread{margin-right:0}}
@media(max-width:720px){
body{font-size:15px;padding:4px}
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))