mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-08 12:58:44 +00:00
Partially selectable reblogs visibility (fluoride required fix)
This commit is contained in:
parent
a678b620a1
commit
8c41878b6d
5 changed files with 36 additions and 8 deletions
|
@ -9,6 +9,7 @@ var reverseActions = {
|
|||
|
||||
var csrfToken = "";
|
||||
var antiDopamineMode = false;
|
||||
var retweetVisibility = "public"
|
||||
|
||||
function checkCSRFToken() {
|
||||
var tag = document.querySelector("meta[name='csrf_token']");
|
||||
|
@ -22,6 +23,12 @@ function checkAntiDopamineMode() {
|
|||
antiDopamineMode = tag.getAttribute("content") === "true";
|
||||
}
|
||||
|
||||
function checkRetweetVisibility() {
|
||||
var tag = document.querySelector("meta[name='retweet_visibility']");
|
||||
if (tag)
|
||||
retweetVisibility = tag.getAttribute("content");
|
||||
}
|
||||
|
||||
function http(method, url, body, type, success, error) {
|
||||
var req = new XMLHttpRequest();
|
||||
req.onload = function() {
|
||||
|
@ -97,7 +104,7 @@ function handleRetweetForm(id, f) {
|
|||
updateActionForm(id, forms[i], reverseActions[action]);
|
||||
}
|
||||
|
||||
var body = "csrf_token=" + encodeURIComponent(csrfToken);
|
||||
var body = "csrf_token=" + encodeURIComponent(csrfToken) + "&retweet_visibility=" + encodeURIComponent(retweetVisibility);
|
||||
var contentType = "application/x-www-form-urlencoded";
|
||||
http("POST", "/fluoride/" + action + "/" + id,
|
||||
body, contentType, function(res, type) {
|
||||
|
@ -288,6 +295,7 @@ function onPaste(e) {
|
|||
document.addEventListener("DOMContentLoaded", function() {
|
||||
checkCSRFToken();
|
||||
checkAntiDopamineMode();
|
||||
checkRetweetVisibility();
|
||||
|
||||
var statuses = document.querySelectorAll(".status-container");
|
||||
for (var i = 0; i < statuses.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue