Add: show dialogs when muting and blocking

This commit is contained in:
Cutls 2019-08-19 22:55:50 +09:00
parent 68328a9449
commit 4416c56884

View File

@ -147,15 +147,28 @@ function follow(acct_id, remote) {
//ブロック //ブロック
function block(acct_id) { function block(acct_id) {
if ($("#his-data").hasClass("blocking")) {
var flag = "unblock";
var txt = lang.lang_status_unmute
} else {
var flag = "block";
var txt = lang.lang_status_block
}
Swal.fire({
title: txt,
text: "",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: lang.lang_yesno,
cancelButtonText: lang.lang_no
}).then((result) => {
if (result.value) {
if (!acct_id) { if (!acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
var id = $("#his-data").attr("user-id"); var id = $("#his-data").attr("user-id");
if ($("#his-data").hasClass("blocking")) {
var flag = "unblock";
} else {
var flag = "block";
}
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag; var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
@ -177,20 +190,36 @@ function block(acct_id) {
} }
} }
} }
});
}
//ミュート //ミュート
function muteDo(acct_id) { function muteDo(acct_id) {
if ($("#his-data").hasClass("muting")) {
var flag = "unmute";
var flagm = "delete";
var txt = lang.lang_status_unmute
} else {
var flag = "mute";
var flagm = "create";
var txt = lang.lang_status_mute
}
Swal.fire({
title: txt,
text: "",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: lang.lang_yesno,
cancelButtonText: lang.lang_no
}).then((result) => {
if (result.value) {
if (!acct_id) { if (!acct_id) {
var acct_id = $('#his-data').attr("use-acct"); var acct_id = $('#his-data').attr("use-acct");
} }
var id = $("#his-data").attr("user-id"); var id = $("#his-data").attr("user-id");
if ($("#his-data").hasClass("muting")) {
var flag = "unmute";
var flagm = "delete";
} else {
var flag = "mute";
var flagm = "create";
}
var domain = localStorage.getItem("domain_" + acct_id); var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem("acct_" + acct_id + "_at"); var at = localStorage.getItem("acct_" + acct_id + "_at");
if (localStorage.getItem("mode_" + domain) == "misskey") { if (localStorage.getItem("mode_" + domain) == "misskey") {
@ -219,6 +248,9 @@ function muteDo(acct_id) {
} }
} }
} }
});
}
//投稿削除 //投稿削除
function del(id, acct_id) { function del(id, acct_id) {