Add: show dialogs when muting and blocking
This commit is contained in:
parent
68328a9449
commit
4416c56884
|
@ -147,15 +147,28 @@ function follow(acct_id, remote) {
|
|||
|
||||
//ブロック
|
||||
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) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
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 at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
|
@ -177,20 +190,36 @@ function block(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) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
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 at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
|
@ -219,6 +248,9 @@ function muteDo(acct_id) {
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//投稿削除
|
||||
function del(id, acct_id) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user