aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorLibravatar Choom 2022-12-30 04:33:10 -0300
committerLibravatar Choom 2023-01-09 17:53:50 -0300
commit65fd303962d7744a5268db83a72fe66c7378565a (patch)
tree423403211c6006ed9eeaf101f8856ace78e81ffe /static
parentb7e1bbd2c15961f3871e02cb3657cecc5f72b45f (diff)
downloadweabot-65fd303962d7744a5268db83a72fe66c7378565a.tar.gz
weabot-65fd303962d7744a5268db83a72fe66c7378565a.tar.xz
weabot-65fd303962d7744a5268db83a72fe66c7378565a.zip
Devolviendo previews
Diffstat (limited to 'static')
-rw-r--r--static/css/dickgirl.css2
-rw-r--r--static/css/ib.css12
-rw-r--r--static/css/img/snow.gifbin0 -> 3720 bytes
-rw-r--r--static/css/txt/amber.css6
-rw-r--r--static/css/txt/ayashii.css20
-rw-r--r--static/css/txt/bbs.css41
-rw-r--r--static/css/txt/berries.css7
-rw-r--r--static/css/txt/bios.css8
-rw-r--r--static/css/txt/blue moon.css17
-rw-r--r--static/css/txt/ciber.css18
-rw-r--r--static/css/txt/cuteanarchy.css22
-rw-r--r--static/css/txt/futanari.css45
-rw-r--r--static/css/txt/headline.css1
-rw-r--r--static/css/txt/mercury.css1
-rw-r--r--static/css/txt/postal.css1
-rw-r--r--static/css/txt/rizzona.css24
-rw-r--r--static/css/txt/ventanas.css1
-rw-r--r--static/css/txt/void.css18
-rw-r--r--static/css/txt/waves.css1
-rw-r--r--static/ico/chiruno.gifbin0 -> 466 bytes
-rw-r--r--static/js/weabotxt.js153
21 files changed, 219 insertions, 179 deletions
diff --git a/static/css/dickgirl.css b/static/css/dickgirl.css
index e465d72..9f3d4ec 100644
--- a/static/css/dickgirl.css
+++ b/static/css/dickgirl.css
@@ -63,7 +63,7 @@ input[type="file"] {
border: none;
}
.q {
- color: #bdf46c;
+ color: #a5a5de;
}
.fs {
text-decoration: none;
diff --git a/static/css/ib.css b/static/css/ib.css
index 17b078a..25a5fc5 100644
--- a/static/css/ib.css
+++ b/static/css/ib.css
@@ -9,11 +9,14 @@ html {
padding: 0;
}
body {
- font-family: arial, helvetica, "nimbus sans l", sans-serif;
- font-size: 16px;
margin: 0;
padding: 8px;
}
+body,
+textarea {
+ font-family: arial, helvetica, "nimbus sans l", sans-serif;
+ font-size: 16px;
+}
body[data-brd="2d"], body[data-brd="2d"] textarea {
font-family: Mona,'MS PGothic',IPAMonaPGothic,sans-serif;
}
@@ -326,6 +329,9 @@ textarea {
font-size: 14px;
padding: 4px;
}
+ textarea {
+ font-size: 14px;
+ }
#main_nav.mob {
font-size: 12px;
line-height: 1em;
@@ -342,7 +348,7 @@ textarea {
border-spacing: 1px;
}
.postblock {
- font-size: 12px;
+ font-size: 10px;
white-space: nowrap;
}
.pass,
diff --git a/static/css/img/snow.gif b/static/css/img/snow.gif
new file mode 100644
index 0000000..37d45df
--- /dev/null
+++ b/static/css/img/snow.gif
Binary files differ
diff --git a/static/css/txt/amber.css b/static/css/txt/amber.css
index 4f471c9..a7a1fc8 100644
--- a/static/css/txt/amber.css
+++ b/static/css/txt/amber.css
@@ -71,6 +71,7 @@ hr {
input,
button {
font-family: monospace;
+ vertical-align: middle;
}
input,
input[type="submit"],
@@ -91,6 +92,7 @@ select:focus {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #f9690e;
border-style: solid;
@@ -134,7 +136,6 @@ button:active {
}
.mainpage .postform {
border-top: 1px solid #f9690e;
- margin: 0;
padding: 1em 0 1em 40px;
}
.formpad {
@@ -142,7 +143,6 @@ button:active {
}
form .msg {
border: 1px dotted #f9690e;
- background: #000;
color: #f9690e;
}
#q-p {
@@ -167,6 +167,6 @@ form .msg {
}
@media (max-width: 600px) {
.mainpage .postform {
- padding: 8px;
+ padding: 4px;
}
}
diff --git a/static/css/txt/ayashii.css b/static/css/txt/ayashii.css
index 899df7f..bb981a9 100644
--- a/static/css/txt/ayashii.css
+++ b/static/css/txt/ayashii.css
@@ -73,6 +73,10 @@ button {
margin-bottom: 1em;
padding-bottom: 1em;
}
+hr {
+ border: 0;
+}
+hr,
.innerbox,
.mainpage .thread,
.reply,
@@ -98,20 +102,17 @@ h3 {
.reply {
margin-bottom: 0.25em;
}
-.hidden,
-.deleted {
- padding-bottom: 0.25em;
-}
.reply:last-child {
border: 0;
margin-bottom: 0;
}
+.hidden,
+.deleted {
+ padding-bottom: 0.25em;
+}
.name em {
color: #009;
}
-.quoted {
- font-size: 9pt;
-}
.del a {
color: #fff;
}
@@ -130,9 +131,6 @@ h3 {
#size {
color: #fff;
}
-.mainpage .postform {
- margin-top: 1em;
-}
#q-p {
background: #004040;
border: 1px solid #ddd;
@@ -140,7 +138,7 @@ h3 {
#q-p h4:before {
display: none;
}
-.orm,
+.form,
.formpad {
padding-left: 0;
}
diff --git a/static/css/txt/bbs.css b/static/css/txt/bbs.css
index 8ff856e..03de99f 100644
--- a/static/css/txt/bbs.css
+++ b/static/css/txt/bbs.css
@@ -27,6 +27,7 @@ h5 {
}
h2 {
font-size: 1em;
+ line-height: 1.3em;
margin: 0 0 0.5em;
}
h2 a {
@@ -35,6 +36,7 @@ h2 a {
}
h3 {
font-size: 18px;
+ line-height: 1.2em;
margin: 8px 0;
}
h3 span {
@@ -68,11 +70,14 @@ button {
border: 1px outset #ddd;
background: #eee;
color: #333;
- padding: 1px 8px;
+ padding: 1px 1em;
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
+ color: #111;
+ background: #ccc;
border-style: inset;
}
.banner {
@@ -131,6 +136,9 @@ label {
.threadnav {
float: right;
}
+#search {
+ margin-top: 0.5em;
+}
#search input {
margin-right: 2px;
}
@@ -174,11 +182,6 @@ label {
.formpad {
padding-left: 40px;
}
-.postform,
-#search,
-.end {
- margin-top: 0.5em;
-}
.reply,
#rules {
clear: both;
@@ -271,6 +274,7 @@ a.yt b {
margin-bottom: 0.5em;
}
textarea {
+ line-height: 18px;
max-width: 100%;
}
#createbox input,
@@ -282,10 +286,13 @@ textarea {
white-space: nowrap;
}
form .msg {
- margin: 0;
- padding: 8px 2px;
+ margin: 0.2em 0;
+ padding: 0.5em 2px;
text-align: left;
}
+#tr_preview .msg {
+ margin: 0;
+}
.warn {
margin: 0.5em 0;
padding: 1px;
@@ -305,9 +312,10 @@ form .msg {
#listmenu {
text-align: center;
}
-#threads td, #threads th {
+#threads td,
+#threads th {
max-width: 256px;
- padding: 2px 4px;
+ padding: 3px;
text-align: left;
}
#threads a {
@@ -322,7 +330,8 @@ form .msg {
line-height: 12px;
}
.end {
- line-height: 1;
+ margin-top: 0.5em;
+ line-height: 1em;
}
#main_nav.mob {
position: fixed;
@@ -343,7 +352,8 @@ form .msg {
}
@media (max-width: 600px) {
- body {
+ body,
+ textarea {
font-size: 14px;
}
body.threadpage {
@@ -357,7 +367,7 @@ form .msg {
.outerbox,
.mainpage .thread,
#footer {
- margin: 1em 0;
+ margin: 1em 4px;
}
.innerbox {
margin: 3px;
@@ -398,7 +408,7 @@ form .msg {
.del {
visibility: visible;
}
- div.msg,
+ .reply .msg,
a.thumb {
margin: 8px;
}
@@ -425,9 +435,6 @@ form .msg {
textarea {
width: 100%;
}
- .postform textarea {
- height: 128px;
- }
form,
#thread_nav,
.locked {
diff --git a/static/css/txt/berries.css b/static/css/txt/berries.css
index 9e6cdf9..732adb1 100644
--- a/static/css/txt/berries.css
+++ b/static/css/txt/berries.css
@@ -56,6 +56,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #0b0924;
}
@@ -107,10 +108,9 @@ h4 {
border-bottom: 1px solid #4b4e55;
}
.mainpage .thread {
- background: #0c0616;
+ background: rgb(12, 6, 22, 0.9);
border: 3px double #4b4e55;
color: #ced1cf;
- opacity: 0.9;
}
.threadpage .thread {
color: #ced1cf;
@@ -160,7 +160,8 @@ form .msg {
background: #383838;
border: 1px dotted #000;
}
-.threadpage .postform {
+.postform {
+ margin-top: 0;
opacity: 0.9;
}
#footer {
diff --git a/static/css/txt/bios.css b/static/css/txt/bios.css
index e15c912..5264906 100644
--- a/static/css/txt/bios.css
+++ b/static/css/txt/bios.css
@@ -38,6 +38,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active,
select:focus {
background: #000;
@@ -162,7 +163,6 @@ a:focus .name {
}
.lastposts {
border-top: 1px solid #fff;
- border-bottom: 1px solid #fff;
color: #00a;
padding: 0.5em;
}
@@ -176,6 +176,10 @@ a:focus .name {
border: 1px solid #fff;
padding: 0.5em;
}
+.threadpage .postform {
+ border-top: 1px solid #fff;
+ padding-top: 0.5em;
+}
form .msg {
border: 3px double #fff;
}
@@ -184,4 +188,4 @@ form .msg {
}
#threads th, #threads td {
border-bottom: 1px solid;
-} \ No newline at end of file
+}
diff --git a/static/css/txt/blue moon.css b/static/css/txt/blue moon.css
index 61a4a86..9da9ab5 100644
--- a/static/css/txt/blue moon.css
+++ b/static/css/txt/blue moon.css
@@ -61,8 +61,10 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
- color: #ddd;
+ background: #000;
+ color: #aaa;
}
#main_nav {
background: #fff;
@@ -115,6 +117,10 @@ h5 {
}
.mainpage .postform {
margin-top: 10px;
+ padding-left: 10px;
+}
+.formpad {
+ padding-left: 0;
}
.reply {
background: #fff;
@@ -124,7 +130,6 @@ h5 {
border-left: 10px solid #ddd;
color: #000;
margin-bottom: 0;
- overflow: hidden;
}
.name,
a .name {
@@ -175,9 +180,7 @@ a.thumb {
padding: 0;
}
form .msg {
- border: 1px inset #ddd;
- margin: 0;
- padding: 0.5em 0.15em;
+ border: 1px dotted #49525d;
}
.lastposts {
background: #49525d;
@@ -227,9 +230,9 @@ form .msg {
.threadpage .postform {
border-width: 4px;
}
- div.msg,
+ .reply .msg,
a.thumb {
- margin: 4px;
+ margin: 6px;
}
.thread form {
margin-top: 4px;
diff --git a/static/css/txt/ciber.css b/static/css/txt/ciber.css
index 7a26bce..12e99a8 100644
--- a/static/css/txt/ciber.css
+++ b/static/css/txt/ciber.css
@@ -83,12 +83,12 @@ hr {
color: #000;
}
input:active,
+input.active,
input:focus,
textarea:focus,
button:active,
-button:active,
select:focus {
- box-shadow: 0 0 15px;
+ box-shadow: 0 0 10px;
}
.outerbox input,
.outerbox textarea,
@@ -106,6 +106,7 @@ select {
}
.outerbox input[type="submit"]:active,
.outerbox input[type="button"]:active,
+.outerbox input[type="button"].active,
.outerbox button:active {
background: #0c0;
border-style: inset;
@@ -121,8 +122,11 @@ select {
}
.threadpage input[type="submit"]:active,
.threadpage input[type="button"]:active,
+.threadpage input[type="button"].active,
.thread input[type="submit"]:active,
-.thread input[type="button"]:active {
+.thread input[type="button"]:active,
+.thread input[type="button"].active {
+ background: #4c0747;
border-color: #d21cea;
color: #d21cea;
}
@@ -137,12 +141,12 @@ select {
background: #0c0;
}
.outerbox a,
-#main_nav a a,
+#main_nav a,
#footer a {
color: #68f855;
}
.outerbox a:active,
-#main_nav a:active a:active,
+#main_nav a:active,
#footer a:active {
color: #ef6177;
}
@@ -203,7 +207,6 @@ form .msg {
}
form .msg {
border: 1px dotted #2a4a75;
- color: #2a4a75;
}
#q-p {
border: 1px solid #000;
@@ -233,10 +236,9 @@ form .msg {
body.threadpage {
margin: 0;
padding: 4px;
- box-shadow: inset 0 0 5px;
+ box-shadow: inset 0 0 1em;
}
.mainpage .postform {
padding: 4px;
- margin-top: 0;
}
}
diff --git a/static/css/txt/cuteanarchy.css b/static/css/txt/cuteanarchy.css
index 6b43edb..af9c360 100644
--- a/static/css/txt/cuteanarchy.css
+++ b/static/css/txt/cuteanarchy.css
@@ -49,7 +49,8 @@ input[type="button"] {
}
input[type="submit"]:active,
-input[type="button"]:active {
+input[type="button"]:active,
+input[type="button"].active {
background: #f2d3df;
}
@@ -216,23 +217,12 @@ a.thumb {
}
form .msg {
- background: #383838;
+ background: #ffb8b8;
border: 1px dotted #000;
}
-.mainpage .postform {
- margin: 0 auto;
- margin-left: 3em;
-}
-
-.mainpage .postform,
-.formpad {
- padding-left: 0px;
-}
-
.formpad {
margin: 0 auto;
- padding-left: 0;
}
#footer {
@@ -247,12 +237,12 @@ form .msg {
.mainpage .thread {
background: rgba(255, 235, 226, 0.95);
}
+ #titlebox {
+ margin-top: 1em;
+ }
h1 {
font-size: 18px;
}
- .postform {
- margin-left: 0;
- }
.outerbox,
.mainpage .thread,
#footer {
diff --git a/static/css/txt/futanari.css b/static/css/txt/futanari.css
index 12e5217..ed60b85 100644
--- a/static/css/txt/futanari.css
+++ b/static/css/txt/futanari.css
@@ -7,6 +7,11 @@ a .name,
#n2 {
color: #dfca89;
}
+a:hover,
+a:hover .name,
+#n2:hover {
+ color: #ffe9a4;
+}
a:active,
a:active .name,
#n2:active {
@@ -19,18 +24,17 @@ hr {
h1,
h5 {
background: #5e8db4;
- margin: -8px -8px 8px;
- padding: 8px;
+ margin: -7px -7px 7px;
+ padding: 7px;
}
h2 {
margin-bottom: 0;
}
h2 a,
-h2 a:active,
+h2 a:hover,
h3,
#size {
color: #d1a28c;
- text-decoration: none;
}
h2 span,
h3 span {
@@ -55,8 +59,14 @@ button {
border-bottom: 1px solid #40607c;
border-right: 1px solid #40607c;
}
+input[type="submit"]:hover,
+input[type="button"]:hover,
+button:hover {
+ background: #63b6e9;
+}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #7979a5;
color: #191d25;
@@ -92,6 +102,7 @@ input[type="file"] {
}
#threadbox {
border-top: 0;
+ margin-top: 0;
}
.outerbox {
background: #476a88;
@@ -100,10 +111,10 @@ input[type="file"] {
.outerbox .innerbox,
#createbox .innerbox {
margin: 0;
- padding: 8px;
}
-.links {
+.innerbox.links {
background: #5b8bb4;
+ padding: 0.5em;
}
#threadlist {
background: #476a88;
@@ -121,7 +132,7 @@ input[type="file"] {
h4 {
background: #38546c;
color: #999;
- padding: 2px;
+ padding: 1px;
}
h4:hover {
background: #324b60;
@@ -140,7 +151,7 @@ h4:hover {
color: #fdfd96;
}
.q {
- color: #aac;
+ color: #a5a5de;
}
.yt {
background: #43617a;
@@ -148,11 +159,11 @@ h4:hover {
}
.postform {
color: #d3f8d3;
- padding: 8px;
+ margin-top: 0.5em;
+ padding: 8px !important;
}
form .msg {
- background: #21323f;
- border: 1px dashed #43617a;
+ border: 1px dashed #21323f;
color: #fff;
}
#q-p {
@@ -171,20 +182,18 @@ form .msg {
}
@media (max-width: 600px) {
- #createbox,
- .innerbox,
- #threadbox {
+ .innerbox {
margin: 0;
padding: 0;
}
- #threadbox .innerbox {
- padding: 8px 5px 5px;
+ .outerbox .innerbox {
+ padding: 7px;
}
h2 {
text-align: center;
}
- form .msg {
- margin: 4px 0 0;
+ .postform {
+ padding: 4px !important;
}
.reply.deleted {
margin-bottom: 0;
diff --git a/static/css/txt/headline.css b/static/css/txt/headline.css
index 6e3d08e..c9d3525 100644
--- a/static/css/txt/headline.css
+++ b/static/css/txt/headline.css
@@ -53,6 +53,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #ccc;
border-style: solid;
diff --git a/static/css/txt/mercury.css b/static/css/txt/mercury.css
index 0874899..27ffbee 100644
--- a/static/css/txt/mercury.css
+++ b/static/css/txt/mercury.css
@@ -48,6 +48,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #ccc;
border-style: solid;
diff --git a/static/css/txt/postal.css b/static/css/txt/postal.css
index a31419c..14d2bbb 100644
--- a/static/css/txt/postal.css
+++ b/static/css/txt/postal.css
@@ -35,6 +35,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #b1b1b1;
}
diff --git a/static/css/txt/rizzona.css b/static/css/txt/rizzona.css
index 244ab13..8617f8a 100644
--- a/static/css/txt/rizzona.css
+++ b/static/css/txt/rizzona.css
@@ -59,7 +59,8 @@ h2 a {
h2 a:hover {
text-decoration: underline;
}
-.reply, .postform {
+.reply,
+.postform {
background: #F0EAD6;
border: 4px solid #000;
border-top: 0;
@@ -87,13 +88,11 @@ hr {
margin: 0.5em 0;
}
.mainpage .postform {
- margin: 0;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.threadpage .postform {
border-top: 4px solid #000;
- padding-top: 0;
padding: 0.25em;
}
input[type="submit"],
@@ -102,6 +101,12 @@ button {
background: #E0DAC6;
border: 1px solid rgba(0,0,0,0.5);
}
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="button"].active,
+button:active {
+ background: #c5bda5;
+}
input[type="text"],
select {
background: #E0DAC6;
@@ -115,7 +120,7 @@ textarea {
background: #F0EAD6;
}
form .msg {
- border: 1px dotted rgba(0,0,0,0.15);
+ border: 2px dotted rgba(0,0,0,0.15);
}
#q-p {
background: #F0EAD6;
@@ -148,19 +153,10 @@ form .msg {
background: #dbce9c;
}
@media (max-width: 600px) {
- body.threadpage {
- margin: 5px 0;
- }
- div.msg {
- margin: 0.5em 4px;
- }
.deleted {
margin-bottom: 0;
}
.mainpage .postform {
- padding: 0.5em;
- }
- .mainpage .msg {
- margin: 0.5em;
+ padding: 4px;
}
}
diff --git a/static/css/txt/ventanas.css b/static/css/txt/ventanas.css
index 235225e..b2fe8f9 100644
--- a/static/css/txt/ventanas.css
+++ b/static/css/txt/ventanas.css
@@ -108,6 +108,7 @@ hr,
.threadnav a:active,
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
border-color: #000 #fff #fff #000;
border-style: groove;
diff --git a/static/css/txt/void.css b/static/css/txt/void.css
index a28acee..fff6587 100644
--- a/static/css/txt/void.css
+++ b/static/css/txt/void.css
@@ -23,17 +23,24 @@ input[type="submit"],
input[type="button"],
textarea,
button,
-select,
-form .msg {
+select {
background: #000;
border: 1px solid #222;
}
+a:hover,
+a:hover b,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+button:hover {
+ color: #bbb;
+}
a:active,
a:active b,
.yt:active,
#n2:active,
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active,
h4,
.name,
@@ -48,6 +55,7 @@ h4,
#footer,
#footer a,
#threads th {
+ background: #000;
color: #333;
}
.reply {
@@ -64,6 +72,12 @@ h4 a {
.q {
color: #555;
}
+.postform {
+ margin-top: 0.5em;
+}
+form .msg {
+ border: 1px dashed #444;
+}
#size {
margin: 0.5em 0;
}
diff --git a/static/css/txt/waves.css b/static/css/txt/waves.css
index 1061624..6509afa 100644
--- a/static/css/txt/waves.css
+++ b/static/css/txt/waves.css
@@ -97,6 +97,7 @@ button {
}
input[type="submit"]:active,
input[type="button"]:active,
+input[type="button"].active,
button:active {
background: #26689b;
border: 1px inset #3283c2;
diff --git a/static/ico/chiruno.gif b/static/ico/chiruno.gif
new file mode 100644
index 0000000..250eace
--- /dev/null
+++ b/static/ico/chiruno.gif
Binary files differ
diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js
index 7bbddcb..734a5ae 100644
--- a/static/js/weabotxt.js
+++ b/static/js/weabotxt.js
@@ -9,54 +9,49 @@ function setTheme(styletitle) {
localStorage.setItem(style_cookie, styletitle);
}
-/* IE/Opera fix, because they need to go learn a book on how to use indexOf with arrays */
-if (!Array.prototype.indexOf) {
- Array.prototype.indexOf = function(elt /*, from*/) {
- var len = this.length;
- var from = Number(arguments[1]) || 0;
- from = from < 0 ? Math.ceil(from) : Math.floor(from);
- if (from < 0) from += len;
- for (; from < len; from++) {
- if (from in this && this[from] === elt) return from;
- }
- return -1;
- };
-}
-
function getPassword() {
if (weabot.password) return weabot.password;
+
var pass = "";
- var char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!-_.";
- for (var i=0; i<11; i++) {
+ var char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!-_.:;";
+ for (var i=0; i<=8; i++) {
pass += char[Math.floor(Math.random() * char.length)];
}
weabot.password = pass;
localStorage.setItem("weabot", JSON.stringify(weabot));
+
return pass;
}
function saveInputs(e) {
var e = e || window.event;
var form = e.target || e.srcElement;
+
if (typeof form.fielda !== "undefined") weabot.name = form.fielda.value;
- if (typeof form.fielda !== "undefined") weabot.email = form.fieldb.value;
+ if (typeof form.fieldb !== "undefined") weabot.email = form.fieldb.value;
+
localStorage.setItem("weabot", JSON.stringify(weabot));
}
function setInputs(id) {
- if (document.getElementById(id)) {
- with (document.getElementById(id)) {
- if (typeof fielda !== "undefined" && !fielda.value && weabot.name)
- fielda.value = weabot.name;
- if (typeof fielda !== "undefined" && !fieldb.value && weabot.email)
- fieldb.value = weabot.email;
- if (!password.value) password.value = getPassword();
- if (typeof preview !== "undefined") {
- preview.id = id;
- preview.addEventListener("click", previewPost);
- }
- addEventListener("submit", saveInputs);
+ with (document.getElementById(id)) {
+ if (typeof fielda !== "undefined" && weabot.name) {
+ fielda.value = weabot.name;
}
+ if (typeof fielda !== "undefined" && weabot.email) {
+ fieldb.value = weabot.email;
+ }
+ if (!password.value) {
+ password.value = getPassword();
+ }
+ if (typeof preview !== "undefined") {
+ preview.dataset.formid = id;
+ preview.addEventListener("click", previewPost);
+ }
+ if (typeof message !== "undefined" && document.body.clientWidth < 600) {
+ message.addEventListener("input", resizeTextbox);
+ }
+ addEventListener("submit", saveInputs);
}
}
@@ -64,13 +59,7 @@ function setInputs(id) {
function insert(text) {
var textarea = document.forms.postform.message;
if (textarea) {
- if (textarea.createTextRange && textarea.caretPos) {
- // IE
- var caretPos = textarea.caretPos;
- caretPos.text =
- caretPos.text.charAt(caretPos.text.length - 1) ==
- " " ? text + " " : text;
- } else if (textarea.setSelectionRange) {
+ if (textarea.setSelectionRange) {
// Firefox
var start = textarea.selectionStart;
var end = textarea.selectionEnd;
@@ -106,32 +95,51 @@ function postClick(num) {
}
function previewPost(e) {
- var formid = e.target.id;
- var thread = "0";
- if (formid.startsWith("postform")) thread = formid.substr(8);
+ var form = document.getElementById(e.target.dataset.formid);
+ var thread = e.target.dataset.formid.split('postform')[1];
+ var board = form.board.value;
+ var preview = document.getElementById('preview' + thread);
- var form = document.getElementById(formid);
- var preview = document.getElementById("preview" + thread);
- var main = document.getElementById("options");
+ if (e.target.className == '') { // show preview
+ if (form.message.value.trim() == '') {
+ return;
+ } // empty post, nevermind
- if (!form || !preview || !form.message.value) return;
- if (main) main.style.display = "";
+ e.target.className = 'active';
+ preview.textContent = 'Cargando...';
- preview.removeAttribute("style");
- preview.innerText = "Cargando...";
+ if (!thread) { // new thread
+ document.getElementById('tr_preview').removeAttribute('style');
+ } else {
+ preview.removeAttribute('style');
+ }
+ } else { // hide it
+ if (!thread) { // new thread
+ document.getElementById('tr_preview').style.display = 'none';
+ } else {
+ preview.style.display = 'none';
+ }
- var text = "message=" + encodeURIComponent(form.message.value) + "&board=" + board;
- if (thread) text += "&parentid=" + thread;
+ e.target.removeAttribute('class');
+ preview.textContent = null;
+ return;
+ }
+
+ var post = 'message=' + encodeURIComponent(form.message.value) + '&board=' + board + '&parentid=' + thread;
var xmlhttp = get_xmlhttp();
- xmlhttp.open("POST", "/cgi/preview");
+ xmlhttp.open('POST', '/cgi/preview');
xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4) preview.innerHTML = xmlhttp.responseText;
+ if (xmlhttp.readyState == 4) {
+ preview.innerHTML = xmlhttp.responseText;
+ }
};
- if (is_ie() || xmlhttp.setRequestHeader)
- xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- xmlhttp.send(text);
+ if (xmlhttp.setRequestHeader) {
+ xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ }
+ xmlhttp.send(post);
}
+
function get_xmlhttp() {
var xmlhttp;
try {
@@ -143,13 +151,11 @@ function get_xmlhttp() {
xmlhttp = null;
}
}
- if (!xmlhttp && typeof XMLHttpRequest != "undefined")
+ if (!xmlhttp && typeof XMLHttpRequest != "undefined") {
xmlhttp = new XMLHttpRequest();
+ }
return xmlhttp;
}
-function is_ie() {
- return document.all && !document.opera;
-}
function listSort(e) {
e.preventDefault();
@@ -183,16 +189,6 @@ function listSort(e) {
for (var j = 0; j < arr.length; j++) table.appendChild(arr[j]);
}
-function searchSubjects(e) {
- var filter = this.value.toLowerCase();
- var nodes = document.getElementById("threads").getElementsByTagName("tr");
- for (var i = 1; i < nodes.length; i++) {
- if (nodes[i].childNodes[3].textContent.toLowerCase().includes(filter))
- nodes[i].removeAttribute("style");
- else nodes[i].style.display = "none";
- }
-}
-
function togglePost(e) {
var post = e.parentElement;
var pid = post.id.slice(1);
@@ -212,10 +208,18 @@ function togglePost(e) {
localStorage.setItem("hid-p-"+board, hid.join("!"));
}
+function resizeTextbox(e) {
+ var limit = 256;
+ e.target.style.height = '';
+ e.target.style.height = Math.min((e.target.scrollHeight+2), limit) + 'px';
+}
+
document.addEventListener("DOMContentLoaded", function() {
- if (localStorage.hasOwnProperty("weabot"))
+ if (localStorage.hasOwnProperty("weabot")) {
weabot = JSON.parse(localStorage.getItem("weabot"));
- else weabot = { name: null, email: null, password: null };
+ } else {
+ weabot = { name: null, email: null, password: null };
+ }
board = document.body.dataset.brd;
@@ -263,7 +267,9 @@ 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);
+ if (forms[i].id.startsWith("postform")) {
+ setInputs(forms[i].id);
+ }
}
var styleSelect = document.getElementById("styles");
@@ -277,7 +283,6 @@ document.addEventListener("DOMContentLoaded", function() {
for (var i = 0; i < srt.length; i++) {
srt[i].addEventListener("click", listSort);
}
- document.getElementById("l_sr").addEventListener("keyup", searchSubjects);
}
var hidp = localStorage.getItem("hid-p-"+board);
@@ -292,11 +297,11 @@ document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("click", function(e) {
var txt = e.target.textContent;
- if (e.target.className == "num") {
+ /*if (e.target.className == "num") {
e.preventDefault();
postClick(txt);
return;
- }
+ }*/
if (txt == "del") {
e.preventDefault();
deletePost(e.target);
@@ -311,4 +316,4 @@ document.addEventListener("dblclick", function(e) {
window.getSelection().removeAllRanges();
return;
}
-}, false); \ No newline at end of file
+}, false);