diff options
author | Choom | 2023-01-20 00:36:43 -0300 |
---|---|---|
committer | Choom | 2023-01-22 07:57:56 -0300 |
commit | 8e519f17d144165b6de31bf3ebabdab5eb13bf0d (patch) | |
tree | 10b3bd7affd037d198fc6ec54af6862cb0ce85b0 /static | |
parent | 649a2e5f4fa0b13a58068772ec72605dba6624d2 (diff) | |
download | weabot-8e519f17d144165b6de31bf3ebabdab5eb13bf0d.tar.gz weabot-8e519f17d144165b6de31bf3ebabdab5eb13bf0d.tar.xz weabot-8e519f17d144165b6de31bf3ebabdab5eb13bf0d.zip |
Config para el usuario
Diffstat (limited to 'static')
-rw-r--r-- | static/css/cyber.css | 4 | ||||
-rw-r--r-- | static/css/dickgirl.css | 2 | ||||
-rw-r--r-- | static/css/easymodo.css | 7 | ||||
-rw-r--r-- | static/css/hotdog.css | 4 | ||||
-rw-r--r-- | static/css/ib.css | 13 | ||||
-rw-r--r-- | static/css/putaba.css | 4 | ||||
-rw-r--r-- | static/css/txt/ayashii.css | 12 | ||||
-rw-r--r-- | static/css/txt/bbs.css | 66 | ||||
-rw-r--r-- | static/css/txt/blue moon.css | 2 | ||||
-rw-r--r-- | static/css/txt/futanari.css | 7 | ||||
-rw-r--r-- | static/css/txt/gamer.css | 15 | ||||
-rw-r--r-- | static/css/txt/headline.css | 5 | ||||
-rw-r--r-- | static/css/txt/mercury.css | 1 | ||||
-rw-r--r-- | static/css/txt/postal.css | 3 | ||||
-rw-r--r-- | static/css/txt/rizzona.css | 10 | ||||
-rw-r--r-- | static/css/txt/ventanas.css | 2 | ||||
-rw-r--r-- | static/css/txt/waves.css | 10 | ||||
-rw-r--r-- | static/example/bbs1.html | 2 | ||||
-rw-r--r-- | static/example/sky.jpg | bin | 0 -> 54058 bytes | |||
-rw-r--r-- | static/example/style.css | 212 | ||||
-rw-r--r-- | static/js/aquiencitas.js | 14 | ||||
-rw-r--r-- | static/js/shobon.js | 84 | ||||
-rw-r--r-- | static/js/userconf.js | 164 | ||||
-rw-r--r-- | static/js/weabot.js | 139 | ||||
-rw-r--r-- | static/js/weabotxt.js | 295 |
25 files changed, 661 insertions, 416 deletions
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); |