From 770acfd68a6c4cbf2e62bb9b129b8ccc446f01ab Mon Sep 17 00:00:00 2001
From: z411
Date: Mon, 1 Apr 2019 16:52:42 -0300
Subject: oekaki: Usando os.path.join
PS: En realidad esta es la forma correcta de trabajar con
directorios en Python. Lo ideal sería corregir la aplicación
completa para que se utilice (en vez de concats ordinarios)
y quitar el trailing slash desde los directorios en la configuración.
---
cgi/oekaki.py | 6 +++---
cgi/weabot.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cgi/oekaki.py b/cgi/oekaki.py
index 14c3a1d..e20316c 100644
--- a/cgi/oekaki.py
+++ b/cgi/oekaki.py
@@ -116,7 +116,7 @@ def oekaki(self, path_split):
board = setBoard(path_split[3])
ip = inet_aton(self.environ["REMOTE_ADDR"])
- fname = "%s/%s/temp/%d.png" % (Settings.IMAGES_DIR, board['dir'], ip)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", str(ip) + ".png")
if path_split[4] == 'b64':
page = write_from_base64(fname, self.formdata['image'])
@@ -139,7 +139,7 @@ def oekaki(self, path_split):
ts = int(time.time())
ip = inet_aton(self.environ["REMOTE_ADDR"])
- fname = "%s/%s/temp/%d.png" % (Settings.IMAGES_DIR, board['dir'], ip)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", str(ip) + ".png")
oek = 'no'
if 'filebase' in self.formdata:
@@ -213,4 +213,4 @@ def write_from_shi(fname, fp):
with open(fname, 'wb') as f:
f.write(img)
- return "OK"
\ No newline at end of file
+ return "OK"
diff --git a/cgi/weabot.py b/cgi/weabot.py
index a85c2e7..5757df2 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -599,7 +599,7 @@ class weabot(object):
# process files
if oek_file:
try:
- fname = "%s/%s/temp/%s.png" % (Settings.IMAGES_DIR, board['dir'], oek_file)
+ fname = os.path.join(Settings.IMAGES_DIR, board['dir'], "temp", oek_file + ".png")
with open(fname, 'rb') as f:
file = f.read()
except:
--
cgit v1.2.1-18-gbd029
From 4c1a0a18644a40dd58477685ec9b904216aaa163 Mon Sep 17 00:00:00 2001
From: TOW
Date: Mon, 1 Apr 2019 19:24:42 -0300
Subject: Shobon: Agregada función para incluir imgur
---
static/js/shobon.js | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/static/js/shobon.js b/static/js/shobon.js
index b4e48f6..522dbe1 100644
--- a/static/js/shobon.js
+++ b/static/js/shobon.js
@@ -82,6 +82,11 @@ function shobon() {
if(localStorage.getItem("shobon_navbar") == "true") {
fixedNav();
}
+ // incluye imgur
+ if(localStorage.getItem("shobon_embedimg") == "true") {
+ embedImg(reply);
+ }
+
}
if (newRepliesInThread > 0 && !inThread) {
thread.getElementsByClassName("threadlinks")[0].innerHTML += "Marcar como leido";
@@ -239,6 +244,7 @@ function shobonSettings(e) {
p.appendChild(createCheckbox("shobon_on", "Activar extensión", true));
p.appendChild(createCheckbox("shobon_navbar", "Fijar barra superior", false));
p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", true));
+ p.appendChild(createCheckbox("shobon_embedimg", "Incluir imágenes de imgur", false));
p.appendChild(createCheckbox("shobon_newposts", "Destacar mensajes nuevos", false));
p.appendChild(createCheckbox("shobon_country", "Reemplazar códigos de país por nombres", false));
p.appendChild(createCheckbox("shobon_time", "Convertir fechas a hora local", true));
@@ -364,6 +370,20 @@ function paintIds(reply) {
}
}
+function embedImg(reply) {
+ var links = reply.getElementsByTagName("a");
+ for(i=0;iActivar extensión", true));
p.appendChild(createCheckbox("shobon_navbar", "Fijar barra superior", false));
p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", true));
- p.appendChild(createCheckbox("shobon_embedimg", "Incluir imágenes de imgur", false));
+ p.appendChild(createCheckbox("shobon_embedimg", "Incluir imágenes miniatura", false));
p.appendChild(createCheckbox("shobon_newposts", "Destacar mensajes nuevos", false));
p.appendChild(createCheckbox("shobon_country", "Reemplazar códigos de país por nombres", false));
p.appendChild(createCheckbox("shobon_time", "Convertir fechas a hora local", true));
@@ -372,15 +372,18 @@ function paintIds(reply) {
function embedImg(reply) {
var links = reply.getElementsByTagName("a");
- for(i=0;ispan{margin-top:.5em}
+}
\ No newline at end of file
diff --git a/static/js/shobon.js b/static/js/shobon.js
index 31fab9a..c9bce95 100644
--- a/static/js/shobon.js
+++ b/static/js/shobon.js
@@ -74,7 +74,7 @@ function shobon() {
replaceCountryName(reply)
}
// colorea los id's
- if(localStorage.getItem("shobon_ids") != "false") {
+ if(localStorage.getItem("shobon_ids") == "true") {
paintIds(reply);
}
// deja la barra superior fija
@@ -241,7 +241,7 @@ function shobonSettings(e) {
var p = document.createElement("div");
p.appendChild(createCheckbox("shobon_on", "Activar extensión", true));
p.appendChild(createCheckbox("shobon_navbar", "Fijar barra superior", false));
- p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", true));
+ p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", false));
p.appendChild(createCheckbox("shobon_embedimg", "Incluir imágenes miniatura", false));
p.appendChild(createCheckbox("shobon_newposts", "Destacar mensajes nuevos", false));
p.appendChild(createCheckbox("shobon_country", "Reemplazar códigos de país por nombres", false));
--
cgit v1.2.1-18-gbd029
From 6918f7d0b4d392e3baa41c7a1f0e5bfe42dac574 Mon Sep 17 00:00:00 2001
From: Señor X
Date: Tue, 2 Apr 2019 01:30:12 -0300
Subject: Fin de April Fools + Edit de material.css agregado a estilos
---
static/css/txt/bbs.css | 5 ++-
static/css/txt/material.css | 84 +++++++++++++++++++++++++++++++++++++++++++++
static/js/shobon.js | 4 +--
3 files changed, 88 insertions(+), 5 deletions(-)
create mode 100644 static/css/txt/material.css
diff --git a/static/css/txt/bbs.css b/static/css/txt/bbs.css
index b4372eb..477309a 100644
--- a/static/css/txt/bbs.css
+++ b/static/css/txt/bbs.css
@@ -20,14 +20,13 @@ pre{line-height:125%;margin:0;white-space:pre-wrap}
#main_nav .cur_brd,#cur_stl,.locked{font-weight:bold}
#main_nav{font-size:14px;padding:4px 0;text-align:center;width:100%}
#main_nav a,#thread_nav a,#threadlinks a,.threadlinks a,label{display:inline-block}
-.outerbox,.mainpage .thread,#footer,#content{margin-bottom:1em;margin-left:2.5%;margin-right:2.5%}
+.outerbox,.mainpage .thread,#footer,#content{margin:0 2.5% 1em}
.innerbox{padding:7px;margin:7px}
.threadnav{float:right;font-family:mona,monapo,ipamonapgothic,monapo,'ms pgothic',yozfontaa97}
#search input{margin-right:2px}
#search input[type="text"]{padding:4px;max-width:500px;width:100%}
.links{font-size:14px;text-align:center}
-#threadlinks{margin-bottom:7px;text-align:center}
-#threadlinks a{margin:0 4px}
+#threadlinks{margin-bottom:.5em;text-align:center}
#threadlist{font-size:14px;line-height:1;max-height:15em;overflow-y:scroll}
#threadlist a{text-decoration:none}
#thread_nav{padding-left:6px}
diff --git a/static/css/txt/material.css b/static/css/txt/material.css
new file mode 100644
index 0000000..dac8d7c
--- /dev/null
+++ b/static/css/txt/material.css
@@ -0,0 +1,84 @@
+body,textarea{color:#111}
+body{background:#f5f5f5}
+a{color:#00BCD4;text-decoration:none}
+a:hover{color:#FF6961}
+.msg a{color:#111;text-decoration:underline}
+.msg a:hover{color:#438ac1}
+h1{font-size:30px;margin:0;background:#1a2357;margin:-7px -7px 16px;padding:16px;font-variant:small-caps;box-shadow:0 2px 10px #000}
+h2{margin-bottom:.5em}
+h2 span{color:#CCC}
+h2 a{color:#616161}
+h3{border-bottom:1px solid #CCC;color:#4b01d1;font-weight:bold;margin:0 0 8px;padding-bottom:8px;text-align:center}
+h3 span{display:block;font-size:smaller;font-weight:normal;opacity:.7}
+h4{color:#AAA;font-size:12px}
+hr,#size,.banner,.threadpage .postform br{display:none}
+#main_nav{background:#4b01d1;font-size:1px;font-size:0;position:relative;z-index:9}
+#thread_nav{background:#303F9F;margin:-8px -8px -100px;padding:16px 0 116px;text-align:center}
+#main_nav a,#thread_nav a{background:#FFF;border-radius:2px;color:#000;display:inline-block;font-size:14px;margin:0 2px;padding:2px}
+#main_nav a:hover,.threadlinks a:hover,#thread_nav a:hover,#threadlist a:hover{background:#DDD}
+#titlebox a,#threadbox a{color:#FFF}
+#rules a:hover,.links a:hover,#threadlinks a:hover{border-radius:4px;margin:-2px;padding:2px;background:#1f285a;display:inline-block}
+#titlebox,#createbox,#footer,.end{background:#303F9F;color:#FFF;margin:0}
+#rules,#search{margin:1em 1em 0}
+#threadbox{background:#3f51b5;color:#FFF;margin:0 0 -150px;padding:0 1em 150px}
+.mainpage #threadbox .innerbox:after{content:'';box-shadow:0 0 20px 25px #3f51b5;display:block;position:relative;z-index:9}
+#threadlinks{text-transform:uppercase}
+#threadlist a{background:#FFF;border-bottom:1px solid #182050;border-radius:5px;color:#303F9F;display:inline-block;padding:3px;margin:3px}
+.threadnav a{color:#FFF;padding:4px;display:inline-block}
+.innerbox{margin:0}
+.thread,.outerbox,#content{background:#FFF;margin-top:2em}
+.mainpage .thread{margin-top:2em}
+.thread,#content,.threadpage .postform{box-shadow:0px 2px 2px 0px rgba(0,0,0,.14),0px 3px 1px -2px rgba(0,0,0,.2),0px 1px 5px 0px rgba(0,0,0,.12);}
+.thread .innerbox{background:#FFF;margin:0;padding:16px}
+.threadpage .thread,.threadpage .postform{margin:0 2.5%;padding:1em}
+.thread textarea,.threadpage textarea,.mainpage .threadlinks{margin-top:.5em}
+input[type="submit"],input[type="button"],button,.lastposts a,#n2{background:#2296f3;border:0;border-radius:5px;box-shadow:0 2px 5px rgba(0,0,0,.12);color:#FFF;text-transform:uppercase;padding:6px}
+input[type="submit"]:active,input[type="button"]:active,button:active,.threadnav a:hover{background:#438ac1}
+input[type="text"],textarea,#search input[type="text"]{border:1px solid #CCC;border-radius:2px;padding:6px}
+textarea{width:100%}
+select{border-radius:2px;background:#2296f3 url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAYAAABbNsX4AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4wQBBAYpAtmVHwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAfSURBVAjXY/z///9/BjTAyMDAwIAswcjIyAiXRZYAAKlrC/sti8JVAAAAAElFTkSuQmCC) no-repeat 95%;border:0;padding:0;color:#FFF;appearance:none;-webkit-appearance:none;-moz-appearance:none;}
+a .name,.name,.abbrev{color:#2296f3}
+.name em{color:#009}
+.del{margin-right:4px}
+.del a{color:#000}
+a.thumb{margin-top:4px}
+.q{color:#666}
+a.yt{background:#FFF;border:1px solid #CCC;box-shadow:0 4px 10px -4px #CCC;color:#444;text-decoration:none}
+a.yt,.yt .pvw{border-radius:10px}
+.deleted{color:#AFAFAF;margin-bottom:24px}
+#q-p{background:#FFF;border:1px solid #DDD;box-shadow:0 0 5px #CCC}
+.lastposts{padding:16px 0;font-size:1px;font-size:0;text-align:center}
+.lastposts a,.lastposts #n2{background:#ff4081;margin-right:5px;text-decoration:none}
+.lastposts a:active,#n2:active{background:#b22d5a}
+.threadpage .threadlinks{margin:0;margin-bottom:8px}
+#counter,.threadnav a{background:#2296f3;border-radius:100%;box-shadow:0 2px 5px rgba(0,0,0,.12)}
+.lastposts a,#n2,#counter{color:#FFF;display:inline-block;font-size:16px;padding:5px}
+.mainpage .postform,.formpad{padding-left:0}
+.mainpage .postform{margin:1em -1em -1em;padding:1em}
+.postform{background:#EEE;color:#666;text-align:center}
+.threadlinks a{background:#FFF;border-radius:.2em;color:#00BCD4;display:inline-block;font-size:smaller;padding:.2em;text-transform:uppercase}
+form .msg{border:1px dotted #AAA;background:#FFF;color:#111}
+h5{font-variant:small-caps;text-align:center}
+#createbox{margin-top:2em;padding-top:1em}
+#createbox .innerbox{padding:0}
+#createbox table{margin:0 auto}
+#createbox .threadnav{right:7px;position:relative}
+#footer{padding:1em}
+#footer a{color:#FFF}
+.end{margin:-100px -8px -8px;padding:116px 0 16px;position:relative;text-align:center;z-index:-1}
+#content .thread{background:none;box-shadow:none}
+#content.list #header div{background:#FFF;border-bottom:1px solid #CCC}
+#content .row:hover{background:#EEE}
+#content.list .row div{border-bottom:1px solid #EEE}
+#content.grid .row{border:1px solid #EEE;margin:0}
+@media(max-width:720px){
+ h1{font-size:18px}
+ #threadbox{padding-left:0;padding-right:0}
+ #rules,#search{margin-left:0;margin-right:0}
+ .thread .innerbox{padding:.5em}
+ .mainpage .thread{margin:2em .5em}
+ .mainpage .postform{margin:.5em -.5em -.5em;padding:.5em}
+ .threadpage .thread,.threadpage .postform{margin:0;padding:.5em}
+ .lastposts{padding:8px 0}
+ .postform>span{margin-top:.5em}
+}
\ No newline at end of file
diff --git a/static/js/shobon.js b/static/js/shobon.js
index 31fab9a..c9bce95 100644
--- a/static/js/shobon.js
+++ b/static/js/shobon.js
@@ -74,7 +74,7 @@ function shobon() {
replaceCountryName(reply)
}
// colorea los id's
- if(localStorage.getItem("shobon_ids") != "false") {
+ if(localStorage.getItem("shobon_ids") == "true") {
paintIds(reply);
}
// deja la barra superior fija
@@ -241,7 +241,7 @@ function shobonSettings(e) {
var p = document.createElement("div");
p.appendChild(createCheckbox("shobon_on", "Activar extensión", true));
p.appendChild(createCheckbox("shobon_navbar", "Fijar barra superior", false));
- p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", true));
+ p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", false));
p.appendChild(createCheckbox("shobon_embedimg", "Incluir imágenes miniatura", false));
p.appendChild(createCheckbox("shobon_newposts", "Destacar mensajes nuevos", false));
p.appendChild(createCheckbox("shobon_country", "Reemplazar códigos de país por nombres", false));
--
cgit v1.2.1-18-gbd029
From 8c5281cea797d2004087adf7642c5b8447e1b5f9 Mon Sep 17 00:00:00 2001
From: root
Date: Tue, 2 Apr 2019 16:12:51 +0000
Subject: Este parámetro no viene en todos los casos.
---
cgi/weabot.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 5757df2..f5451d9 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -39,7 +39,7 @@ class weabot(object):
self.start = start_response
- if self.environ["QUERY_STRING"] != "rawpost":
+ if self.environ.get("QUERY_STRING") != "rawpost":
self.formdata = getFormData(self)
self.output = ""
--
cgit v1.2.1-18-gbd029