aboutsummaryrefslogtreecommitdiff
path: root/static/js/aquiencitas.js
diff options
context:
space:
mode:
authorLibravatar junk 2021-03-28 07:51:40 -0300
committerLibravatar junk 2021-03-31 05:27:26 -0300
commitf7baf0c69606d49c6be86d3f27bc88d9d58cd4ba (patch)
treef0d72c1a497f73863078f1970e3ba692ffec860d /static/js/aquiencitas.js
parentaa8a6056f4c3cd8c6663d1714782f972bcb87b8f (diff)
downloadweabot-f7baf0c69606d49c6be86d3f27bc88d9d58cd4ba.tar.gz
weabot-f7baf0c69606d49c6be86d3f27bc88d9d58cd4ba.tar.xz
weabot-f7baf0c69606d49c6be86d3f27bc88d9d58cd4ba.zip
Mejor forma de ocultar posts
Diffstat (limited to 'static/js/aquiencitas.js')
-rw-r--r--static/js/aquiencitas.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/static/js/aquiencitas.js b/static/js/aquiencitas.js
index 4284f0a..93f5323 100644
--- a/static/js/aquiencitas.js
+++ b/static/js/aquiencitas.js
@@ -54,13 +54,13 @@ function getPostDivs(e) {
return divs;
} else {
ele = document.getElementById(
- "reply" + e.getAttribute("href").split("#")[1]
+ "p" + e.getAttribute("href").split("#")[1]
);
return [ele];
}
}
function get_pid(e) {
- return is_bbs ? e.dataset.n : e.id.substr(5);
+ return is_bbs ? e.dataset.n : e.id.substr(1);
}
function fill_links(e) {
var divs = getPostDivs(e);
@@ -144,12 +144,9 @@ function quotePreview() {
if (localStorage.getItem("shobon_on") == "false") {
return;
}
- if (
- localStorage.getItem("shobon_preview") == "false" &&
- localStorage.getItem("shobon_backlink") == "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;
@@ -160,10 +157,10 @@ function quotePreview() {
if (is_bbs) replies = document.getElementsByClassName("msg");
else replies = document.getElementsByTagName("blockquote");
- urls = window.location.pathname.split("/");
- cur_url = urls[0] + "/" + urls[1] + "/" + urls[2] + "/" + urls[3];
+ var urls = window.location.pathname.split("/");
+ cur_url = "/" + ((urls[2]) ? urls[1] + "/" + urls[2] + "/" + urls[3] : urls[1]);
- for (x = 0; x < replies.length; x++) {
+ for (var x = 0; x < replies.length; x++) {
quotes = replies[x].getElementsByTagName("a");
linklist = {};
@@ -171,12 +168,12 @@ function quotePreview() {
q = quotes[i];
if (q.textContent.length < 3 || !q.textContent.startsWith(">>")) continue;
- if (localStorage.getItem("shobon_preview") != "false") {
+ if (showprev != "false") {
q.addEventListener("mouseover", who_are_you_quoting, false);
q.addEventListener("mouseout", remove_quote_preview, false);
}
- if (localStorage.getItem("shobon_backlink") != "false") {
+ if (showlink != "false") {
fill_links(q);
}
}