diff options
38 files changed, 713 insertions, 492 deletions
diff --git a/cgi/post.py b/cgi/post.py index a34bb39..e8c6444 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -256,7 +256,7 @@ def regenerateFrontPages(): posts_to_fetch = 0 for t in allthreads[:threads_to_fetch]: posts_to_fetch += int(t["length"]) - more_threads = allthreads[threads_to_fetch:50] + more_threads = allthreads[threads_to_fetch:40] # get the needed posts for the front page and order them posts_query = "SELECT * FROM `posts` WHERE `boardid` = %s ORDER BY `bumped` DESC, CASE parentid WHEN 0 THEN id ELSE parentid END ASC, `id` ASC LIMIT %s" diff --git a/cgi/templates/base_top.html b/cgi/templates/base_top.html index dcf3d65..3e86e44 100644 --- a/cgi/templates/base_top.html +++ b/cgi/templates/base_top.html @@ -36,7 +36,7 @@ <script type="text/javascript" src="#{static_url}js/autorefresh.js"></script> </head> <body#{' class="res"' if replythread else ''} data-brd="#{board}"> - <div id="main_nav"><span>[<a href="/" target="_top">Bienvenido a Internet</a>] [<?py include('templates/navbar.html') ?>]</span></div> + <div id="main_nav"><span>[<a href="/home.html">Bienvenido a Internet</a>] [<?py include('templates/navbar.html') ?>]</span></div> <div id="logo"> <?py if board: ?> #{board_long} diff --git a/cgi/templates/board.html b/cgi/templates/board.html index ee0ae59..d0e001a 100644 --- a/cgi/templates/board.html +++ b/cgi/templates/board.html @@ -17,7 +17,7 @@ <div class="postarea"> <?py if allow_oekaki and not oek_finish: ?> <center> - <form class="oekform" action="#{cgi_url}oekaki/paint" method="post" enctype="multipart/form-data"> + <form id="oekform" action="#{cgi_url}oekaki/paint" method="post" enctype="multipart/form-data"> <input type="hidden" name="board" value="#{board}" /> <?py if replythread: ?> <input type="hidden" name="parent" value="#{replythread}" /> @@ -52,7 +52,7 @@ <input type="hidden" name="default_subject" value="#{default_subject}" /> <?py #endif ?> <div style="display:none">No tocar: <input type="text" name="name" size="25" /> <input type="text" name="email" size="25" /></div> - <table class="postform"> + <table id="postform-t"> <?py if not disable_name: ?> <tr> <td class="postblock">Nombre</td> @@ -115,14 +115,8 @@ <?py if maxage: ?> <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> - <?py if not force_css: ?> - · <span>Estilo: <select id="styles"> - <?py for title in styles: ?><option value="#{title}">#{title}</option><?py #endfor ?> - </select></span> - <?py #endif ?> - </li> + <li>¿Eres nuevo? <a href="/guia.html" target="_blank">Leer antes de postear</a> · <a href="/faq.html" target="_blank">Preguntas frecuentes</a> · <a href="/bai/" target="_blank">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> </ul> </td> </tr> diff --git a/cgi/templates/board.jp.html b/cgi/templates/board.jp.html index db24cc1..372141d 100644 --- a/cgi/templates/board.jp.html +++ b/cgi/templates/board.jp.html @@ -17,7 +17,7 @@ <div class="postarea"> <?py if allow_oekaki and not oek_finish: ?> <center> - <form class="oekform" action="#{cgi_url}oekaki/paint" method="post" enctype="multipart/form-data"> + <form id="oekform" action="#{cgi_url}oekaki/paint" method="post" enctype="multipart/form-data"> <input type="hidden" name="board" value="#{board}" /> <?py if replythread: ?> <input type="hidden" name="parent" value="#{replythread}" /> @@ -54,17 +54,17 @@ <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> - <table class="postform"> + <table id="postform-t"> <?py if not disable_name: ?> <tr> <td class="postblock">おなまえ</td> - <td><input type="text" name="fielda" size="25" accesskey="n" /></td> + <td><input type="text" name="fielda" id="f-name" size="25" accesskey="n" /></td> </tr> <?py #endif ?> <tr> <td class="postblock">E-mail</td> <td> - <input type="text" name="fieldb" size="25" accesskey="e" /> + <input type="text" name="fieldb" id="f-mail" size="25" accesskey="e" /> <?py if disable_subject: ?> <input type="submit" value="#{'返信' if replythread else 'スレッドを立てる'}" accesskey="z" /> <?py #endif ?> @@ -74,14 +74,14 @@ <tr> <td class="postblock">題 名</td> <td> - <input type="text" name="subject" size="35" maxlength="100" accesskey="s" /> + <input type="text" name="subject" id="f-sub" size="35" maxlength="100" accesskey="s" /> <input type="submit" value="#{'返信' if replythread else 'スレッドを立てる'}" accesskey="z" /> </td> </tr> <?py #endif ?> <tr> <td class="postblock">コメント</td> - <td><textarea name="message" cols="50" rows="6" accesskey="m"></textarea></td> + <td><textarea name="message" id="f-msg" cols="50" rows="6" accesskey="m"></textarea></td> </tr> <?py if not oek_finish: ?> <?py if (replythread and allow_image_replies) or (not replythread and allow_images): ?> @@ -104,7 +104,7 @@ <?py #endif ?> <tr class="pass"> <td class="postblock">削除キー</td> - <td><input type="password" name="password" size="8" accesskey="p" /> (削除用)</form></td> + <td><input type="password" name="password" id="f-pass" size="8" accesskey="p" /> (削除用)</form></td> </tr> <tr> <td colspan="2" id="rules"> @@ -117,14 +117,8 @@ <?py if maxage: ?> <li>スレは<b>#{maxage}</b>日間経つと自動的に消されられます.</li> <?py #endif ?> - <li><a href="/guia.html">使い方</a> · <a href="/faq.html">よくある質問</a> · <a href="/bai/">管理人への連絡</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">検索:</label><input type="text" name="q" id="searchin" value="" size="10"> <input type="submit" value="GO"></form> - <?py if not force_css: ?> - · <span>スタイル:<select id="styles"> - <?py for title in styles: ?><option value="#{title}">#{title}</option><?py #endfor ?> - </select></span> - <?py #endif ?> - </li> + <li><a href="/guia.html" target="_blank">使い方</a> · <a href="/faq.html" target="_blank">よくある質問</a> · <a href="/bai/" target="_blank">管理人への連絡</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">検索:</label><input type="text" name="q" id="searchin" value="" size="10"> <input type="submit" value="GO"></form></li> </ul> </td> </tr> diff --git a/cgi/templates/catalog.html b/cgi/templates/catalog.html index 204f43a..5e71a0c 100644 --- a/cgi/templates/catalog.html +++ b/cgi/templates/catalog.html @@ -8,7 +8,6 @@ <a href="?sort=3">#{"<b>Más</b>" if i_sort == "3" else "Más"}</a> <a href="?sort=4">#{"<b>Menos</b>" if i_sort == "4" else "Menos"}</a>] [Tamaño: <a id="cat-size" href="#">Pequeño</a>] - [Filtrar: <input id="cat-srch" type="text"> <span id="hid-label" style="display:none;">[Hilos ocultos: <a id="hid-num" href="#"></a>]</span> </div> <div class="extramode">Modo Catálogo</div> @@ -18,12 +17,14 @@ <div id="t#{thread['id']}" class="thread"> <?py if thread['thumb'] != '': ?> <a href="#{boards_url}#{board}/res/#{thread['id']}.html" rel="nofollow"><img src="#{images_url}#{board}/cat/#{thread['thumb']}" alt="#{thread['id']}" /></a> + <br /> <?py #endif ?> <?py if thread['thumb'] != '': ?> - <p><strong class="subj">${thread['subject']} <span>(${thread['length']})</span></strong><br />${thread['message']}</p> + <div class="subj">${thread['subject']} <span>(${thread['length']})</span></div> <?py else: ?> - <p><a href="#{boards_url}#{board}/res/#{thread['id']}.html" rel="nofollow"><strong class="subj">${thread['subject']} <span>(${thread['length']})</span></strong></a><br />${thread['message']}</p> + <a href="#{boards_url}#{board}/res/#{thread['id']}.html" rel="nofollow"><div class="subj">${thread['subject']} <span>(${thread['length']})</span></div></a> <?py #endif ?> + ${thread['message']} <?py i += 1 ?> </div> <?py #endfor ?> diff --git a/cgi/templates/navbar.html b/cgi/templates/navbar.html index 1a42334..7fb1107 100644 --- a/cgi/templates/navbar.html +++ b/cgi/templates/navbar.html @@ -1,17 +1,17 @@ -<a href="/noticias/">Actualidad</a> -<a href="/tech/">Tecnología</a> -<a href="/juegos/">Juegos</a> -<a href="/letras/">Humanidades</a> -<a href="/drogas/">Psicotrópicos</a> -<a href="/zonavip/">Club VIP</a> -<a href="/consejos/">Consejos</a> -<a href="/world/">World</a> +<a id="b-noticias" href="/noticias/">Actualidad</a> +<a id="b-tech" href="/tech/">Tecnología</a> +<a id="b-juegos" href="/juegos/">Juegos</a> +<a id="b-letras" href="/letras/">Humanidades</a> +<a id="b-drogas" href="/drogas/">Psicotrópicos</a> +<a id="b-zonavip" href="/zonavip/">Club VIP</a> +<a id="b-consejos" href="/consejos/">Consejos</a> +<a id="b-world" href="/world/">World</a> | -<a href="/dqn/">Club DQN</a> -<a href="/2d/">二次元画像</a> -<a href="/z/">BaIAZ</a> -<a href="/a/">Artes</a> -<a href="/o/">Oekaki</a> -<a href="/0/">Cero</a> +<a id="b-dqn" href="/dqn/">Club DQN</a> +<a id="b-2d" href="/2d/">二次元画像</a> +<a id="b-z" href="/z/">BaIAZ</a> +<a id="b-a" href="/a/">Artes</a> +<a id="b-o" href="/o/">Oekaki</a> +<a id="b-0" href="/0/">Cero</a> | -<a href="/bai/">Meta</a> +<a id="b-bai" href="/bai/">Meta</a> diff --git a/cgi/templates/txt_archive.html b/cgi/templates/txt_archive.html index cf7077b..2526f44 100644 --- a/cgi/templates/txt_archive.html +++ b/cgi/templates/txt_archive.html @@ -27,7 +27,7 @@ <?py if threads: ?> <?py for thread in threads: ?> <div id="thread_nav"> - <a href="/" name="top" target="_top">Bienvenido a Internet</a> + <a href="/home.html" name="top">Bienvenido a Internet</a> <a href="#{boards_url}#{board}/">■Volver al BBS■</a> <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/">Hilo completo</a> <?py if thread['length'] > 100: ?> diff --git a/cgi/templates/txt_base_top.html b/cgi/templates/txt_base_top.html index 41ce920..285fc4d 100644 --- a/cgi/templates/txt_base_top.html +++ b/cgi/templates/txt_base_top.html @@ -28,9 +28,8 @@ <link rel="stylesheet" type="text/css" href="#{force_css}" /> <?py #endif ?> <script type="text/javascript" src="#{static_url}js/weabotxt.js"></script> - <script type="text/javascript" src="#{static_url}js/aquiencitas.js"></script> - <script type="text/javascript" src="#{static_url}js/shobon.js"></script> + <script type="text/javascript" src="#{static_url}js/aquiencitas.js" defer></script> <?py if replythread: ?> - <script type="text/javascript" src="#{static_url}js/autorefresh.js"></script> + <script type="text/javascript" src="#{static_url}js/autorefresh.js" defer></script> <?py #endif ?> </head> diff --git a/cgi/templates/txt_board.en.html b/cgi/templates/txt_board.en.html index 55d78ab..16fe616 100644 --- a/cgi/templates/txt_board.en.html +++ b/cgi/templates/txt_board.en.html @@ -1,6 +1,6 @@ <?py include('templates/txt_base_top.html') ?> <body class="mainpage" data-brd="#{board}"> -<div id="main_nav"><a href="/" target="_top">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> +<div id="main_nav"><a href="/home.html">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> <?py if banner_url: ?> <img id="banner" src="#{banner_url}" width="#{banner_width}" height="#{banner_height}" /> <?py #endif ?> @@ -13,11 +13,7 @@ <?py #endif ?> <form method="get" action="/tools/search.py" id="search"><input type="text" name="q" value="" /><input type="hidden" name="board" value="#{board}" /><input type="submit" value="Search active posts" /><input type="submit" value="Search archives" formaction="/tools/search_kako.py" /></form> </div> - <div class="innerbox links"><b>¿Eres nuevo?</b> <a href="/guia.html"><b>Cómo postear</b></a> | <a href="/faq.html"><b>Preguntas frecuentes</b></a> | <a href="/bai/"><b>Contacto</b></a> - <?py if not force_css: ?>| <b>Theme: </b><select id="styles"> - <?py for title in txt_styles: ?><option value="#{title}">#{title}</option><?py #endfor ?></select> - <?py #endif ?> -</div> + <div class="innerbox" id="bailinks"><b>¿Eres nuevo?</b> <a href="/guia.html" target="_blank"><b>Cómo postear</b></a> | <a href="/faq.html" target="_blank"><b>Preguntas frecuentes</b></a> | <a href="/bai/" target="_blank"><b>Contacto</b></a></div> </div> <?py if postarea_extra: ?> <div class="outerbox"><div class="innerbox">#{postarea_extra}</div></div> @@ -29,11 +25,11 @@ <div id="threadlist"> <?py iter = 1 ?> <?py for thread in threads: ?> - <a href="##{iter}">#{iter}: <b>#{thread["subject"]}</b> (#{thread['length']})</a><br /> + <a href="##{iter}">#{iter}: <b>#{thread["subject"]}</b> (#{thread['length']})</a> <?py iter += 1 ?> <?py #endfor ?> <?py for thread in more_threads: ?> - <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{'l50' if thread['length'] > 50 else ''}">#{iter}: <b>#{thread["subject"]}</b> (#{thread["length"]})</a><br /> + <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{'l50' if thread['length'] > 50 else ''}">#{iter}: <b>#{thread["subject"]}</b> (#{thread["length"]})</a> <?py iter += 1 ?> <?py #endfor ?> </div> diff --git a/cgi/templates/txt_board.html b/cgi/templates/txt_board.html index 0d386f1..8d01490 100644 --- a/cgi/templates/txt_board.html +++ b/cgi/templates/txt_board.html @@ -1,6 +1,6 @@ <?py include('templates/txt_base_top.html') ?> <body class="mainpage" data-brd="#{board}"> -<div id="main_nav"><a href="/" target="_top">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> +<div id="main_nav"><a href="/home.html">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> <?py if banner_url: ?> <img id="banner" src="#{banner_url}" width="#{banner_width}" height="#{banner_height}" /> <?py #endif ?> @@ -13,11 +13,7 @@ <?py #endif ?> <form method="get" action="/tools/search.py" id="search"><input type="text" name="q" value="" /><input type="hidden" name="board" value="#{board}" /><input type="submit" value="Buscar en mensajes activos" /><input type="submit" value="Buscar en archivo" formaction="/tools/search_kako.py" /></form> </div> - <div class="innerbox links"><b>¿Eres nuevo?</b> <a href="/guia.html"><b>Cómo postear</b></a> | <a href="/faq.html"><b>Preguntas frecuentes</b></a> | <a href="/bai/"><b>Contacto</b></a> - <?py if not force_css: ?>| <b>Estilo: </b><select id="styles"> - <?py for title in txt_styles: ?><option value="#{title}">#{title}</option><?py #endfor ?></select> - <?py #endif ?> -</div> + <div class="innerbox" id="bailinks"><b>¿Eres nuevo?</b> <a href="/guia.html" target="_blank"><b>Cómo postear</b></a> | <a href="/faq.html" target="_blank"><b>Preguntas frecuentes</b></a> | <a href="/bai/" target="_blank"><b>Contacto</b></a></div> </div> <?py if postarea_extra: ?> <div class="outerbox"><div class="innerbox">#{postarea_extra}</div></div> @@ -33,11 +29,11 @@ <div id="threadlist"> <?py iter = 1 ?> <?py for thread in threads: ?> - <a href="##{iter}">#{iter}: <b>#{thread["subject"]}</b> (#{thread['length']})</a><br /> + <a href="##{iter}">#{iter}: <b>#{thread["subject"]}</b> (#{thread['length']})</a> <?py iter += 1 ?> <?py #endfor ?> <?py for thread in more_threads: ?> - <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{'l50' if thread['length'] > 50 else ''}">#{iter}: <b>#{thread["subject"]}</b> (#{thread["length"]})</a><br /> + <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/#{'l50' if thread['length'] > 50 else ''}">#{iter}: <b>#{thread["subject"]}</b> (#{thread["length"]})</a> <?py iter += 1 ?> <?py #endfor ?> </div> diff --git a/cgi/templates/txt_error.html b/cgi/templates/txt_error.html index d8ae7cd..76b9d2a 100644 --- a/cgi/templates/txt_error.html +++ b/cgi/templates/txt_error.html @@ -49,4 +49,4 @@ ul {padding-left:40px;} </ul> </ul> </body> -</html>
\ No newline at end of file +</html> diff --git a/cgi/templates/txt_thread.html b/cgi/templates/txt_thread.html index 77c3101..ad1bce6 100644 --- a/cgi/templates/txt_thread.html +++ b/cgi/templates/txt_thread.html @@ -3,7 +3,7 @@ <?py if threads: ?> <?py for thread in threads: ?> <div id="thread_nav"> - <a href="/" name="top" target="_top">Bienvenido a Internet</a> + <a href="/home.html" name="top">Bienvenido a Internet</a> <a href="#{boards_url}#{board}/">■Volver al BBS■</a> <a href="#{boards_url}#{board}/read/#{thread['timestamp']}/">Hilo completo</a> <?py if thread['length'] > 100: ?> diff --git a/cgi/templates/txt_threadlist.html b/cgi/templates/txt_threadlist.html index 8cbd693..1504177 100644 --- a/cgi/templates/txt_threadlist.html +++ b/cgi/templates/txt_threadlist.html @@ -1,26 +1,22 @@ <?py include('templates/txt_base_top.html') ?> <body class="mainpage" data-brd="#{board}"> -<div id="main_nav"><a href="/" target="_top">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> +<div id="main_nav"><a href="/home.html">Bienvenido a Internet</a> | <?py include('templates/navbar.html') ?></div> <?py if banner_url: ?> - <img id="banner" src="#{banner_url}" style="width:#{banner_width}px;height:#{banner_height}px;" /> + <img id="banner" src="#{banner_url}" width="#{banner_width}" height="#{banner_height}" /> <?py #endif ?> <div id="titlebox" class="outerbox"> <div class="innerbox"> - <div class="threadnav"><a href="#menu" title="Ir a lista de hilos">■</a><a href="#1" title="Ir a primer hilo">▼</a></div> + <div class="threadnav"><a href="#menu" title="Ir a lista de hilos">■</a></div> <h1>#{board_long}</h1> <?py if postarea_desc: ?> <div id="rules">#{postarea_desc}</div> <?py #endif ?> <form method="get" action="/tools/search.py" id="search"><input type="text" name="q" value="" /><input type="hidden" name="board" value="#{board}" /><input type="submit" value="Buscar en mensajes activos" /><input type="submit" value="Buscar en archivo" formaction="/tools/search_kako.py" /></form> </div> - <div class="innerbox links"><b>¿Eres nuevo?</b> <a href="/guia.html"><b>Cómo postear</b></a> | <a href="/faq.html"><b>Preguntas frecuentes</b></a> | <a href="/bai/"><b>Contacto</b></a> - <?py if not force_css: ?>| <b>Estilo: </b><select id="styles"> - <?py for title in txt_styles: ?><option value="#{title}">#{title}</option><?py #endfor ?></select> - <?py #endif ?> -</div> + <div class="innerbox" id="bailinks"><b>¿Eres nuevo?</b> <a href="/guia.html" target="_blank"><b>Cómo postear</b></a> | <a href="/faq.html" target="_blank"><b>Preguntas frecuentes</b></a> | <a href="/bai/" target="_blank"><b>Contacto</b></a></div> </div> <?py if postarea_extra: ?> -<div class="outerbox"><div class="innerbox">#{postarea_extra}</div></div> + <div class="outerbox"><div class="innerbox">#{postarea_extra}</div></div> <?py #endif ?> <a name="menu"></a> <div id="threadbox" class="outerbox"><div class="innerbox"> diff --git a/static/css/cyber.css b/static/css/cyber.css index 39eee7a..2ded143 100644 --- a/static/css/cyber.css +++ b/static/css/cyber.css @@ -71,8 +71,8 @@ input[type="submit"]:active { .extramode { background: #001eff; } -.postform, -.oekform { +#postform-t, +#oekform { background: #2b2b2b; border: 1px solid #989898; box-shadow: 5px 5px #989898; diff --git a/static/css/dickgirl.css b/static/css/dickgirl.css index da5b708..69b2a3a 100644 --- a/static/css/dickgirl.css +++ b/static/css/dickgirl.css @@ -69,7 +69,7 @@ input[type="file"] { text-decoration: none; } .subj { - color: #d1a28c; + color: #ff7a7a; } .name { color: #acca82; diff --git a/static/css/easymodo.css b/static/css/easymodo.css index b8a00f4..5dfcdee 100644 --- a/static/css/easymodo.css +++ b/static/css/easymodo.css @@ -32,8 +32,9 @@ a:hover .name b, .extramode { background: #0040e0; } -.postform, -.oekform { +#postform-t, +#userdel, +#oekform { background: #cce1cf; border: 1px solid #cce1cf; padding: 1px; @@ -87,4 +88,4 @@ a:hover .name b, } #main_nav.mob { background: #cce1cf; -}
\ No newline at end of file +} diff --git a/static/css/hotdog.css b/static/css/hotdog.css index 1e38749..f4b0d55 100644 --- a/static/css/hotdog.css +++ b/static/css/hotdog.css @@ -14,7 +14,7 @@ html, body{ a, a .name, a .name b, .nav label, #pg a{ color:#fff } -.reply a, .reply a .name, .reply a .name b, .postform a, .oekform a, #main_nav a{ +.reply a, .reply a .name, .reply a .name b, #postform-t a, #oekform a, #main_nav a{ color:#000 } a:hover, a:hover .name, a:hover .name b, .nav label:hover, #main_nav a:hover{ @@ -52,7 +52,7 @@ input[type="submit"]:active, input[type="button"]:active{ color:#000; width:100% } -.postform, .oekform{ +#postform-t, #oekform{ background:#ff0; border:1px solid #000; color:#000; diff --git a/static/css/ib.css b/static/css/ib.css index 7ea910e..17b0f26 100644 --- a/static/css/ib.css +++ b/static/css/ib.css @@ -64,7 +64,7 @@ select, input[type="submit"], input[type="button"], button, -.oekform select { +#oekform select { padding: 0 1em; height: 1.7em; } @@ -78,14 +78,14 @@ textarea { #search input[type="text"] { width: 80px; } -#search input, +#search input[type="text"], #search select { height: 16px; } -.postform input[name="subject"] { +#postform-t input[name="subject"] { max-width: 300px; } -.postform textarea { +#postform-t textarea { width: 420px; height: 125px; } @@ -94,7 +94,7 @@ textarea { padding: 3px; white-space: nowrap; } -.oekform { +#oekform { margin-bottom: 0.5em; } #rules { @@ -172,6 +172,7 @@ body:not(.res) .thread.hidden > *, #pg span { border: 1px inset; display: table-cell; + vertical-align: middle; } #pg span input { height: initial; @@ -353,7 +354,7 @@ body:not(.res) .thread.hidden > *, .thread td { overflow: hidden; } - .postform input[type="submit"] { + #postform-t input[type="submit"] { height: 2em; margin-top: 2px; } diff --git a/static/css/putaba.css b/static/css/putaba.css index f86cb4e..9dd38be 100644 --- a/static/css/putaba.css +++ b/static/css/putaba.css @@ -74,8 +74,8 @@ hr, } .thread, #userdel, -.postform, -.oekform { +#postform-t, +#oekform { background: #fff; box-shadow: 1px 1px 1px rgba(50, 50, 50, 0.5); margin: 0 10px 10px; diff --git a/static/css/txt/ayashii.css b/static/css/txt/ayashii.css index 6653a92..a2d1835 100644 --- a/static/css/txt/ayashii.css +++ b/static/css/txt/ayashii.css @@ -64,12 +64,14 @@ button { .threadnav a { margin-left: 4px; } -.innerbox, .innerbox.links { +.innerbox, +#bailinks { margin: 0; padding: 0; } -.innerbox, .innerbox.links, -.mainpage .thread { +.innerbox, +#bailinks, +.mainpage > .thread { margin-bottom: 1em; padding-bottom: 1em; } @@ -78,13 +80,13 @@ hr { } hr, .innerbox, -.mainpage .thread, +.mainpage > .thread, .reply, .deleted, h3 { border-bottom: 2px groove gray; } -.links, +#bailinks, #listmenu { text-align: left; } diff --git a/static/css/txt/bbs.css b/static/css/txt/bbs.css index 622ab7e..c7fa759 100644 --- a/static/css/txt/bbs.css +++ b/static/css/txt/bbs.css @@ -9,8 +9,10 @@ textarea { font-family: arial, helvetica, sans-serif; font-size: 16px; } -body[data-brd="zonavip"], body[data-brd="zonavip"] textarea, -body[data-brd="world"], body[data-brd="world"] textarea, +body[data-brd="zonavip"], +body[data-brd="zonavip"] textarea, +body[data-brd="world"], +body[data-brd="world"] textarea, .threadnav { font-family: Mona,'MS PGothic',IPAMonaPGothic,sans-serif; } @@ -40,7 +42,7 @@ h3 { margin: 8px 0; line-height: 1em; } -h3 span { +h3 > span { display: inline-block; font-weight: normal; } @@ -103,23 +105,32 @@ ul { } #main_nav { font-size: 14px; - padding: 3px 0; + line-height: 18px; + padding: 1px 0; text-align: center; width: 100%; } -#main_nav select { +#main_nav > select { font-size: 85%; padding: 0; } -#main_nav a, -#thread_nav a, +#main_nav.mob { + position: fixed; + top: 0; + left: 0; + box-shadow: 0 1px 4px #000; + padding: 2px; + line-height: 1em; +} +#main_nav > a, +#thread_nav > a, #threadlinks a, .threadlinks a, label { display: inline-block; } .outerbox, -.mainpage .thread, +.mainpage > .thread, #footer { margin: 0 2.5% 1em; } @@ -127,7 +138,9 @@ label { padding: 7px; margin: 7px; } -.innerbox.links { +#bailinks { + font-size: 14px; + text-align: center; padding: 3px; } .threadnav { @@ -136,18 +149,14 @@ label { #search { margin-top: 0.5em; } -#search input { +#search > input { margin-right: 2px; } -#search input[type="text"] { +#search > input[type="text"] { padding: 4px; max-width: 500px; width: 100%; } -.links { - font-size: 14px; - text-align: center; -} #threadlinks { margin-bottom: 0.5em; text-align: center; @@ -161,12 +170,12 @@ label { flex-flow: row wrap; font-size: 14px; line-height: 1; - max-height: 18em; + max-height: 15em; overflow-y: auto; overflow-x: hidden; white-space: nowrap; } -#threadlist a { +#threadlist > a { -webkit-flex: 1 1 auto; -moz-flex: 1 1 auto; flex: 1 1 auto; @@ -287,7 +296,7 @@ form .msg { padding: 0.5em 2px; text-align: left; } -#tr_preview .msg { +#tr_preview > .msg { margin: 0; } .warn { @@ -332,23 +341,6 @@ form .msg { margin-top: 0.5em; line-height: 1em; } -#main_nav.mob { - position: fixed; - top: 0; - left: 0; - width: 100%; - box-shadow: 0 0 4px #000; - padding: 2px; - line-height: 1em; - font-size: 12px; -} - - -@media (min-width: 1600px) { - #threadlist { - max-height: 15em; - } -} @media (max-width: 600px) { body.threadpage { @@ -385,7 +377,7 @@ form .msg { .quoted { font-size: 10px; } - #threadlist a { + #threadlist > a { font-size: 10px; padding: 6px 3px; } @@ -398,7 +390,7 @@ form .msg { .del { visibility: visible; } - .reply .msg, + .reply > .msg, a.thumb { margin: 8px; } diff --git a/static/css/txt/blue moon.css b/static/css/txt/blue moon.css index 9ac26ba..da73058 100644 --- a/static/css/txt/blue moon.css +++ b/static/css/txt/blue moon.css @@ -83,7 +83,7 @@ button:active { margin: 0; padding: 10px; } -.links { +#bailinks { padding-top: 5px; } #threadlist { diff --git a/static/css/txt/futanari.css b/static/css/txt/futanari.css index 342c011..53ac646 100644 --- a/static/css/txt/futanari.css +++ b/static/css/txt/futanari.css @@ -34,7 +34,7 @@ h2 a, h2 a:hover, h3, #size { - color: #d1a28c; + color: #ff7a7a; } h2 span, h3 span { @@ -97,9 +97,6 @@ input[type="file"] { border-bottom: 1px solid #10181f; border-right: 1px solid #10181f; } -#settings { - border-bottom: 8px solid #5e8db4; -} #threadbox { border-top: 0; margin-top: 0; @@ -112,7 +109,7 @@ input[type="file"] { #createbox .innerbox { margin: 0; } -.innerbox.links { +#bailinks { background: #5b8bb4; padding: 0.5em; } diff --git a/static/css/txt/gamer.css b/static/css/txt/gamer.css index 9352597..ca7ab43 100644 --- a/static/css/txt/gamer.css +++ b/static/css/txt/gamer.css @@ -47,26 +47,26 @@ hr { margin-bottom: -4px; padding-bottom: 4px; } -#thread_nav a, +#thread_nav > a, #lastposts a, #n2 { color: #66b; } -#thread_nav a:active, +#thread_nav > a:active, #lastposts a:active, #n2:active { color: #afa; } -.links, +#bailinks, #threadlinks, .threadlinks { background: url("../img/g_bg3.png") top center; color: #ff0; } h4 a, -.threadnav a, -.links a, -#footer a { +.threadnav > a, +#bailinks > a, +#footer > a { text-decoration: none; } #threadlinks a, @@ -135,7 +135,8 @@ h4, background: #000; border: 1px solid #111; } -.deleted, .hidden { +.deleted, +.hidden { color: #777; margin: 0; } diff --git a/static/css/txt/headline.css b/static/css/txt/headline.css index 6c1a1bf..8e7f1dc 100644 --- a/static/css/txt/headline.css +++ b/static/css/txt/headline.css @@ -152,6 +152,11 @@ form .msg { margin: 0; padding: 0; } + h2, + h3 { + display: block; + } + background: #eee; .mainpage .postform, .postform { padding: .25em; diff --git a/static/css/txt/mercury.css b/static/css/txt/mercury.css index c727026..37d6778 100644 --- a/static/css/txt/mercury.css +++ b/static/css/txt/mercury.css @@ -163,6 +163,7 @@ form .msg { h2, h3 { background-position: 2px 2px; + display: block; padding-left: 0; } .mainpage .postform, diff --git a/static/css/txt/postal.css b/static/css/txt/postal.css index 0c3c013..e0a6dd2 100644 --- a/static/css/txt/postal.css +++ b/static/css/txt/postal.css @@ -31,7 +31,6 @@ input[type="button"], button { background: #cbcbcb; border: 0; - padding: 2px 10px; } input[type="submit"]:active, input[type="button"]:active, @@ -118,7 +117,7 @@ h4 { overflow: hidden; padding: 0 10px 1em; } -.innerbox.links { +#bailinks { border-top: 1px solid #e5b98d; margin: 0 -1px; } diff --git a/static/css/txt/rizzona.css b/static/css/txt/rizzona.css index 29bd2c4..8d72634 100644 --- a/static/css/txt/rizzona.css +++ b/static/css/txt/rizzona.css @@ -15,19 +15,19 @@ a:active, background: #aa0000; border-bottom: 1px solid #000; } -#main_nav a, .innerbox.links a { +#main_nav > a, +#bailinks > a { color: #000; } -#main_nav a:active, -.innerbox.links a:active, -.innerbox.links select { +#main_nav > a:active, +#bailinks > a:active { color: #A91C1C; background: rgb(255,207,97); } #titlebox > div:first-child { margin-bottom: 1em; } -#titlebox .innerbox.links { +#bailinks { background: #aa0000; } .outerbox .innerbox { diff --git a/static/css/txt/ventanas.css b/static/css/txt/ventanas.css index b2fe8f9..9fd4984 100644 --- a/static/css/txt/ventanas.css +++ b/static/css/txt/ventanas.css @@ -148,7 +148,7 @@ select:focus { padding: 10px; margin: 2px; } -.links { +#bailinks { border: 1px solid; border-color: #888 #dadada #dadada #888; padding: 2px; diff --git a/static/css/txt/waves.css b/static/css/txt/waves.css index 6509afa..25f0112 100644 --- a/static/css/txt/waves.css +++ b/static/css/txt/waves.css @@ -17,7 +17,9 @@ a:active, .outerbox, .mainpage .thread { background: #95b5db; } -h1, h5, #threadlinks { +h1, +h5, +#threadlinks { background: #95b5db; margin: -7px -7px 7px; padding-bottom: 7px; @@ -30,7 +32,7 @@ h1, h5, #threadlinks { .outerbox .innerbox { background: #cfe0f0; } -.innerbox.links { +#bailinks { background: #95b5db; padding: 0; } @@ -121,7 +123,9 @@ form .msg { body.threadpage { margin: 5px 0; } - h1, h5, #threadlinks { + h1, + h5, + #threadlinks { margin: -3px -3px 3px; padding-bottom: 2px; } diff --git a/static/example/bbs1.html b/static/example/bbs1.html index 67da2cf..f569fc6 100644 --- a/static/example/bbs1.html +++ b/static/example/bbs1.html @@ -20,7 +20,7 @@ <h1>Board 1@Bienvenido a Internet BBS</h1> <div id="rules">Descripción del board.</div> </div> - <div class="innerbox links"><a href="#"><b>Enlace 1</b></a> | <a href="#"><b>Enlace 2</b></a> | <a href="#"><b>Enlace 3</b></a></div> + <div class="innerbox" id="bailinks"><a href="#"><b>Enlace 1</b></a> | <a href="#"><b>Enlace 2</b></a> | <a href="#"><b>Enlace 3</b></a></div> </div> <div class="thread"> diff --git a/static/example/sky.jpg b/static/example/sky.jpg Binary files differnew file mode 100644 index 0000000..a9baed3 --- /dev/null +++ b/static/example/sky.jpg diff --git a/static/example/style.css b/static/example/style.css new file mode 100644 index 0000000..de0c621 --- /dev/null +++ b/static/example/style.css @@ -0,0 +1,212 @@ +* { + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + word-wrap: break-word; +} + +body { + background: #1B3345 url('/static/example/sky.jpg'); + color: #fff; + text-shadow: 1px 1px #000; + font-size: 16px; + font-family: serif; + line-height: 20px; + margin: 8px; +} + +h1, +h2 { + margin: 16px 0; + line-height: 1em; +} + +hr { + border:0; + background-image: repeating-linear-gradient( + 150deg, + #ff0 0px, + #ff0 10px, + #000 10px, + #000 20px + ); + height: 4px; + margin: 16px 0; +} + +a { + color:#EFD279; +} +a:hover { + color:#D00; +} +a:active { + color:#900; +} + +.desc { + margin-left:40px; +} + +.inputcont { + display: inline-block; + border-top: 3px solid #eee; + border-left: 3px solid #eee; + border-bottom: 3px solid #666; + border-right: 3px solid #666; + box-shadow: 1px 1px #000; +} + +select { + background: #fff; + border-bottom: 3px solid #eee; + border-right: 3px solid #eee; + border-top: 3px solid #666; + border-left: 3px solid #666; + height: 2.5em; + padding-right: 1em; +} + +input[type="button"] { + padding: 2px 1em; + background: #95CBE9; + color: #1c3700; + border-bottom: 3px solid #3B6B94; + border-right: 3px solid #3B6B94; + border-top: 3px solid #f5fbff; + border-left: 3px solid #f5fbff; +} + +input[type="button"]:active { + background: #4993bc; + border-width: 2px; + color: #000; + border-bottom: 3px solid #f5fbff; + border-right: 3px solid #f5fbff; + border-top: 3px solid #3B6B94; + border-left: 3px solid #3B6B94; +} + +#t-filters { + border-top: 2px solid #55802a; + border-left: 2px solid #55802a; + border-spacing: 6px; + text-align:center; +} + +#t-filters input[type="text"] { + background: #fff; + border: 2px solid #B2C1CC; + border-radius: 4px; + height: 30px; +} + +#t-filters input[type="text"]:focus, +#t-filters input[type="text"]:active, +#t-filters select.f-type:focus, +#t-filters select.f-type:active { + border: 2px solid #6c63bb; + border-radius: 4px; + outline: 0; +} + +#t-filters select.f-type { + background: #fff; + border: 2px solid #B2C1CC; + border-radius: 4px; + height: 30px; +} + +#t-filters select.f-type:focus, +#t-filters select.f-type:active { + background: #dff0fd; +} + +#t-filters td, +#t-filters th { + border: 0; + border-right: 1px solid #55802a; + border-bottom: 1px solid #55802a; + padding: 4px; +} + +#t-filters tfoot td { + padding: 0; + border: 0; +} + +#t-filters input[type="button"] { + width: 100%; +} + +label { + display: block; + padding: 4px 0; +} + +iframe { + background: rgb(0,0,0,0.4); + border: 1px dashed #73B233; + width: 750px; + height: 300px; + margin-top: 8px; + display: block; +} + +@media (max-width: 600px) { + body { + text-align: center; + font-size: 15px; + } + + .desc { + margin-left: 0; + } + + iframe { + width: 100%; + } + + input[type="text"], + input[type="button"], + .inputcont { + margin: 8px 0; + width: 100%; + display: block; + } + + .inputcont, + select { + width: 100%; + } + + #t-filters { + width: 102%; + border-width: 1px; + border-spacing: 2px; + margin-left: -1%; + } + + #t-filters td, + #t-filters th { + padding: 2px; + } + + #t-filters input[type="button"] { + padding: 2px; + margin: 0; + } + + #t-filters input[type="text"] { + margin: 0; + } + + #t-filters th { + font-size: 12px; + } + + #t-filters tfoot td { + padding-top: 2px; + padding-left: 2px; + } +} diff --git a/static/js/aquiencitas.js b/static/js/aquiencitas.js index 93f5323..309df8f 100644 --- a/static/js/aquiencitas.js +++ b/static/js/aquiencitas.js @@ -141,12 +141,12 @@ function remove_quote_preview(e) { if (pst) pst.scrollIntoView(); }*/ function quotePreview() { - if (localStorage.getItem("shobon_on") == "false") { - return; + if (localStorage.hasOwnProperty("weabot")) { + weabot = JSON.parse(localStorage.getItem("weabot")); + var showprev = weabot.qpreview; + var showlink = weabot.backlink; + if (showprev == false && showlink == false) { return; } } - var showprev = localStorage.getItem("shobon_preview"); - var showlink = localStorage.getItem("shobon_backlink"); - if (showprev == "false" && showlink == "false") return; var i, q, replies, quotes; @@ -168,12 +168,12 @@ function quotePreview() { q = quotes[i]; if (q.textContent.length < 3 || !q.textContent.startsWith(">>")) continue; - if (showprev != "false") { + if (showprev != false) { q.addEventListener("mouseover", who_are_you_quoting, false); q.addEventListener("mouseout", remove_quote_preview, false); } - if (showlink != "false") { + if (showlink != false) { fill_links(q); } } diff --git a/static/js/shobon.js b/static/js/shobon.js index 9eccf86..3a790a7 100644 --- a/static/js/shobon.js +++ b/static/js/shobon.js @@ -25,28 +25,6 @@ function shobon() { var newRepliesCounter = 0; - var shobon_time = localStorage.getItem("shobon_time"); - if (shobon_time != "false") { - if (boardName == "world") - week = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; - else if (boardName == "2d") - week = ["日", "月", "火", "水", "木", "金", "土"]; - else week = ["dom", "lun", "mar", "mie", "jue", "vie", "sab"]; - } - - if (where == "threads") { - if (shobon_time != "false") { - var dt = document.getElementsByClassName("date"); - for (var i = 0; i < dt.length; i++) { - dt[i].addEventListener("mouseover", function(e) { - this.title = "Hace " + timeAgo(this.dataset.unix); - }); - dt[i].textContent = localTime(dt[i].dataset.unix); - } - } - return; - } - if (localStorage.getItem("shobon_usefilters") != "false") { loadFilters(); } @@ -77,16 +55,6 @@ function shobon() { var message = reply.getElementsByClassName("msg")[0]; var id = 0; - if (shobon_time != "false") { - var date = reply.getElementsByClassName("date")[0]; - date.addEventListener("mouseover", function(e) { - this.title = "Hace " + timeAgo(this.dataset.unix); - }); - if (date.textContent.includes("ID:")) - id = date.textContent.split(" ")[1]; - date.textContent = localTime(date.dataset.unix, id); - } - if (localStorage.getItem("shobon_newposts") == "true") { var replyId = reply.attributes["data-n"].value; var isNewReply = parseInt(lastSeen) < parseInt(replyId); @@ -185,37 +153,6 @@ function createTh(label, w) { th.width = w; return th; } -function timeAgo(timestamp) { - var time = Math.round(Date.now() / 1000); - var el = time - timestamp; - if (el == 0) return "un instante"; - else if (el == 1) return "un segundo"; - else if (el < 60) return el + " segundos"; - else if (el < 120) return "un minuto"; - else if (el < 3600) return Math.round(el / 60) + " minutos"; - else if (el < 7200) return "una hora"; - else if (el < 86400) return Math.round(el / 3600) + " horas"; - else if (el < 172800) return "un día"; - else if (el < 2628000) return Math.round(el / 86400) + " días"; - else if (el < 5256000) return "un mes"; - else if (el < 31536000) return Math.round(el / 2628000) + " meses"; - else if (el > 31535999) return "más de un año"; -} - -function localTime(timestamp, id) { - id = id || 0; - var lcl = new Date(timestamp * 1000); - lcl = - ("0" + lcl.getDate()).slice(-2) + "/" + - ("0" + (lcl.getMonth() + 1)).slice(-2) + - "/" + lcl.getFullYear().toString().slice(-2) + - "(" + week[lcl.getDay()] + ")" + - ("0" + lcl.getHours()).slice(-2) + ":" + - ("0" + lcl.getMinutes()).slice(-2) + ":" + - ("0" + lcl.getSeconds()).slice(-2); - if (id) lcl = lcl + " " + id; - return lcl; -} function loadFilters() { var filters = JSON.parse(localStorage.getItem("shobon_filters")); @@ -315,7 +252,6 @@ function shobonSettings(e) { p.appendChild(createCheckbox("shobon_ids", "Colorear IDs", false)); p.appendChild(createCheckbox("shobon_embedimg", "Insertar imágenes miniatura", false)); p.appendChild(createCheckbox("shobon_newposts", "Destacar mensajes nuevos", false)); - p.appendChild(createCheckbox("shobon_time", "Convertir fechas a hora local", true)); p.appendChild(createCheckbox("shobon_backlink", "Mostrar quién ha citado un post", true)); p.appendChild(createCheckbox("shobon_preview", "Previsualizar citas", true)); p.appendChild(createCheckbox("shobon_usefilters", "Activar filtros", false)); @@ -443,26 +379,6 @@ function paintIds(reply) { ";padding:0 3px;border-radius:5px; font-size:0.9em;vertical-align:top;'>ID:" + userId + "</span>"; - dateId.getElementsByClassName("uid")[0].addEventListener("click", markId, false); - } -} - -function markId(e) { - var uid = this.textContent.slice(0, -1).replace(":", "_"); - var sel = document.getElementsByClassName("sel"); - var len = sel.length; - for (i = 0; i < len; i++) { - var prev = String(sel[0].className); - sel[0].className = sel[0].className.toString().replace(/ sel/i, ""); - } - if (currentSel == uid) { - currentSel = null; - return; - } - currentSel = uid; - var tosel = document.getElementsByClassName(uid); - for (j = 0; j < tosel.length; j++) { - tosel[j].className = tosel[j].className + " sel"; } } diff --git a/static/js/userconf.js b/static/js/userconf.js index 985090a..0118e88 100644 --- a/static/js/userconf.js +++ b/static/js/userconf.js @@ -7,25 +7,25 @@ function cargarEstilos() { } function listarEstilos(id, estilos, def) { - var select = document.getElementById(id); - - for (var i=0; i < estilos.length; i++) { - var opt = document.createElement('option'); - opt.value = estilos[i]; - opt.textContent = estilos[i]; - if (i == def) { - opt.selected = true; - } - select.appendChild(opt); - } + var select = document.getElementById(id); + + for (var i=0; i < estilos.length; i++) { + var opt = document.createElement('option'); + opt.value = estilos[i]; + opt.textContent = estilos[i]; + if (i == def) { + opt.selected = true; + } + select.appendChild(opt); + } } request.onreadystatechange = function() { if (request.readyState == 4) { var json = JSON.parse(request.responseText); if (json.state == "success") { - listarEstilos('stylebbs', json.bbs_styles, json.bbs_styles_default); - listarEstilos('styleib', json.ib_styles, json.ib_styles_default); + listarEstilos('stylebbs', json.bbs_styles, json.bbs_styles_default); + listarEstilos('styleib', json.ib_styles, json.ib_styles_default); } } }; @@ -37,11 +37,11 @@ function cambiarModo(e) { if (this.dataset.view == '1') { iframe.addEventListener('load', mostrarEstilo); iframe.src = '/static/example/bbs2.html'; - this.value = 'Ver modo frontal'; + this.value = 'Previsualizar board'; this.dataset.view = '2'; } else { iframe.src = '/static/example/bbs1.html'; - this.value = 'Ver modo respuesta'; + this.value = 'Previsualizar respuesta'; this.dataset.view = '1'; } } @@ -64,6 +64,10 @@ function mostrarEstilo(e) { } css.href = loc + estilo.toLowerCase() + ".css"; + + var key = 'weabot_style_' + tipo; + var estilo = document.getElementById(('style'+tipo)).value; + localStorage.setItem(key, estilo); } function cargariframe(tipo) { @@ -73,7 +77,6 @@ function cargariframe(tipo) { iframe.addEventListener('load', cargarDatos); iframe.src = '/static/example/' + tipo + '1.html'; var div = document.getElementById("desc" + tipo); - div.appendChild(document.createElement("br")); div.appendChild(iframe); } @@ -89,26 +92,135 @@ function cargarDatos(e) { this.removeEventListener('load', cargarDatos); } -function establecerEstilo(e) { - var key = e.target.dataset.key; -} - function init(tipo) { cargariframe(tipo); document.getElementById('style'+tipo).addEventListener('change', mostrarEstilo); - document.getElementById('set'+tipo).addEventListener('click', function() { - var key = 'weabot_style_' + tipo; - var estilo = document.getElementById(('style'+tipo)).value; - localStorage.setItem(key, estilo); - }); +} + +function checkboxes() { + var chk = document.getElementsByClassName("weabot-obj"); + for (var i=0; i < chk.length; i++) { + chk[i].addEventListener("change", saveInput); + } +} + +function saveInput(e) { + var key = e.target.id; + weabot[key] = e.target.checked; + localStorage.setItem("weabot", JSON.stringify(weabot)); +} + +function setInputs() { + for (key in weabot) { + var chk = document.getElementById(key); + if (chk) { + document.getElementById(key).checked = weabot[key]; + } + } +} + +function cargarFiltros() { + var del = document.getElementsByClassName("f-remove"); + for (var i=0; i < del.length; i++) { + del[i].addEventListener('click', quitarFiltro); + } + + if (localStorage.hasOwnProperty("weabot-filtros")) { + var lista = document.getElementById("filterlist"); + var filtros = JSON.parse(localStorage.getItem("weabot-filtros")); + + for (var i=0; i < filtros.length; i++) { + nuevoFiltro(filtros[i].usar, filtros[i].patron, filtros[i].tipo); + } + } else { + nuevoFiltro(); + } + + document.getElementById('newfilter').addEventListener('click', function(){ nuevoFiltro(); }); + document.getElementById('savefilters').addEventListener('click', guardarFiltros); +} + +function nuevoFiltro(usar, patron, tipo) { + if (arguments.length == 0) { + var usar = true; + var patron = ''; + var tipo = 0; + } else { + tipo = parseInt(tipo); + } + + var lista = document.getElementById("filterlist"); + var fila = document.createElement("tr"); + var selected = ['', '', '', '']; + selected[tipo] = ' selected="selected"'; + var html = '<td><input type="checkbox" name="f-enabled"' + + (usar ? ' checked="checked"></td>' : '></td>'); + html += '<td><input type="text" name="f-pattern" value="' + patron + '"></td>'; + html += '<td><select class="f-type">' + + '<option value="0"' + selected[0] + '>Mensaje</option>' + + '<option value="1"' + selected[1] + '>ID</option>' + + '<option value="2"' + selected[2] + '>Tripcode</option>' + + '<option value="3"' + selected[3] + '>Nombre</option>' + + '</select></td>'; + html += '<td><input type="button" name="f-remove" class="f-remove" value="x"></td>'; + fila.innerHTML = html; + fila.children[3].firstChild.addEventListener('click', quitarFiltro); + lista.appendChild(fila); +} + +function quitarFiltro(e) { + var lista = document.getElementById("filterlist"); + var delme = e.target.parentElement.parentElement; + if (lista.children.length == 1) { + nuevoFiltro(); + } + delme.parentNode.removeChild(delme); +} + +function guardarFiltros() { + var f; + var filtros = []; + var tr = document.getElementById("filterlist").getElementsByTagName("tr"); + + for (var i=0; i < tr.length; i++) { + var pat = tr[i].children[1].firstChild.value.trim(); + if (pat != '') { + f = { + usar: tr[i].children[0].firstChild.checked, + patron: pat, + tipo: parseInt(tr[i].children[2].firstChild.value) + } + filtros.push(f); + } + } + + if (filtros.length > 0) { + localStorage.setItem("weabot-filtros", JSON.stringify(filtros)); + } else { + localStorage.removeItem("weabot-filtros"); + } } document.addEventListener("DOMContentLoaded", function() { - document.getElementById("escondeme").style.display = 'none'; + if (localStorage.hasOwnProperty("weabot")) { + weabot = JSON.parse(localStorage.getItem("weabot")); + } else { + weabot = { + localtime: false, + qpreview: true, + backlink: true, + filters: false + }; + localStorage.setItem("weabot", JSON.stringify(weabot)); + } + setInputs(); cargarEstilos(); + checkboxes(); + cargarFiltros(); document.getElementById('switchview').addEventListener('click', cambiarModo); + init('bbs'); init('ib'); }); diff --git a/static/js/weabot.js b/static/js/weabot.js index 693d138..afe65c8 100644 --- a/static/js/weabot.js +++ b/static/js/weabot.js @@ -1,30 +1,11 @@ var style_cookie = "weabot_style_ib"; if (localStorage.hasOwnProperty(style_cookie)) { - setTheme(localStorage.getItem(style_cookie)); -} - -function setTheme(styletitle) { var css = document.getElementById("css"); if (css) { - css.href = "/static/css/" + styletitle.toLowerCase() + ".css"; - localStorage.setItem(style_cookie, styletitle); + css.href = "/static/css/" + localStorage.getItem(style_cookie).toLowerCase() + ".css"; } } -/* 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 postClick(num) { var sel = window.getSelection().toString(); if (sel) sel = sel.replace(/^/gm, ">") + "\n"; @@ -204,16 +185,6 @@ function getPassword() { return pass; } -function catSearch() { - var filter = this.value.toLowerCase(); - var nodes = document.getElementsByTagName("p"); - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].innerText.toLowerCase().includes(filter)) - nodes[i].parentNode.removeAttribute("style"); - else nodes[i].parentNode.style.display = "none"; - } -} - function togglePost(e) { if (e.tagName == "DIV") { var post = e.parentElement; @@ -223,24 +194,32 @@ function togglePost(e) { var pid = post.id.slice(1); var typ = post.id.charAt(0); - var itm = "hid-" + typ + "-" + document.body.dataset.brd; + var itm = "hid-" + typ + "-" + board; var hidp = localStorage.getItem(itm); var hid = Array(); - if (hidp) hid = hidp.split("!"); + if (hidp) { hid = hidp.split("!"); } if (post.classList.contains("hidden")) { - if (hid.includes(pid)) hid.splice(hid.indexOf(pid), 1); + if (hid.includes(pid)) { + hid.splice(hid.indexOf(pid), 1); + } } else { - if (!hid.includes(pid)) hid.push(pid); + if (!hid.includes(pid)) { + hid.push(pid); + } } post.classList.toggle("hidden"); localStorage.setItem(itm, hid.join("!")); } +function checkHidden() { + +} + document.addEventListener("DOMContentLoaded", function(e) { - var board = document.body.dataset.brd; + board = document.body.dataset.brd; checkhighlight(); if (localStorage.hasOwnProperty("weabot")) { @@ -249,15 +228,10 @@ document.addEventListener("DOMContentLoaded", function(e) { weabot = { name: null, email: null, password: null }; } - var head = document.getElementById("main_nav"); - var a = head.getElementsByTagName("a"); - for (var i = 0; i < a.length; i++) { - if (a[i].getAttribute("href") == "/" + board + "/") { - a[i].className = "cur_brd"; - break; - } - } + var blink = document.getElementById("b-" + board); + if (blink) { blink.className = "cur_brd"; } + var head = document.getElementById("main_nav"); if (document.body.clientWidth < 600) { var navlink = head.getElementsByTagName("a"); @@ -296,17 +270,11 @@ document.addEventListener("DOMContentLoaded", function(e) { var hid = hidp.split("!"); for (var j = 0; j < hid.length; j++) { var post = document.getElementById(type+hid[j]); - if (post) post.classList.add("hidden"); + if (post) { post.classList.add("hidden"); } } } } - var styleSelect = document.getElementById("styles"); - if (styleSelect) { - styleSelect.addEventListener("change", function(e) { setTheme(this.value); }); - styleSelect.value = localStorage.getItem(style_cookie); - } - if (document.getElementById("postform")) { setInputs("postform"); postform.file.addEventListener("change", filePreview); @@ -317,7 +285,7 @@ document.addEventListener("DOMContentLoaded", function(e) { var cat = document.getElementById("catalog"); if (cat) { - if (j>0) { + if (j > 0) { // hidden threads number document.getElementById("hid-label").removeAttribute("style"); document.getElementById("hid-num").innerText = j; } @@ -338,40 +306,49 @@ document.addEventListener("DOMContentLoaded", function(e) { this.innerText = (this.innerText == "Pequeño") ? "Grande" : "Pequeño"; }); - document.getElementById("cat-srch").addEventListener("keyup", catSearch); - document.getElementById("hid-num").addEventListener("click", function(e) { e.preventDefault(); cat.classList.toggle("showhid"); }); - } else { - window.addEventListener("hashchange", checkhighlight); - } + } + + window.addEventListener("hashchange", checkhighlight); }); -document.addEventListener("click", function(e) { - var cn = e.target.className; - if (cn == "num") { - e.preventDefault(); - postClick(e.target.textContent); - return; - } - if (cn == "expimg") { - e.preventDefault(); - expandimg(e.target); - return; - } - if (cn == "tt") { - e.preventDefault(); - togglePost(e.target); - return; - } -}, false); -document.addEventListener("dblclick", function(e) { - if (e.target.closest(".info")) { - e.preventDefault(); - togglePost(e.target.closest(".info")); - return; - } -}, false); + +window.addEventListener("load", function() { + document.addEventListener("click", function(e) { + var cn = e.target.className; + if (cn == "num") { + e.preventDefault(); + postClick(e.target.textContent); + return; + } + if (cn == "expimg") { + e.preventDefault(); + expandimg(e.target); + return; + } + if (cn == "tt") { + e.preventDefault(); + togglePost(e.target); + return; + } + }, false); + + document.addEventListener("dblclick", function(e) { + if (e.target.closest(".info")) { + e.preventDefault(); + togglePost(e.target.closest(".info")); + return; + } + if (document.getElementById("catalog")) { + if (e.target.className == 'subj') { + e.preventDefault(); + togglePost(e.target.className == 'subj'); + return; + } + } + }, false); +}); diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index 27d3cda..273856d 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -1,12 +1,9 @@ var style_cookie = "weabot_style_bbs"; if (localStorage.hasOwnProperty(style_cookie)) { - setTheme(localStorage.getItem(style_cookie)); -} - -function setTheme(styletitle) { var css = document.getElementById("css"); - if (css) css.href = "/static/css/txt/" + styletitle.toLowerCase() + ".css"; - localStorage.setItem(style_cookie, styletitle); + if (css) { + css.href = "/static/css/txt/" + localStorage.getItem(style_cookie).toLowerCase() + ".css"; + } } function getPassword() { @@ -27,14 +24,14 @@ 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.fieldb !== "undefined") weabot.email = form.fieldb.value; + if (typeof form.fielda !== "undefined") { weabot.name = form.fielda.value; } + if (typeof form.fieldb !== "undefined") { weabot.email = form.fieldb.value; } localStorage.setItem("weabot", JSON.stringify(weabot)); } -function setInputs(id) { - with (document.getElementById(id)) { +function setInputs(form) { + with (form) { if (typeof fielda !== "undefined" && weabot.name) { fielda.value = weabot.name; } @@ -45,12 +42,9 @@ function setInputs(id) { password.value = getPassword(); } if (typeof preview !== "undefined") { - preview.dataset.formid = id; + preview.dataset.formid = form.id; preview.addEventListener("click", previewPost); } - if (typeof message !== "undefined" && document.body.clientWidth < 600) { - message.addEventListener("input", resizeTextbox); - } addEventListener("submit", saveInputs); } } @@ -74,17 +68,6 @@ function insert(text) { return false; } -function deletePost(e) { - var ids = e.parentElement.firstChild.href.split("/"); - var post = ids.pop(); - var realid = ids.pop(); - if (confirm("¿Seguro que deseas borrar el mensaje " + post + "?")) { - var script = "/cgi/delete"; - document.location = script + "?board=" + board + "&password=" + - weabot.password + "&delete=" + realid; - } -} - function postClick(num) { var sel = window.getSelection().toString(); if (sel) { @@ -94,17 +77,27 @@ function postClick(num) { insert(">>" + num + sel); } +function deletePost(e) { + var ids = e.parentElement.firstChild.getAttribute("href").split("/"); + var post = ids.pop(); + var realid = ids.pop(); + if (confirm("¿Seguro que deseas borrar el mensaje " + post + "?")) { + var script = "/cgi/delete"; + document.location = script + "?board=" + board + + "&password=" + weabot.password + "&delete=" + realid; + } +} + function previewPost(e) { var form = document.getElementById(e.target.dataset.formid); + if (form.message.value.trim() == '') { + return; + } // empty post, nevermind var thread = e.target.dataset.formid.split('postform')[1]; var board = form.board.value; var preview = document.getElementById('preview' + thread); if (e.target.className == '') { // show preview - if (form.message.value.trim() == '') { - return; - } // empty post, nevermind - e.target.className = 'active'; preview.textContent = 'Cargando...'; @@ -157,36 +150,47 @@ function get_xmlhttp() { return xmlhttp; } -function listSort(e) { - e.preventDefault(); - var s = this.textContent; - var table = document.getElementById("threads"); - var arr = Array.prototype.slice.call(table.getElementsByTagName("tr")); - arr.shift(); - if (s == "Normal") { - arr.sort(function(a, b) { - return (parseInt(a.childNodes[1].textContent) - parseInt(b.childNodes[1].textContent)); - }); - } else if (s == "Edad") { - arr.sort(function(a, b) { - return (b.children[1].firstChild.href.split("/")[5] - a.children[1].firstChild.href.split("/")[5]); - }); - } else if (s == "Largo") { - arr.sort(function(a, b) { - return (b.children[2].textContent - a.children[2].textContent); - }); - } else if (s == "Rapidez") { - var now = Math.round(Date.now() / 1000); - arr.sort(function(a, b) { - return (b.children[2].textContent / (now - b.children[1].firstChild.href.split("/")[5]) - - a.children[2].textContent / (now - a.children[1].firstChild.href.split("/")[5])); - }); - } else if (s == "Aleatorio") { - arr.sort(function(a, b) { - return 0.5 - Math.random(); - }); +function listPrepare() { + function listSort(e) { + e.preventDefault(); + var sort = e.target.textContent; + var table = document.getElementById("threads"); + var arr = Array.prototype.slice.call(table.getElementsByTagName("tr")); + arr.shift(); + if (sort == "Normal") { + arr.sort(function(a, b) { + return (parseInt(a.childNodes[1].textContent) - parseInt(b.childNodes[1].textContent)); + }); + } else if (sort == "Edad") { + arr.sort(function(a, b) { + return (b.children[1].firstChild.getAttribute("href").split("/")[5] + - a.children[1].firstChild.getAttribute("href").split("/")[5]); + }); + } else if (sort == "Largo") { + arr.sort(function(a, b) { + return (b.children[2].textContent - a.children[2].textContent); + }); + } else if (sort == "Rapidez") { + var now = Math.round(Date.now() / 1000); + arr.sort(function(a, b) { + return (b.children[2].textContent + / (now - b.children[1].firstChild.getAttribute("href").split("/")[5]) + - a.children[2].textContent / (now - a.children[1].firstChild.getAttribute("href").split("/")[5])); + }); + } else if (sort == "Aleatorio") { + arr.sort(function(a, b) { + return 0.5 - Math.random(); + }); + } + for (var j = 0; j < arr.length; j++) { + table.appendChild(arr[j]); + } + } + + var srt = document.getElementById("listmenu").children; + for (var i = 0; i < srt.length; i++) { + srt[i].addEventListener("click", listSort); } - for (var j = 0; j < arr.length; j++) table.appendChild(arr[j]); } function checkHidden() { @@ -195,7 +199,9 @@ function checkHidden() { var hid = hidp.split("!"); for (var i = 0; i < hid.length; i++) { var post = document.getElementById("p"+hid[i]); - if (post) post.classList.add("hidden"); + if (post) { + post.classList.add("hidden"); + } } } } @@ -206,7 +212,7 @@ function togglePost(e) { var hidp = localStorage.getItem("hid-p-"+board); var hid = Array(); - if (hidp) hid = hidp.split("!"); + if (hidp) { hid = hidp.split("!"); } if (post.classList.contains("hidden")) { post.classList.remove("hidden"); @@ -219,115 +225,134 @@ 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'; +function smallsjis() { + var rx = /( \| /|\ |/ | ̄ ̄|| | ||\| | \|)/; + var msg = document.getElementsByClassName("msg"); + for (var i=0; i < msg.length; i++) { + if (msg[i].textContent.match(rx)) { + msg[i].classList.add("sjis-mob"); + } + } +} + +function setLocalTime() { + if (weabot.localtime != true) { + return; + } + week = ["dom", "lun", "mar", "mie", "jue", "vie", "sab"]; + var dt = document.getElementsByClassName("date"); + for (var i = 0; i < dt.length; i++) { + dt[i].textContent = localTime(dt[i].dataset.unix); + } +} + +function localTime(timestamp) { + var newdate = new Date(timestamp * 1000); + newdate = + ("0" + newdate.getDate()).slice(-2) + "/" + + ("0" + (newdate.getMonth() + 1)).slice(-2) + + "/" + newdate.getFullYear().toString().slice(-2) + + "(" + week[newdate.getDay()] + ")" + + ("0" + newdate.getHours()).slice(-2) + ":" + + ("0" + newdate.getMinutes()).slice(-2) + ":" + + ("0" + newdate.getSeconds()).slice(-2); + return newdate; +} + +function parsePosts() { + } document.addEventListener("DOMContentLoaded", function() { + board = document.body.dataset.brd; + if (localStorage.hasOwnProperty("weabot")) { weabot = JSON.parse(localStorage.getItem("weabot")); } else { - weabot = { name: null, email: null, password: null }; + weabot = { name: null, + email: null, + password: null, + localtime: false, + qpreview: true, + backlink: true, + filters: false + }; } - - board = document.body.dataset.brd; var head = document.getElementById("main_nav"); if (head) { - var b = head.getElementsByTagName("a"); - for (var i = 0; i < b.length; i++) { - if (b[i].getAttribute("href") == "/" + board + "/") { - b[i].className = "cur_brd"; - break; - } - } + document.getElementById("b-" + board).className = 'cur_brd'; } - if (document.body.clientWidth < 600) { + clientw = document.body.clientWidth; + if (clientw < 800) { if (head) { - var navlink = head.getElementsByTagName("a"); - + var navlink = head.children; + var sel = document.createElement("select"); sel.id = head.id + "_sel"; sel.addEventListener("change", function(e){ - window.location.href = this.value; + window.location.href = e.target.value; }); - - for (var i=1; i<navlink.length; i++) { - var c = document.createElement("option"); + + for (var i=1; i < navlink.length; i++) { + var c = document.createElement("option"); c.text = navlink[i].textContent; - c.value = navlink[i].href; - if (navlink[i].className == "cur_brd") { - c.selected = true; - } + c.value = navlink[i].getAttribute("href"); sel.options.add(c); } - - head.textContent = "" - var home = document.createElement("a"); - home.text = "Bienvenido a Internet"; - home.href = "/home.html"; + sel.value = "/"+board+"/"; + + var home = navlink[0]; + head.textContent = ""; head.appendChild(home); head.appendChild(document.createTextNode(" ★ ")); head.appendChild(sel); - head.className = "mob"; document.body.style.marginTop = "2em"; } - - var sjis = /( \| /|\ |/ | ̄ ̄|| | ||\| | \|)/; - var msg = document.getElementsByClassName("msg"); - for (var i=0; i < msg.length; i++) { - if (msg[i].textContent.match(sjis)) { - msg[i].classList.add("sjis-mob"); - } - } } + if (clientw < 600) { + smallsjis(); + } +}); +window.addEventListener("load", function() { var forms = document.getElementsByTagName("form"); for (var i = 0; i < forms.length; i++) { if (forms[i].id.startsWith("postform")) { - setInputs(forms[i].id); + setInputs(forms[i]); } } - - var styleSelect = document.getElementById("styles"); - if (styleSelect) { - styleSelect.addEventListener("change", function(e) { setTheme(this.value); }); - styleSelect.value = localStorage.getItem(style_cookie); - } - + + checkHidden(); + setLocalTime(); + //parsePosts(); + if (document.getElementById("threads")) { - var srt = document.getElementsByClassName("l_s"); - for (var i = 0; i < srt.length; i++) { - srt[i].addEventListener("click", listSort); - } + listPrepare(); } - checkHidden(); + document.addEventListener("click", function(e) { + var txt = e.target.textContent; + /*if (e.target.className == "num") { + e.preventDefault(); + postClick(txt); + return; + }*/ + if (txt == "del") { + e.preventDefault(); + deletePost(e.target); + return; + } + }, false); + + document.addEventListener("dblclick", function(e) { + if (e.target.closest("h4")) { + e.preventDefault(); + togglePost(e.target.closest("h4")); + window.getSelection().removeAllRanges(); + return; + } + }, false); }); - -document.addEventListener("click", function(e) { - var txt = e.target.textContent; - /*if (e.target.className == "num") { - e.preventDefault(); - postClick(txt); - return; - }*/ - if (txt == "del") { - e.preventDefault(); - deletePost(e.target); - return; - } -}, false); - -document.addEventListener("dblclick", function(e) { - if (e.target.closest("h4")) { - e.preventDefault(); - togglePost(e.target.closest("h4")); - window.getSelection().removeAllRanges(); - return; - } -}, false); |