diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/css/ib.css | 4 | ||||
-rw-r--r-- | static/css/spc/material_normal.css (renamed from static/css/txt/material.css) | 0 | ||||
-rw-r--r-- | static/css/txt/4am.css | 2 | ||||
-rw-r--r-- | static/css/txt/amber.css | 2 | ||||
-rw-r--r-- | static/css/txt/ayashii.css | 3 | ||||
-rw-r--r-- | static/css/txt/baisano.css | 2 | ||||
-rw-r--r-- | static/css/txt/bbs.css | 16 | ||||
-rw-r--r-- | static/css/txt/bios.css | 1 | ||||
-rw-r--r-- | static/css/txt/blue moon.css | 2 | ||||
-rw-r--r-- | static/css/txt/ciber.css | 4 | ||||
-rw-r--r-- | static/css/txt/cuteanarchy.css | 1 | ||||
-rw-r--r-- | static/css/txt/futanari.css | 2 | ||||
-rw-r--r-- | static/css/txt/gamer.css | 5 | ||||
-rw-r--r-- | static/css/txt/headline.css | 4 | ||||
-rw-r--r-- | static/css/txt/postal.css | 2 | ||||
-rw-r--r-- | static/css/txt/ventanas.css | 2 | ||||
-rw-r--r-- | static/js/autorefresh.js | 2 | ||||
-rw-r--r-- | static/js/home.js | 2 | ||||
-rw-r--r-- | static/js/shobon.js | 22 | ||||
-rw-r--r-- | static/js/weabot.js | 2 | ||||
-rw-r--r-- | static/js/weabotxt.js | 67 |
21 files changed, 85 insertions, 62 deletions
diff --git a/static/css/ib.css b/static/css/ib.css index d36f3da..5a2bf4d 100644 --- a/static/css/ib.css +++ b/static/css/ib.css @@ -61,8 +61,8 @@ input[type="text"],input[type="password"],textarea{background:#FFF;border:1px in .postblock{font-size:14px;white-space:nowrap} .pass,.ell,.thumbmsg{display:none} .thread table,#postform input[type="text"],#postform input[type="submit"],#postform textarea,#postform input[type="file"],.rules{max-width:100%;width:100%} - .info,.fs .tt,.omitted{font-size:14px} - .date{font-size:13px} + .fs .tt,.omitted{font-size:14px} + .info{font-size:12px} .reply .info{padding-right:0} .fs,.rules{font-size:12px} .fs span{display:none} diff --git a/static/css/txt/material.css b/static/css/spc/material_normal.css index 9af806f..9af806f 100644 --- a/static/css/txt/material.css +++ b/static/css/spc/material_normal.css diff --git a/static/css/txt/4am.css b/static/css/txt/4am.css index fab8e43..258e852 100644 --- a/static/css/txt/4am.css +++ b/static/css/txt/4am.css @@ -13,7 +13,7 @@ h3,#size{color:#ab4642} h3 span{color:#999} h4{color:#c1c5c2} #main_nav{background:#000;color:#7cafc2} -#main_nav.fix{box-shadow:0 0 3px #000} +.fix #main_nav{box-shadow:0 0 3px #000} .banner{-webkit-filter:grayscale(60%);filter:grayscale(60%)} .outerbox{background:#111213;border:1px solid #4B4E55;color:#777879} #titlebox .threadnav{margin:-6px} diff --git a/static/css/txt/amber.css b/static/css/txt/amber.css index 71b6dc4..4752fe8 100644 --- a/static/css/txt/amber.css +++ b/static/css/txt/amber.css @@ -14,7 +14,7 @@ input,button{font-family:monospace} input,input[type="submit"],input[type="button"],input[type="text"],textarea,button,select{background:#000;border:1px solid #f9690e;color:#f9690e;text-shadow:1px 1px #000} input[type="text"]:focus,textarea:focus,select:focus{background:#3a1903} input[type=submit]:active,input[type=button]:active,button:active{background:#f9690e;border-style:solid;color:#000} -#main_nav{background:#000;box-shadow: 0 0 10px} +#main_nav{background:#000;box-shadow:0 0 10px} .outerbox,.innerbox{border:1px solid #f9690e} #threadlist{border:3px double #f9690e} #threadlist a{border-right:1px solid #f9690e;border-bottom:1px solid #f9690e} diff --git a/static/css/txt/ayashii.css b/static/css/txt/ayashii.css index 42d1837..0e2109d 100644 --- a/static/css/txt/ayashii.css +++ b/static/css/txt/ayashii.css @@ -9,6 +9,7 @@ h4:before{content:">";color:#FFFFFE;display:inline-block;font-size:16px;width: .first h4:before{content:none} input[type=submit],input[type=button],button{border-width:2px;border-style:outset ridge ridge outset;border-color:#FFF #000 #000 #FFF;background:#DDD;color:#000;padding:0 8px} #main_nav,.banner{background:inherit;text-align:left;margin:0;padding-left:2.5%} +.fix #main_nav{background:inherit;text-align:center} #titlebox{margin-bottom:1em;margin-top:5px} .threadnav a{margin-left:4px} .innerbox{margin:0;padding:0} @@ -43,7 +44,7 @@ form .msg{border:1px dotted #FFF} #content.grid,#content.grid .row{border-style:groove;border-color:gray} .threads #footer{text-align:center} @media(max-width:720px){ - body.mainpage,body.threads{margin:8px} + body.mainpage,body.threads{margin-left:8px;margin-right:8px} h2 span{margin-left:0;float:none} h4:before{font-size:12px;width:20px} div.msg,.first .msg{margin:.5em 0 .5em 20px} diff --git a/static/css/txt/baisano.css b/static/css/txt/baisano.css index dc4a79d..bd8ea02 100644 --- a/static/css/txt/baisano.css +++ b/static/css/txt/baisano.css @@ -11,7 +11,7 @@ h3 span{color:#000} h4.hidden{background:#CCC} .mainpage h4.hidden:hover{background:#DCC} #main_nav{background:#FFF} -#main_nav.fix{box-shadow:0 0 3px #000} +.fix #main_nav{box-shadow:0 0 3px #000} .outerbox{background:#CFC;border:1px outset #FFF} .innerbox{border:1px inset #FFF} #threadlist{background:#BEB;border:1px inset #FFF} diff --git a/static/css/txt/bbs.css b/static/css/txt/bbs.css index 86661bb..f73748d 100644 --- a/static/css/txt/bbs.css +++ b/static/css/txt/bbs.css @@ -2,6 +2,7 @@ body,textarea{font-family:arial,helvetica,sans-serif;font-size:16px} body.mainpage,body.threads{margin:0} body.threadpage{margin:8px} +body.fix{margin-top:2em} h1,h5{font-size:20px;margin:0} h2{font-size:16px;margin:0 0 7px} h2 span{margin-right:2px} @@ -19,11 +20,10 @@ input[type=submit]:active,input[type=button]:active,button:active{border-style:i code{font-size:14px} pre{line-height:125%;margin:0;white-space:pre-wrap} .cur_brd,.locked,.sel{font-weight:bold} -#main_nav{font-size:14px;padding:4px 0;text-align:center;width:100%;z-index:9} +#main_nav{font-size:14px;padding:4px 0;text-align:center;width:100%} +.fix #main_nav{position:fixed;top:0;left:0;right:0;margin:0;padding:2px 0;z-index:9} +#main_nav select{font-size:90%;padding:0} #main_nav a,#thread_nav a,#threadlinks a,.threadlinks a,label{display:inline-block} -#main_nav.fix{position:fixed;top:0} -#main_nav.mob{padding:2px} -#main_nav.mob select{font-size:90%} .outerbox,.mainpage .thread,#footer,#content{margin:0 2.5% 1em} .innerbox{padding:7px;margin:7px} .threadnav{float:right;font-family:mona,monapo,ipamonapgothic,monapo,'ms pgothic',yozfontaa97} @@ -33,7 +33,6 @@ pre{line-height:125%;margin:0;white-space:pre-wrap} #threadlinks{margin-bottom:.5em;text-align:center} #threadlist{font-size:14px;line-height:1;max-height:15em;overflow-y:scroll} #threadlist a{text-decoration:none} -#thread_nav{padding-left:6px} .mainpage .postform,.formpad{padding-left:40px} .reply{clear:both;line-height:1.25em;margin-bottom:1em;overflow:hidden} .num{color:inherit!important;font-weight:bold;text-decoration:none} @@ -83,19 +82,18 @@ form .msg{margin:0;padding:8px 2px;text-align:left} .outerbox,.mainpage .thread,#footer,#content{margin:1em 0} h1,h2 a,h5{font-size:18px} h4,h2 span,#rules{font-size:12px} - .pblock,#footer,.end{font-size:14px} #threadlist{overflow-x:auto;white-space:nowrap} #size,.postform br{display:none} div.reply{margin-bottom:.5em} .num{margin:-10px;padding:10px;position:relative} .del{visibility:visible} div.msg{margin:.5em 0 0} - .mainpage .postform,.formpad,#thread_nav{padding-left:0} + .mainpage .postform,.formpad{padding-left:0} .postform>span{display:table;width:100%} - .postform span>*{display:table-cell;font-size:14px;margin-bottom:2px;white-space:nowrap} + .postform span>*{display:table-cell;margin-bottom:2px;white-space:nowrap} .postform input,textarea{width:100%} .postform textarea{height:100px} - form,#thread_nav,#footer,.end,.locked{text-align:center} + form,#thread_nav,#footer,.end,.locked{font-size:14px;text-align:center} #footer a{display:block} #content.list .row div{padding:0 2px} }
\ No newline at end of file diff --git a/static/css/txt/bios.css b/static/css/txt/bios.css index 10a6a32..afbc9cb 100644 --- a/static/css/txt/bios.css +++ b/static/css/txt/bios.css @@ -33,6 +33,7 @@ h3 span{background:#00A;color:#FFF;padding:2px} #size{margin-left:.5em} .yt{border:1px solid #ff0} .yt:active{background:#f00;border:1px solid #f00;color:#FFF} +.msg hr{display:block} #q-p{background:#00A;border:1px solid #FFF} #q-p .reply{border:0;padding:0} .lastposts{border-color:#FFF;border-style:double;border-width:0 4px;color:#00A;padding:.5em} diff --git a/static/css/txt/blue moon.css b/static/css/txt/blue moon.css index a463249..8222872 100644 --- a/static/css/txt/blue moon.css +++ b/static/css/txt/blue moon.css @@ -13,7 +13,7 @@ input[type=text],textarea,select{background:#EEE;border:1px inset #444} input[type=submit],input[type=button],button{background:#000;color:#FFF;border:1px outset #444} input[type=submit]:active,input[type=button]:active,button:active{color:#DDD} #main_nav{background:#FFF;color:#6B7B8D} -#main_nav.fix{box-shadow:0 0 3px #000} +.fix #main_nav{box-shadow:0 0 3px #000} #titlebox .innerbox:first-child{margin-bottom:5px} .outerbox{background:#49525D;padding:5px} .innerbox{margin:0;padding:10px} diff --git a/static/css/txt/ciber.css b/static/css/txt/ciber.css index e09d223..629275f 100644 --- a/static/css/txt/ciber.css +++ b/static/css/txt/ciber.css @@ -20,8 +20,8 @@ input:active,input:focus,textarea:focus,button:active,button:active,select:focus .threadpage input[type=submit]:active,.threadpage input[type=button]:active,.thread input[type=submit]:active,.thread input[type=button]:active{border-color:#d21cea;color:#d21cea} #main_nav{background:#000;box-shadow:0 0 10px #68F855} .outerbox{background:#111;color:#5FE44E;border:3px outset #0F0;background:#0C0} -.outerbox a,#main_nav a,#footer a{color:#68F855} -.outerbox a:active,#main_nav a:active,#footer a:active{color:#ef6177} +.outerbox a,#main_nav a a,#footer a{color:#68F855} +.outerbox a:active,#main_nav a:active a:active,#footer a:active{color:#ef6177} #threadlist{background:rgba(26,26,26,.5);border:3px solid #0C0} #threadlist a{border-right:1px solid #0C0;border-bottom:1px solid #0C0} .innerbox{border:3px inset #0F0} diff --git a/static/css/txt/cuteanarchy.css b/static/css/txt/cuteanarchy.css index d1acbab..74379b5 100644 --- a/static/css/txt/cuteanarchy.css +++ b/static/css/txt/cuteanarchy.css @@ -95,7 +95,6 @@ h3 span { #main_nav { background: #000; color: #7cafc2; - z-index: 9; } .banner { diff --git a/static/css/txt/futanari.css b/static/css/txt/futanari.css index ce40571..42c25af 100644 --- a/static/css/txt/futanari.css +++ b/static/css/txt/futanari.css @@ -12,7 +12,7 @@ input,input[type=submit],input[type=button],input[type="text"],textarea,button,s input[type=submit],input[type=button],button{background:#aaf;color:#2c5700} input[type="submit"]:active,input[type="button"]:active,button:active{background:#88c} #main_nav{background:#1d7548} -#main_nav.fix{box-shadow:0 0 3px #000} +.fix #main_nav{box-shadow:0 0 3px #000} #titlebox{margin-bottom:0} .outerbox{background:#3b6b94} .innerbox{margin:0;padding:10px} diff --git a/static/css/txt/gamer.css b/static/css/txt/gamer.css index 51dcdf5..2e7feab 100644 --- a/static/css/txt/gamer.css +++ b/static/css/txt/gamer.css @@ -8,9 +8,9 @@ h2 a{color:#FFF;font-size:18px} h3 span{font-weight:bold;margin-left:4px} hr{display:none} #main_nav{background:url('../img/g_b2.gif') bottom repeat-x} -#main_nav a{color:#FFF;text-decoration:none}#main_nav a:active{color:#E0E0FF} +#main_nav a a{color:#FFF;text-decoration:none}#main_nav a:active a:active{color:#E0E0FF} #thread_nav{margin:6px 0} -.cur_brd,#main_nav.mob a{background:url('../img/g_b3.gif') bottom repeat-x;margin-bottom:-4px;padding-bottom:4px} +.cur_brd,.fix #main_nav a a{background:url('../img/g_b3.gif') bottom repeat-x;margin-bottom:-4px;padding-bottom:4px} #thread_nav a,.lastposts a,#n2{color:#66B}#thread_nav a:active,.lastposts a:active,#n2:active{color:#AFA} .links,#threadlinks,.threadlinks{background:url('../img/g_bg3.png') top center;color:#FF0} h4 a,.threadnav a,.links a,#footer a{text-decoration:none} @@ -29,6 +29,7 @@ h4 .date,.del a,.abbrev{color:#AAA} .q{color:#666} .yt{background:#000;border:1px solid #111} .deleted{color:#AFAFAF;margin-bottom:24px} +.msg hr{display:block} .mainpage .postform{border-top:1px solid #111;padding:1em 0 0} .formpad{padding-left:0} form .msg{border:1px dotted #111} diff --git a/static/css/txt/headline.css b/static/css/txt/headline.css index f9e50a2..3c5183c 100644 --- a/static/css/txt/headline.css +++ b/static/css/txt/headline.css @@ -1,4 +1,4 @@ -body,#main_nav{background:#FFF} +body{background:#FFF} body,textarea{color:#000} a,#n2,h3 span{color:#D60} a:active .name,h2 a:active,h4 a:active,a:active,#n2:active{color:#FA4} @@ -11,7 +11,7 @@ hr{display:none} input,input[type="submit"],input[type="button"],input[type="text"],textarea,button,select{border:1px solid #000} input[type="submit"],input[type="button"],button{background:#DDD} input[type="submit"]:active,input[type="button"]:active,button:active{background:#CCC;border-style:solid} -#main_nav.fix{border-bottom:2px solid #BBB} +.fix #main_nav{background:#FFF;border-bottom:2px solid #BBB} .outerbox,#titlebox .innerbox:first-child,.postform,.lastposts,#content{background:#EEE;border-bottom:2px solid #BBB} .innerbox{margin:0;padding:10px} .thread .innerbox{padding:0} diff --git a/static/css/txt/postal.css b/static/css/txt/postal.css index ad96c3e..15996c7 100644 --- a/static/css/txt/postal.css +++ b/static/css/txt/postal.css @@ -15,7 +15,7 @@ h3{margin-top:0} h3 span{color:dimgrey} h4{background:#F0E7CE;color:#686868;padding-left:3px} #main_nav,.outerbox{background:#FFF} -#main_nav.fix{box-shadow:0 0 3px #000} +.fix #main_nav{box-shadow:0 0 3px #000} .outerbox{border:1px solid #FFF} #threadlist{background:#EFEFEF;border:1px inset #EFEFEF} #threadlist a{border-right:1px outset #EFEFEF;border-bottom:1px outset #EFEFEF} diff --git a/static/css/txt/ventanas.css b/static/css/txt/ventanas.css index 2593795..7d80520 100644 --- a/static/css/txt/ventanas.css +++ b/static/css/txt/ventanas.css @@ -16,7 +16,7 @@ hr,h4,.deleted{border-top:2px groove white} .threadnav{line-height:1;margin:-11px} #main_nav a,.threadnav a{background:#C0C0C0;border-width:2px;border-color:#FFF #000 #000 #FFF;border-style:ridge;color:#000;display:inline-block;margin:0 -1px;padding:2px;text-decoration:none;outline-offset:-4px} .threadnav a{margin:2px;padding:0} -#main_nav a:first-child{font-weight:bold} +#main_nav a:first-child a:first-child{font-weight:bold} #main_nav .cur_brd{background:#BBB url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAHUlEQVQImQESAO3/AMG/wv////7/AP///v++vr7/gXcOcY36q6gAAAAASUVORK5CYII=');font-weight:bold} #main_nav .cur_brd,#main_nav a:active,.threadnav a:active,input[type=submit]:active,input[type=button]:active,button:active{border-color:#000 #FFF #FFF #000;border-style:groove} .outerbox,.mainpage .thread,#q-p{border-width:2px;border-color:#FFF #000 #000 #FFF;border-style:groove} diff --git a/static/js/autorefresh.js b/static/js/autorefresh.js index 31cecbf..3f9dbd4 100644 --- a/static/js/autorefresh.js +++ b/static/js/autorefresh.js @@ -120,7 +120,7 @@ function counter() { } function detectService() { - if (document.body.className === "threadpage") { + if (document.body.classList.contains("threadpage")) { if (!document.getElementById("n")) return; thread_title = document.title; thread_length = parseInt(document.getElementsByClassName("thread")[0].dataset.length); diff --git a/static/js/home.js b/static/js/home.js index 0c921ec..6c9e23a 100644 --- a/static/js/home.js +++ b/static/js/home.js @@ -154,6 +154,8 @@ http_request.onreadystatechange = function() { function parse() { localStorage.setItem("home", JSON.stringify(opcs)); } document.addEventListener("DOMContentLoaded", function() { + window.parent.document.title = document.getElementsByTagName("title")[0].textContent; + if (localStorage.hasOwnProperty("home")) opcs=JSON.parse(localStorage.getItem("home")); else { opcs={"style":"IB","auto":false,"sound":false,"last":0}; parse(); } set_stylesheet(opcs.style); diff --git a/static/js/shobon.js b/static/js/shobon.js index 8233088..fdc0b58 100644 --- a/static/js/shobon.js +++ b/static/js/shobon.js @@ -6,8 +6,8 @@ var hide_id = new Set(); var shobon_ver = "v0.4+"; function shobon() { boardName = document.body.dataset.brd; - var where = document.body.className; - var inThread = where == "threadpage"; + var where = document.body.classList; + var inThread = where.contains("threadpage"); if(!inThread) { /* Create settings link */ @@ -305,7 +305,7 @@ function shobonSettings(e) { p.appendChild(createCheckbox("shobon_usefilters", "Activar filtros", false)); /*var a = document.createElement("a"); a.href = "#"; - a.innerText = "[Editar filtros]"; + a.textContent = "[Editar filtros]"; a.addEventListener("click", function() { var x = document.getElementById("filters"); x.hidden = !x.hidden; @@ -372,15 +372,15 @@ function shobonSettings(e) { function replaceCountryName(reply) { var country = JSON.parse('{"AF":"Afghanistan","AX":"A£land Islands","AL":"Albania","DZ":"Algeria","AS":"American Samoa","AD":"Andorra","AO":"Angola","AI":"Anguilla","AQ":"Antarctica","AG":"Antigua and Barbuda","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahamas","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","BY":"Belarus","BE":"Belgium","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BO":"Bolivia (Plurinational State of)","BQ":"Bonaire, Sint Eustatius and Saba","BA":"Bosnia and Herzegovina","BW":"Botswana","BV":"Bouvet Island","BR":"Brazil","IO":"British Indian Ocean Territory","BN":"Brunei Darussalam","BG":"Bulgaria","BF":"Burkina Faso","BI":"Burundi","KH":"Cambodia","CM":"Cameroon","CA":"Canada","CV":"Cabo Verde","KY":"Cayman Islands","CF":"Central African Republic","TD":"Chad","CL":"Chile","CN":"China","CX":"Christmas Island","CC":"Cocos (Keeling) Islands","CO":"Colombia","KM":"Comoros","CG":"Congo","CD":"Congo (Democratic Republic of the)","CK":"Cook Islands","CR":"Costa Rica","CI":"CAte d\'Ivoire","HR":"Croatia","CU":"Cuba","CW":"CuraAXao","CY":"Cyprus","CZ":"Czech Republic","DK":"Denmark","DJ":"Djibouti","DM":"Dominica","DO":"Dominican Republic","EC":"Ecuador","EG":"Egypt","SV":"El Salvador","GQ":"Equatorial Guinea","ER":"Eritrea","EE":"Estonia","ET":"Ethiopia","FK":"Falkland Islands (Malvinas)","FO":"Faroe Islands","FJ":"Fiji","FI":"Finland","FR":"France","GF":"French Guiana","PF":"French Polynesia","TF":"French Southern Territories","GA":"Gabon","GM":"Gambia","GE":"Georgia","DE":"Germany","GH":"Ghana","GI":"Gibraltar","GR":"Greece","GL":"Greenland","GD":"Grenada","GP":"Guadeloupe","GU":"Guam","GT":"Guatemala","GG":"Guernsey","GN":"Guinea","GW":"Guinea-Bissau","GY":"Guyana","HT":"Haiti","HM":"Heard Island and McDonald Islands","VA":"Holy See","HN":"Honduras","HK":"Hong Kong","HU":"Hungary","IS":"Iceland","IN":"India","ID":"Indonesia","IR":"Iran (Islamic Republic of)","IQ":"Iraq","IE":"Ireland","IM":"Isle of Man","IL":"Israel","IT":"Italy","JM":"Jamaica","JP":"Japan","JE":"Jersey","JO":"Jordan","KZ":"Kazakhstan","KE":"Kenya","KI":"Kiribati","KP":"Korea (Democratic People\'s Republic of)","KR":"Korea (Republic of)","KW":"Kuwait","KG":"Kyrgyzstan","LA":"Lao People\'s Democratic Republic","LV":"Latvia","LB":"Lebanon","LS":"Lesotho","LR":"Liberia","LY":"Libya","LI":"Liechtenstein","LT":"Lithuania","LU":"Luxembourg","MO":"Macao","MK":"Macedonia (the former Yugoslav Republic of)","MG":"Madagascar","MW":"Malawi","MY":"Malaysia","MV":"Maldives","ML":"Mali","MT":"Malta","MH":"Marshall Islands","MQ":"Martinique","MR":"Mauritania","MU":"Mauritius","YT":"Mayotte","MX":"Mexico","FM":"Micronesia (Federated States of)","MD":"Moldova (Republic of)","MC":"Monaco","MN":"Mongolia","ME":"Montenegro","MS":"Montserrat","MA":"Morocco","MZ":"Mozambique","MM":"Myanmar","NA":"Namibia","NR":"Nauru","NP":"Nepal","NL":"Netherlands","NC":"New Caledonia","NZ":"New Zealand","NI":"Nicaragua","NE":"Niger","NG":"Nigeria","NU":"Niue","NF":"Norfolk Island","MP":"Northern Mariana Islands","NO":"Norway","OM":"Oman","PK":"Pakistan","PW":"Palau","PS":"Palestine, State of","PA":"Panama","PG":"Papua New Guinea","PY":"Paraguay","PE":"Peru","PH":"Philippines","PN":"Pitcairn","PL":"Poland","PT":"Portugal","PR":"Puerto Rico","QA":"Qatar","RE":"RAcunion","RO":"Romania","RU":"Russian Federation","RW":"Rwanda","BL":"Saint BarthAclemy","SH":"Saint Helena, Ascension and Tristan da Cunha","KN":"Saint Kitts and Nevis","LC":"Saint Lucia","MF":"Saint Martin (French part)","PM":"Saint Pierre and Miquelon","VC":"Saint Vincent and the Grenadines","WS":"Samoa","SM":"San Marino","ST":"Sao Tome and Principe","SA":"Saudi Arabia","SN":"Senegal","RS":"Serbia","SC":"Seychelles","SL":"Sierra Leone","SG":"Singapore","SX":"Sint Maarten (Dutch part)","SK":"Slovakia","SI":"Slovenia","SB":"Solomon Islands","SO":"Somalia","ZA":"South Africa","GS":"South Georgia and the South Sandwich Islands","SS":"South Sudan","ES":"Spain","LK":"Sri Lanka","SD":"Sudan","SR":"Suriname","SJ":"Svalbard and Jan Mayen","SZ":"Swaziland","SE":"Sweden","CH":"Switzerland","SY":"Syrian Arab Republic","TW":"Taiwan, Province of China","TJ":"Tajikistan","TZ":"Tanzania, United Republic of","TH":"Thailand","TL":"Timor-Leste","TG":"Togo","TK":"Tokelau","TO":"Tonga","TT":"Trinidad and Tobago","TN":"Tunisia","TR":"Turkey","TM":"Turkmenistan","TC":"Turks and Caicos Islands","TV":"Tuvalu","UG":"Uganda","UA":"Ukraine","AE":"United Arab Emirates","GB":"United Kingdom of Great Britain and Northern Ireland","US":"United States of America","UM":"United States Minor Outlying Islands","UY":"Uruguay","UZ":"Uzbekistan","VU":"Vanuatu","VE":"Venezuela (Bolivarian Republic of)","VN":"Viet Nam","VG":"Virgin Islands (British)","VI":"Virgin Islands (U.S.)","WF":"Wallis and Futuna","EH":"Western Sahara","YE":"Yemen","ZM":"Zambia","ZW":"Zimbabwe"}'); var countryEM = reply.getElementsByTagName("em")[0]; - var newCountryStr = country[countryEM.innerText.substr(1, 2)]; - countryEM.innerText = "(" + newCountryStr + ")"; + var newCountryStr = country[countryEM.textContent.substr(1, 2)]; + countryEM.textContent = "[" + newCountryStr + "]"; } function checkBlackList(reply) { var i; // Check words - var low = reply.children[1].innerText.toLowerCase(); + var low = reply.children[1].textContent.toLowerCase(); hide_word.forEach(v => { console.log(v); if (low.includes(v.toLowerCase())) { @@ -413,9 +413,9 @@ function checkBlackList(reply) { var currentSel = null; function paintIds(reply) { var dateId = reply.getElementsByClassName("date")[0]; - if (dateId.innerText.includes("ID:")) { - var postDate = dateId.innerText.split("ID:")[0]; - var userId = dateId.innerText.split("ID:")[1]; + if (dateId.textContent.includes("ID:")) { + var postDate = dateId.textContent.split("ID:")[0]; + var userId = dateId.textContent.split("ID:")[1]; var idColor = toHex(userId).substring(0, 6); var reverseColor = invertColor(idColor); var lastChar = userId.substring(userId.length-1, userId.length); @@ -425,7 +425,7 @@ function paintIds(reply) { } function markId(e) { - var uid = this.innerText.slice(0,-1).replace(":","_"); + var uid = this.textContent.slice(0,-1).replace(":","_"); var sel = document.getElementsByClassName("sel"); var len = sel.length; for (i=0; i<len; i++) { @@ -495,7 +495,7 @@ function padZero(str, len) { function fixedNav() { var bar = document.getElementById("main_nav"); - if(bar){ bar.className+=" fix"; document.body.style.marginTop = "2em"; } + if(bar) document.body.className+=" fix"; } document.addEventListener('DOMContentLoaded', shobon, false);
\ No newline at end of file diff --git a/static/js/weabot.js b/static/js/weabot.js index 428375a..c379ffc 100644 --- a/static/js/weabot.js +++ b/static/js/weabot.js @@ -368,7 +368,7 @@ document.addEventListener("DOMContentLoaded", function(e) { var head=document.getElementById("main_nav"); var b=head.getElementsByTagName("a"); var s=document.createElement("select"); - for(var i=0;i<b.length;i++) { + for(var i=1;i<b.length;i++) { var o = document.createElement("option"); o.value = b[i].href; o.textContent = b[i].textContent; diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index 13911da..1301387 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -11,6 +11,17 @@ function set_stylesheet(styletitle) { localStorage.setItem(style_cookie,styletitle); } +function timeMob(timestamp) { + var time = Math.round(Date.now()/1000); + var el = time - timestamp; + if (el<60) return el + "s"; + else if (el<3600) return Math.round(el/60) + "m"; + else if (el<86400) return Math.round(el/3600) + "h"; + else if (el<2628000) return Math.round(el/86400) + "d"; + else if (el<31536000) return Math.round(el/2628000) + "me"; + else return Math.round(el/31557600) + "a"; +} + /* 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*/) { @@ -203,29 +214,40 @@ document.addEventListener("DOMContentLoaded", function() { else weabot = {"name":null,"email":null,"password":null}; board = document.body.dataset.brd; - var main = document.getElementById("main_nav"); - if (main) { - var b = main.getElementsByTagName("a"); + 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; } } } + var dt = document.getElementsByClassName("date"); if (screen.width<720) { - var head=document.getElementById("main_nav"); - var b=head.getElementsByTagName("a"); - var s=document.createElement("select"); - for(var i=1;i<b.length;i++) { - var o = document.createElement("option"); - o.value = b[i].href; - o.textContent = b[i].textContent; - if(b[i].className=="cur_brd") o.defaultSelected = true; - s.appendChild(o); + if(head) { + var b=head.getElementsByTagName("a"); + var s=document.createElement("select"); + for(var i=1;i<b.length;i++) { + var o = document.createElement("option"); + o.value = b[i].href; + o.textContent = b[i].textContent; + if(b[i].className=="cur_brd") o.defaultSelected = true; + s.appendChild(o); + } + s.addEventListener("change", function(e){ window.location.href=this.value; }); + head.innerHTML = '<a href="/" target="_top">Bienvenido a Internet</a> | '; + head.appendChild(s); + head.removeAttribute("style"); + document.body.className += " fix"; + var head2 = document.getElementById("thread_nav"); + if (head2) head2.removeChild(head2.childNodes[1]); + } + + for(var i=0;i<dt.length;i++) { + t = dt[i].textContent; + if(t.includes("ID:")) var id=t.split(" ")[1]; else id=""; + dt[i].textContent="Hace "+timeMob(dt[i].dataset.unix)+" "+id; } - s.addEventListener("change", function(e){ window.location.href=this.value; }); - head.className = "mob fix"; - head.innerHTML = '<a href="/" target="_top">Bienvenido a Internet</a> | '; - head.appendChild(s); } var forms = document.getElementsByTagName("form"); @@ -237,7 +259,7 @@ document.addEventListener("DOMContentLoaded", function() { styleSelect.value = localStorage.getItem(style_cookie); } - if (document.body.className == "threads") { + if (document.body.classList.contains("threads")) { var srt = document.getElementsByClassName("l_s"); for(var i=0;i<srt.length;i++){ srt[i].addEventListener("click",function(e){ e.preventDefault(); opcs.sort=this.textContent; listSort(); }); } var dsp = document.getElementsByClassName("l_d"); @@ -250,13 +272,12 @@ document.addEventListener("DOMContentLoaded", function() { if(localStorage.hasOwnProperty("hiddenposts")) hiddenposts = localStorage.getItem("hiddenposts").split("!"); - var pps = document.getElementsByClassName("date"); - for(var i=0;i<pps.length;i++) { - if(hiddenposts.includes(board+pps[i].dataset.unix)) { - console.log(pps[i].dataset.unix); - hidepost(pps[i].parentElement.parentElement); + for(var i=0;i<dt.length;i++) { + if(hiddenposts.includes(board+dt[i].dataset.unix)) { + console.log(dt[i].dataset.unix); + hidepost(dt[i].parentElement.parentElement); } - pps[i].parentElement.addEventListener("dblclick", togglepost); + dt[i].parentElement.addEventListener("dblclick", togglepost); } }); document.addEventListener("click", function(e) { |