Add: always sensitive on

This commit is contained in:
Cutls 2019-10-05 03:51:05 +09:00
parent cb6a75de3b
commit 90629aecb4
4 changed files with 17 additions and 1 deletions

View File

@ -291,7 +291,12 @@ function refresh(target, loadskip) {
localStorage.setItem("user-id_" + target, json["id"]); localStorage.setItem("user-id_" + target, json["id"]);
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
localStorage.setItem("follow_" + target, json["following_count"]); localStorage.setItem("follow_" + target, json["following_count"]);
console.log(obj) if(json["source"]["sensitive"]){
localStorage.setItem("nsfw_" + target, "true");
}else{
localStorage.removeItem("nsfw_" + target);
}
obj[target] = ref;
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);
if (!loadskip) { if (!loadskip) {

View File

@ -695,6 +695,11 @@ function refresh(target) {
localStorage.setItem("user_" + target, json["acct"]); localStorage.setItem("user_" + target, json["acct"]);
localStorage.setItem("user-id_" + target, json["id"]); localStorage.setItem("user-id_" + target, json["id"]);
localStorage.setItem("prof_" + target, avatar); localStorage.setItem("prof_" + target, avatar);
if(json["source"]["sensitive"]){
localStorage.setItem("nsfw_" + target, "true");
}else{
localStorage.removeItem("nsfw_" + target);
}
obj[target] = ref; obj[target] = ref;
var json = JSON.stringify(obj); var json = JSON.stringify(obj);
localStorage.setItem("multi", json); localStorage.setItem("multi", json);

View File

@ -151,6 +151,11 @@ function media(b64, type, no) {
$("#textarea").val($("#textarea").val() + " " + json["text_url"]) $("#textarea").val($("#textarea").val() + " " + json["text_url"])
} }
todc(); todc();
if(localStorage.getItem("nsfw_" + acct_id)){
$("#nsfw").addClass("yellow-text");
$("#nsfw").html("visibility");
$("#nsfw").addClass("nsfw-avail");
}
$(".toot-btn-group").prop("disabled", false); $(".toot-btn-group").prop("disabled", false);
$('select').formSelect(); $('select').formSelect();
$("#mec").text(lang.lang_there); $("#mec").text(lang.lang_there);

View File

@ -55,6 +55,7 @@ function show() {
} }
$('#post-box').fadeIn(); $('#post-box').fadeIn();
$('#textarea').characterCounter(); $('#textarea').characterCounter();
mdCheck()
} }
$(function () { $(function () {