follow request

This commit is contained in:
cutls 2020-06-12 22:13:06 +09:00
parent f9f2aeab23
commit ad7b3cf485
4 changed files with 27 additions and 2 deletions

View File

@ -160,8 +160,14 @@ function bkm(id, acct_id, tlid) {
//フォロー
async function follow(acct_id, resolve) {
if($('#his-data').hasClass('locked')) {
locked = true
} else {
locked = false
}
if (!acct_id && acct_id != 'selector') {
var acct_id = $('#his-data').attr('use-acct')
} else if (acct_id == 'selector') {
var acct_id = $('#user-acct-sel').val()
}
@ -172,6 +178,7 @@ async function follow(acct_id, resolve) {
var flag = 'follow'
var flagm = 'create'
}
var id = $('#his-data').attr('user-id')
if (resolve == 'selector') {
var fullacct = $('#his-acct').attr('fullname')
@ -205,11 +212,15 @@ async function follow(acct_id, resolve) {
$('#his-follow-btn-text').text(lang.lang_status_follow)
} else {
$('#his-data').addClass('following')
if(locked) {
$('#his-follow-btn-text').text(lang.lang_status_requesting)
} else {
$('#his-follow-btn-text').text(lang.lang_status_unfollow)
}
}
}
}
}
async function acctResolve(acct_id, user) {
console.log('Get user data of ' + user)
var domain = localStorage.getItem('domain_' + acct_id)

View File

@ -239,6 +239,11 @@ function udg(user, acct_id) {
$(".only-his-data").show();
}
todc();
if(json.locked) {
$('#his-data').addClass('locked')
} else {
$('#his-data').removeClass('locked')
}
//外部データ取得(死かもしれないので)
udAdd(acct_id, user, json.url);
});
@ -412,9 +417,14 @@ function relations(user, acct_id) {
})
.then(function(json) {
var json = json[0];
if(json.requested) {
//フォロリク中
$('#his-data').addClass('following')
$("#his-follow-btn-text").text(lang.lang_status_requesting)
}
if (json.following) {
//自分がフォローしている
$("#his-data").addClass("following");
$("#his-data").addClass("following")
$("#his-follow-btn-text").text(lang.lang_status_unfollow);
hisList(user, acct_id);
} else {
@ -538,6 +548,8 @@ function reset() {
$("#his-float-blocked").hide();
$("#his-main-acct").show();
$("#his-proof-prof").html("");
$('#his-data').removeClass('locked')
$('#his-data').removeClass('requesting')
}
$("#my-data-nav .anc-link").on("click", function() {
var target = $(this).attr("go");

View File

@ -166,6 +166,7 @@
"lang_showontl_domain": "Domain ",
"lang_showontl_listwarn": "Follow to add this user to lists.",
"lang_showontl_verified": "This website is verified by owner at ",
"lang_status_requesting": "Requesting",
"lang_parse_mentioned": " replied to you",
"lang_parse_faved": " favourited your toot",
"lang_parse_bted": " boosted your toot",

View File

@ -167,6 +167,7 @@
"lang_showontl_domain": "ドメイン",
"lang_showontl_listwarn": "リストに追加するためにはフォローが必要です。",
"lang_showontl_verified": "このユーザーの所持するWebサイトであると証明されています。",
"lang_status_requesting": "フォローをリクエストしています",
"lang_parse_mentioned": "が返信しました",
"lang_parse_faved": "がお気に入り登録しました",
"lang_parse_bted": "がブーストしました",