aboutsummaryrefslogtreecommitdiff
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
parentb7e1bbd2c15961f3871e02cb3657cecc5f72b45f (diff)
downloadweabot-65fd303962d7744a5268db83a72fe66c7378565a.tar.gz
weabot-65fd303962d7744a5268db83a72fe66c7378565a.tar.xz
weabot-65fd303962d7744a5268db83a72fe66c7378565a.zip
Devolviendo previews
-rw-r--r--cgi/manage.py21
-rw-r--r--cgi/templates/board.html24
-rw-r--r--cgi/templates/board.jp.html10
-rw-r--r--cgi/templates/txt_board.en.html23
-rw-r--r--cgi/templates/txt_board.html19
-rw-r--r--cgi/templates/txt_thread.html10
-rw-r--r--cgi/templates/txt_threadlist.html35
-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
28 files changed, 306 insertions, 234 deletions
diff --git a/cgi/manage.py b/cgi/manage.py
index 690c807..5fb38d7 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -381,13 +381,13 @@ def manage(self, path_split):
# Nos vamos al board y ubicamos el post
board = setBoard(path_split[3])
- postid = int(path_split[4])
- post = FetchOne('SELECT `parentid`, `locked` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], pid) )
+ pid = int(path_split[4])
+ post = FetchOne('SELECT id, parentid, locked FROM posts WHERE boardid = %s AND id = %s LIMIT 1', (board['id'], pid) )
if not post:
message = _('Unable to locate a post with that ID.')
template_filename = "message.html"
else:
- if not post['parentid']:
+ if post['parentid'] != 0:
message = _('Post is not a thread opener.')
template_filename = "message.html"
else:
@@ -401,13 +401,14 @@ def manage(self, path_split):
UpdateDb("UPDATE `posts` SET `locked` = %s WHERE `boardid` = %s AND `id` = %s LIMIT 1",
(setLocked, board["id"], post["id"]))
threadUpdated(pid)
- if setLocked == 1:
- message = _('Thread successfully closed.')
- logAction(staff_account['username'], _('Closed thread %s') % ('/' + board['dir'] + '/' + pid) )
- else:
- message = _('Thread successfully opened.')
- logAction(staff_account['username'], _('Opened thread %s') % ('/' + board['dir'] + '/' + pid) )
- template_filename = "message.html"
+
+ if setLocked == 1:
+ message = _('Thread successfully closed.')
+ logAction(staff_account['username'], _('Closed thread %s') % ('/' + board['dir'] + '/' + str(pid)) )
+ else:
+ message = _('Thread successfully opened.')
+ logAction(staff_account['username'], _('Opened thread %s') % ('/' + board['dir'] + '/' + str(pid)) )
+ template_filename = "message.html"
elif path_split[2] == 'permasage':
setPermasaged = 0
diff --git a/cgi/templates/board.html b/cgi/templates/board.html
index 486c380..2f02408 100644
--- a/cgi/templates/board.html
+++ b/cgi/templates/board.html
@@ -35,10 +35,10 @@
</center>
<?py #endif ?>
<?py if oek_finish: ?>
-<center style="margin:0.5em 0;">
+<center style="margin:0.5em 0">
<table><tr><td>
<?py if oek_finish == "no": ?>
- <div style="font-size:xx-large;margin:0.25em;">No hay dibujo</div>
+ <div style="font-size:xx-large;margin:0.25em">No hay dibujo</div>
<?py else: ?>
<img src="#{images_url}#{board}/temp/#{oek_finish}.png?ts=#{ts}" />
<?py #endif ?>
@@ -51,7 +51,7 @@
<input type="hidden" name="parent" value="#{replythread}" />
<input type="hidden" name="default_subject" value="#{default_subject}" />
<?py #endif ?>
- <div style="display:none;">Trampa: <input type="text" name="name" size="25" /> <input type="text" name="email" size="25" /></div>
+ <div style="display:none">No tocar: <input type="text" name="name" size="25" /> <input type="text" name="email" size="25" /></div>
<table class="postform">
<?py if not disable_name: ?>
<tr>
@@ -87,7 +87,7 @@
<td class="postblock">Archivo</td>
<td>
<input type="file" name="file" id="file" accesskey="f" />
- <span id="filepreview" style="display:none;"></span>
+ <span id="filepreview" style="display:none"></span>
<?py if allow_spoilers: ?>
<label>[<input type="checkbox" name="spoil" id="spoil" />Spoiler]</label>
<?py #endif ?>
@@ -116,7 +116,7 @@
<li>Los hilos son automáticamente eliminados a los <b>#{maxage}</b> días de edad.</li>
<?py #endif ?>
<li>¿Eres nuevo? <a href="/guia.html">Leer antes de postear</a> · <a href="/faq.html">Preguntas frecuentes</a> · <a href="/bai/">Contacto</a></li>
- <li id="search"><form method="get" action="/tools/search.py" style="display:inline-block;"><input type="hidden" name="board" value="${board}"><label for="searchin">Buscar: </label><input type="text" name="q" id="searchin" value="" size="10"> <input type="submit" value="Ir"></form>
+ <li id="search"><form method="get" action="/tools/search.py" style="display:inline-block"><input type="hidden" name="board" value="${board}"><label for="searchin">Buscar: </label><input type="text" name="q" id="searchin" value="" size="10"> <input type="submit" value="Ir"></form>
<?py if not force_css: ?>
· <span>Estilo: <select id="styles">
<?py for title in styles: ?><option value="#{title}">#{title}</option><?py #endfor ?>
@@ -140,7 +140,7 @@
<?py for thread in threads: ?>
<div id="t#{thread['id']}" class="thread" data-length="#{thread['length']}">
<?py if not replythread: ?>
- <span class="unhide" style="display:none;">Hilo <a href="#{boards_url}#{board}/res/#{thread['id']}.html">#{thread['id']}</a> oculto. <a class="tt" href="#">Ver hilo</a></span>
+ <span class="unhide" style="display:none">Hilo <a href="#{boards_url}#{board}/res/#{thread['id']}.html">#{thread['id']}</a> oculto. <a class="tt" href="#">Ver hilo</a></span>
<?py #endif ?>
<?py for post in thread['posts']: ?>
<?py if not post['IS_DELETED']: ?>
@@ -184,9 +184,15 @@
<?py #endif ?>
</label>
<?py if post['email']: ?>
- <a href="mailto:#{post['email']}"><span class="name"><b>#{post['name']}</b> #{post['tripcode'] if post['tripcode'] else ''}</span></a>
+ <a href="mailto:#{post['email']}"><span class="name">
+ <b>#{post['name']}</b>
+ #{post['tripcode'] if post['tripcode'] else ''}
+ </span></a>
<?py else: ?>
- <span class="name"><b>#{post['name']}</b> #{post['tripcode'] if post['tripcode'] else ''}</span>
+ <span class="name">
+ <b>#{post['name']}</b>
+ #{post['tripcode'] if post['tripcode'] else ''}
+ </span>
<?py #endif ?>
<span class="date" data-unix="#{post['timestamp']}">#{post['timestamp_formatted']}</span>
<?py if replythread: ?>
@@ -231,7 +237,7 @@
</a>
<?py #endif ?>
<?py if post['thumb_width'] and post['parentid']: ?>
- <blockquote style="margin-left:#{post['thumb_width']+40}px;">#{post['message']}</blockquote>
+ <blockquote style="margin-left:#{post['thumb_width']+40}px">#{post['message']}</blockquote>
<?py else: ?>
<blockquote>#{post['message']}</blockquote>
<?py #endif ?>
diff --git a/cgi/templates/board.jp.html b/cgi/templates/board.jp.html
index ffb9d67..b33e42c 100644
--- a/cgi/templates/board.jp.html
+++ b/cgi/templates/board.jp.html
@@ -186,9 +186,15 @@
<?py #endif ?>
</label>
<?py if post['email']: ?>
- Name <a href="mailto:#{post['email']}"><span class="name"><b>#{post['name']}</b> #{post['tripcode'] if post['tripcode'] else ''}</span></a>
+ Name <a href="mailto:#{post['email']}"><span class="name">
+ <b>#{post['name']}</b>
+ #{post['tripcode'] if post['tripcode'] else ''}
+ </span></a>
<?py else: ?>
- Name <span class="name"><b>#{post['name']}</b> #{post['tripcode'] if post['tripcode'] else ''}</span>
+ Name <span class="name">
+ <b>#{post['name']}</b>
+ #{post['tripcode'] if post['tripcode'] else ''}
+ </span>
<?py #endif ?>
<span class="date" data-unix="#{post['timestamp']}">#{post['timestamp_formatted']}</span>
<?py if replythread: ?>
diff --git a/cgi/templates/txt_board.en.html b/cgi/templates/txt_board.en.html
index 7f280b4..9327c77 100644
--- a/cgi/templates/txt_board.en.html
+++ b/cgi/templates/txt_board.en.html
@@ -85,13 +85,14 @@
<?py if not thread['locked']: ?>
<form id="postform#{thread['id']}" class="postform" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="parent" value="#{thread['id']}" /><input type="hidden" name="password" value="" />
- <div style="display:none;"><input type="text" name="name" size="15" /> <input type="text" name="email" size="15" /></div>
- <input type="submit" value="Responder" /> <span><span>Name: </span><input type="text" name="fielda" size="15" /> <span>E-mail: </span><input type="text" name="fieldb" size="15" /></span>
+ <div style="display:none"><input type="text" name="name" size="13" /><input type="text" name="email" size="13" /></div>
+ <input type="submit" value="Reply" /> <input type="button" name="preview" data-thread="#{thread['id']}" value="Preview"> <span><span>Name: </span><input type="text" name="fielda" size="13" /> <span>E-mail: </span><input type="text" name="fieldb" size="13" /></span>
<div class="formpad">
- <textarea name="message" cols="70" rows="5"></textarea>
+ <div id="preview#{thread['id']}" class="msg" style="display:none"></div>
+ <textarea name="message" cols="90" rows="5"></textarea>
<?py if allow_image_replies: ?><br /><input type="file" name="file" /><?py #endif ?>
<?py else: ?>
-<form class="postform"><div class="locked">Thread has been closed. You cannot reply anymore.</div><div class="formpad">
+<form class="postform"><div class="locked"><b>Thread has been closed. You cannot reply anymore.</b></div><div class="formpad">
<?py #endif ?>
<div class="threadlinks">
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/"><b>Entire thread</b></a>
@@ -119,26 +120,26 @@
<h5>New thread form</h5>
<form id="postform0" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="password" value="" />
- <table style="max-width:600px">
+ <table style="max-width:700px">
<tr>
<td class="pblock">Subject:</td>
<td colspan="3" style="width:100%"><input type="text" name="subject" size="50" maxlength="100" /></td>
- <td><input type="submit" value="Crear nuevo hilo" /></td>
+ <td><input type="submit" value="Create new thread" /></td>
</tr>
<tr>
<td class="pblock">Name:</td>
<td><input type="text" name="fielda" /></td>
<td class="pblock">E-mail:</td>
<td><input type="text" name="fieldb" /></td>
- <td><input type="button" name="preview" value="Previsualizar" /></td>
+ <td><input type="button" name="preview" data-thread="0" value="Previsualizar" /></td>
</tr>
- <tr id="options" style="display:none;">
+ <tr id="tr_preview" style="display:none">
<td></td>
- <td colspan="4"><div id="preview0" class="msg"></div></td>
+ <td colspan="4"><div id="preview#{thread['id']}" class="msg"></div></td>
</tr>
<tr>
<td class="pblock">Body:</td>
- <td colspan="4"><textarea name="message" cols="70" rows="10"></textarea></td>
+ <td colspan="4"><textarea name="message" cols="90" rows="12" data-h-limit="512"></textarea></td>
</tr>
<?py if allow_images: ?>
<tr>
@@ -147,7 +148,7 @@
</tr>
<?py #endif ?>
</table>
- <div style="display:none;">Trampa: <input type="text" name="name" maxlength="50" /> <input type="text" name="email" maxlength="50" /></div>
+ <div style="display:none">No tocar: <input type="text" name="name" /><input type="text" name="email" /></div>
</form>
</div>
</div>
diff --git a/cgi/templates/txt_board.html b/cgi/templates/txt_board.html
index 3e279fc..a6899bf 100644
--- a/cgi/templates/txt_board.html
+++ b/cgi/templates/txt_board.html
@@ -25,7 +25,7 @@
<a name="menu"></a>
<?py if threads: ?>
<div id="threadbox" class="outerbox"><div class="innerbox">
- <div id="threadlinks"><a href="#{cgi_url}threadlist/#{board}"><b>Ver todos los hilos</b></a> <a href="kako/"><b>Ver hilos archivados</b></a> <a href="#newthread"><b>Crear nuevo hilo</b></a></div>
+ <div id="threadlinks"><a href="#{cgi_url}threadlist/#{board}"><b>Ver lista de hilos</b></a> <a href="kako/"><b>Hilos archivados</b></a> <a href="#newthread"><b>Crear nuevo hilo</b></a></div>
<div id="threadlist">
<?py iter = 1 ?>
<?py for thread in threads: ?>
@@ -85,13 +85,14 @@
<?py if thread['locked'] != 1: ?>
<form id="postform#{thread['id']}" class="postform" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="parent" value="#{thread['id']}" /><input type="hidden" name="password" value="" />
- <div style="display:none;"><input type="text" name="name" size="15" /> <input type="text" name="email" size="15" /></div>
- <input type="submit" value="Responder" /> <span><span>Nombre: </span><input type="text" name="fielda" size="15" /> <span>E-mail: </span><input type="text" name="fieldb" size="15" /></span>
+ <div style="display:none">No tocar: <input type="text" name="name" /><input type="text" name="email" /></div>
+ <input type="submit" value="Responder" /> <input type="button" name="preview" data-thread="#{thread['id']}" value="Previsualizar" /> <span><span>Nombre:&nbsp;</span><input type="text" name="fielda" size="13" /><span>&nbsp;E-mail:&nbsp;</span><input type="text" name="fieldb" size="13" /></span>
<div class="formpad">
- <textarea name="message" cols="70" rows="5"></textarea>
+ <div id="preview#{thread['id']}" class="msg" style="display:none"></div>
+ <textarea name="message" cols="90" rows="5"></textarea>
<?py if allow_image_replies: ?><br /><input type="file" name="file" /><?py #endif ?>
<?py else: ?>
-<form class="postform"><div class="locked">El hilo ha sido cerrado. Ya no se puede postear en él.</div><div class="formpad">
+<form class="postform"><div class="locked"><b>El hilo ha sido cerrado. Ya no se puede postear en él.</b></div><div class="formpad">
<?py #endif ?>
<div class="threadlinks">
<a href="#{boards_url}#{board}/read/#{thread['timestamp']}/"><b>Hilo completo</b></a>
@@ -119,7 +120,7 @@
<h5>Formulario de nuevo hilo</h5>
<form id="postform0" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="password" value="" />
- <table style="max-width:600px">
+ <table style="max-width:700px">
<tr>
<td class="pblock">Asunto:</td>
<td colspan="3" style="width:100%"><input type="text" name="subject" size="50" maxlength="100" /></td>
@@ -132,13 +133,13 @@
<td><input type="text" name="fieldb" /></td>
<td><input type="button" name="preview" value="Previsualizar" /></td>
</tr>
- <tr id="options" style="display:none;">
+ <tr id="tr_preview" style="display:none">
<td></td>
<td colspan="4"><div id="preview0" class="msg"></div></td>
</tr>
<tr>
<td class="pblock">Mensaje:</td>
- <td colspan="4"><textarea name="message" cols="70" rows="10"></textarea></td>
+ <td colspan="4"><textarea name="message" cols="90" rows="12" data-h-limit="512"></textarea></td>
</tr>
<?py if allow_images: ?>
<tr>
@@ -147,7 +148,7 @@
</tr>
<?py #endif ?>
</table>
- <div style="display:none;">Trampa: <input type="text" name="name" maxlength="50" /> <input type="text" name="email" maxlength="50" /></div>
+ <div style="display:none">No tocar: <input type="text" name="name" /><input type="text" name="email" /></div>
</form>
</div>
</div>
diff --git a/cgi/templates/txt_thread.html b/cgi/templates/txt_thread.html
index 907d660..77237ab 100644
--- a/cgi/templates/txt_thread.html
+++ b/cgi/templates/txt_thread.html
@@ -89,15 +89,17 @@
</div>
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="parent" value="#{thread['id']}" /><input type="hidden" name="password" value="" />
<?py if thread['locked'] != 1: ?>
- <div style="display:none;"><input type="text" name="name" size="13" /> <input type="text" name="email" size="13" /></div>
- <input type="submit" value="Responder" accesskey="z" /> <input type="button" name="preview" value="Previsualizar" /> <span><span>Nombre: </span><input type="text" name="fielda" size="13" accesskey="n" /> <span>E-mail: </span><input type="text" name="fieldb" size="13" accesskey="e" /></span><br />
- <textarea name="message" cols="80" rows="7" accesskey="m"></textarea><br />
+ <div style="display:none">No tocar: <input type="text" name="name" /><input type="text" name="email" /></div>
+ <input type="submit" value="Responder" /> <input type="button" name="preview" data-thread="#{thread['id']}" value="Previsualizar" /> <span><span>Nombre:&nbsp;</span><input type="text" name="fielda" size="13" /><span>&nbsp;E-mail:&nbsp;</span><input type="text" name="fieldb" size="13" /></span>
+ <br />
<div id="preview#{thread['id']}" class="msg" style="display:none"></div>
+ <textarea name="message" cols="100" rows="7" data-h-limit="512"></textarea>
<?py if allow_image_replies: ?>
+ <br />
<input type="file" name="file" />
<?py #endif ?>
<?py else: ?>
- <div class="locked">El hilo ha sido cerrado. Ya no se puede postear en él.</div>
+ <div class="locked"><b>El hilo ha sido cerrado. Ya no se puede postear en él.</b></div>
<?py #endif ?>
</form>
<?py #endfor ?>
diff --git a/cgi/templates/txt_threadlist.html b/cgi/templates/txt_threadlist.html
index 9d366ee..315b34f 100644
--- a/cgi/templates/txt_threadlist.html
+++ b/cgi/templates/txt_threadlist.html
@@ -25,7 +25,7 @@
<a name="menu"></a>
<div id="threadbox" class="outerbox"><div class="innerbox">
<div id="threadlinks"><a href="#{boards_url}#{board}/"><b>Volver al BBS</b></a> <a href="/#{board}/kako/"><b>Ver hilos archivados</b></a> <a href="#newthread"><b>Crear nuevo hilo</b></a></div>
- <div id="listmenu">Orden: <a class="l_s" href="#">Normal</a> <a class="l_s" href="#">Edad</a> <a class="l_s" href="#">Largo</a> <a class="l_s" href="#">Rapidez</a> <a class="l_s" href="#">Aleatorio</a> / Filtrar: <input id="l_sr" style="padding:0px;width:100px;" type="text"></div>
+ <div id="listmenu">Orden: <a class="l_s" href="#">Normal</a> <a class="l_s" href="#">Edad</a> <a class="l_s" href="#">Largo</a> <a class="l_s" href="#">Rapidez</a> <a class="l_s" href="#">Aleatorio</a></div>
</div></div>
<div class="thread">
<div class="innerbox">
@@ -57,27 +57,42 @@
<h5>Formulario de nuevo hilo</h5>
<form id="postform0" action="#{cgi_url}post" method="post" enctype="multipart/form-data">
<input type="hidden" name="board" value="#{board}" /><input type="hidden" name="password" value="" />
- <table style="max-width:600px">
+ <table style="max-width:700px">
<tr>
<td class="pblock">Asunto:</td>
<td colspan="3" style="width:100%"><input type="text" name="subject" size="50" maxlength="100" /></td>
<td><input type="submit" value="Crear nuevo hilo" /></td>
</tr>
<tr>
- <td class="pblock">Nombre:</td><td><input type="text" name="fielda" /></td>
- <td class="pblock">E-mail:</td><td><input type="text" name="fieldb" /></td>
+ <td class="pblock">Nombre:</td>
+ <td><input type="text" name="fielda" /></td>
+ <td class="pblock">E-mail:</td>
+ <td><input type="text" name="fieldb" /></td>
<td><input type="button" name="preview" value="Previsualizar" /></td>
</tr>
- <tr id="options" style="display:none"><td></td><td colspan="4"><div id="preview0" class="msg"></div></td></tr>
- <tr><td class="pblock">Mensaje:</td><td colspan="4"><textarea name="message" cols="70" rows="10"></textarea></td></tr>
+ <tr id="tr_preview" style="display:none">
+ <td></td>
+ <td colspan="4"><div id="preview0" class="msg"></div></td>
+ </tr>
+ <tr>
+ <td class="pblock">Mensaje:</td>
+ <td colspan="4"><textarea name="message" cols="90" rows="12" data-h-limit="512"></textarea></td>
+ </tr>
<?py if allow_images: ?>
- <tr><td class="pblock">Archivo:</td><td colspan="4"><input type="file" name="file" /></td></tr>
+ <tr>
+ <td class="pblock">Archivo:</td>
+ <td colspan="4"><input type="file" name="file" /></td>
+ </tr>
<?py #endif ?>
</table>
- <div style="display:none">Trampa: <input type="text" name="name" maxlength="50" /> <input type="text" name="email" maxlength="50" /></div>
+ <div style="display:none">No tocar: <input type="text" name="name" /><input type="text" name="email" /></div>
</form>
</div>
</div>
-<center id="footer"><a href="/" target="_top">Bienvenido a Internet BBS/IB</a> weabot.py <?py include('templates/revision.html') ?> + FastCGI + tenjin<br />No se ponga sensible, baisano...</center>
+<center id="footer">
+ <a href="/" target="_top">Bienvenido a Internet BBS/IB</a> weabot.py3 <?py include('templates/revision.html') ?> + bjoern + tenjin
+ <br />
+ No se ponga sensible, baisano...
+</center>
</body>
-</html> \ No newline at end of file
+</html>
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);