From 124279ee2c6e2fbf4ebd751588c8d4bffec6d3e3 Mon Sep 17 00:00:00 2001 From: Señor X Date: Sun, 31 Mar 2019 06:37:08 -0300 Subject: Agregando delegación a # y del en BBS Parte 2 --- static/js/weabotxt.js | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'static/js') diff --git a/static/js/weabotxt.js b/static/js/weabotxt.js index 9cd407c..f4bbe2f 100644 --- a/static/js/weabotxt.js +++ b/static/js/weabotxt.js @@ -18,8 +18,8 @@ function changeDate() { if (board == "world") week = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; for(var d=0;d")+"\n"; sel="\n"+sel; } - insert(">>" + this.textContent + sel); + insert(">>"+num+sel); } function previewPost(e) { @@ -168,7 +166,7 @@ function listSort() { var cont = document.getElementById("content"); var elem = document.getElementsByClassName("row"); var arr = Array.prototype.slice.call(elem); arr.shift(); - if (s=="Normal") { arr.sort(function (a,b) { return (parseInt(a.childNodes[1].innerText) - parseInt(b.childNodes[1].innerText)) }); } + 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]))) }); } @@ -185,7 +183,7 @@ function listDisplay() { var style = document.createElement("style"); style.id = "labels"; style.type = "text/css"; - style.innerText = '#content .row div.date{display:none}#content.grid div.com:before{content:"("}#content.grid .com:after{content:")"}'; + style.textContent = '#content .row div.date{display:none}#content.grid div.com:before{content:"("}#content.grid .com:after{content:")"}'; document.head.appendChild(style); } else if (d=="Lista") { var style = document.getElementById("labels"); @@ -200,7 +198,7 @@ function searchSubjects(e) { var filter = this.value.toLowerCase(); var nodes = document.getElementsByClassName("thread"); for (i=0; i