Fix fluoride

This commit is contained in:
r 2020-02-01 15:06:06 +00:00
parent 6e89e46326
commit a6d65b297a
1 changed files with 26 additions and 23 deletions

View File

@ -45,9 +45,9 @@ function handleLikeForm(id, f) {
var action = f.dataset.action; var action = f.dataset.action;
var forms = document.querySelectorAll(".status-"+id+" .status-like"); var forms = document.querySelectorAll(".status-"+id+" .status-like");
forms.forEach(function(f) { for (var i = 0; i < forms.length; i++) {
updateActionForm(id, f, reverseActions[action]); updateActionForm(id, forms[i], reverseActions[action]);
}); }
var body = "csrf_token=" + encodeURIComponent(getCSRFToken()); var body = "csrf_token=" + encodeURIComponent(getCSRFToken());
var contentType = "application/x-www-form-urlencoded"; var contentType = "application/x-www-form-urlencoded";
@ -58,17 +58,17 @@ function handleLikeForm(id, f) {
count = ""; count = "";
} }
var counts = document.querySelectorAll(".status-"+id+" .status-like-count"); var counts = document.querySelectorAll(".status-"+id+" .status-like-count");
counts.forEach(function(c) { for (var i = 0; i < counts.length; i++) {
if (count > 0) { if (count > 0) {
c.innerHTML = "(" + count + ")"; counts[i].innerHTML = "(" + count + ")";
} else { } else {
c.innerHTML = ""; counts[i].innerHTML = "";
} }
}); }
}, function(err) { }, function(err) {
forms.forEach(function(f) { for (var i = 0; i < forms.length; i++) {
updateActionForm(id, f, action); updateActionForm(id, forms[i], action);
}); }
}); });
} }
} }
@ -79,9 +79,9 @@ function handleRetweetForm(id, f) {
var action = f.dataset.action; var action = f.dataset.action;
var forms = document.querySelectorAll(".status-"+id+" .status-retweet"); var forms = document.querySelectorAll(".status-"+id+" .status-retweet");
forms.forEach(function(f) { for (var i = 0; i < forms.length; i++) {
updateActionForm(id, f, reverseActions[action]); updateActionForm(id, forms[i], reverseActions[action]);
}); }
var body = "csrf_token=" + encodeURIComponent(getCSRFToken()); var body = "csrf_token=" + encodeURIComponent(getCSRFToken());
var contentType = "application/x-www-form-urlencoded"; var contentType = "application/x-www-form-urlencoded";
@ -92,17 +92,17 @@ function handleRetweetForm(id, f) {
count = ""; count = "";
} }
var counts = document.querySelectorAll(".status-"+id+" .status-retweet-count"); var counts = document.querySelectorAll(".status-"+id+" .status-retweet-count");
counts.forEach(function(c) { for (var i = 0; i < counts.length; i++) {
if (count > 0) { if (count > 0) {
c.innerHTML = "(" + count + ")"; counts[i].innerHTML = "(" + count + ")";
} else { } else {
c.innerHTML = ""; counts[i].innerHTML = "";
} }
}); }
}, function(err) { }, function(err) {
forms.forEach(function(f) { for (var i = 0; i < forms.length; i++) {
updateActionForm(id, f, action); updateActionForm(id, forms[i], action);
}); }
}); });
} }
} }
@ -178,7 +178,8 @@ function handleReplyLink(div) {
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
var statuses = document.querySelectorAll(".status-container"); var statuses = document.querySelectorAll(".status-container");
statuses.forEach(function(s) { for (var i = 0; i < statuses.length; i++) {
var s = statuses[i]
var id = s.dataset.id; var id = s.dataset.id;
var likeForm = s.querySelector(".status-like"); var likeForm = s.querySelector(".status-like");
@ -191,8 +192,10 @@ document.addEventListener("DOMContentLoaded", function() {
handleReplyToLink(replyToLink); handleReplyToLink(replyToLink);
var replyLinks = s.querySelectorAll(".status-reply"); var replyLinks = s.querySelectorAll(".status-reply");
replyLinks.forEach(handleReplyLink); for (var j = 0; j < replyLinks.length; j++) {
}); handleReplyLink(replyLinks[j]);
}
}
}); });
// @license-end // @license-end