Add: boost with visibility

This commit is contained in:
Cutls 2019-10-05 02:23:47 +09:00
parent 8f76c9b09d
commit 52c65afce6
6 changed files with 48 additions and 27 deletions

View File

@ -50,7 +50,7 @@ function fav(id, acct_id, remote) {
}
//ブースト
function rt(id, acct_id, remote) {
function rt(id, acct_id, remote, vis) {
if ($("#pub_" + id).hasClass("rted")) {
var flag = "unreblog";
} else {
@ -64,7 +64,11 @@ function rt(id, acct_id, remote) {
httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json";
if(vis){
httpreq.send(JSON.stringify({visibility: vis}));
}else{
httpreq.send();
}
httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) {
var json = httpreq.response;
@ -95,6 +99,11 @@ function rt(id, acct_id, remote) {
}
}
}
function boostWith(vis){
var id = $("#tootmodal").attr("data-id");
var acct_id = $("#tootmodal").attr("data-acct");
rt(id, acct_id, false, vis)
}
//フォロー
function follow(acct_id, remote) {

View File

@ -77,6 +77,7 @@ function details(id, acct_id, tlid, mode) {
$("#toot-this .rt_ct").text(json.reblogs_count);
$("#tootmodal").attr("data-url", url);
$("#tootmodal").attr("data-id", json.id);
$("#tootmodal").attr("data-acct", acct_id);
if (local) {
$("#tootmodal").attr("data-user", scn + "@" + domain);
} else {

View File

@ -656,6 +656,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} else if (visen == "private") {
var vis =
'<i class="text-darken-3 material-icons orange-text vis-data pointer" title="' + lang.lang_parse_private + '(' + lang.lang_parse_clickcopy + ')" data-vis="private" onclick="staCopy(\'' + id + '\')">lock</i>';
var can_rt = "unvisible";
} else if (visen == "direct") {
var vis =
@ -665,6 +666,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
var if_mine = "";
var mine_via = "type-b";
var can_rt = "";
} else {
var if_mine = "hide";
var mine_via = "";

View File

@ -38,7 +38,8 @@
<!--TL-->
<!--スターター-->
<div id="start">
<div id="start-content"><h3 class="center">@@demoBottomBtns@@</h3>
<div id="start-content">
<h3 class="center">@@demoBottomBtns@@</h3>
@@lookAtBottom@@
<div id="demobottom">
<button class="btn waves-effect"
@ -49,7 +50,8 @@
<div class="leftside reverse" id="demogroup">
<div class="btnsgroup" style="margin-left: 5px;">
<a href="#" class="nex waves-effect">
<i class="material-icons nex big-icon" title="@@acctMan@@(Ctrl+Shift+M)">account_circle</i>
<i class="material-icons nex big-icon"
title="@@acctMan@@(Ctrl+Shift+M)">account_circle</i>
</a>
<a href="#" class="nex waves-effect">
<i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i>
@ -63,9 +65,12 @@
</div>
</div>
</div><br>
<i class="material-icons nex big-icon">account_circle</i>: @@acctMan@@<br>  @@acctManDesc@@<hr>
<i class="material-icons nex">settings</i>: @@setting@@<br>  @@settingDesc@@<hr>
<i class="material-icons nex">remove_from_queue</i>: TheDesk Nano @@nanoDes@@<br>  @@nanoDescPlus@@<hr>
<i class="material-icons nex big-icon">account_circle</i>: @@acctMan@@<br>  @@acctManDesc@@
<hr>
<i class="material-icons nex">settings</i>: @@setting@@<br>  @@settingDesc@@
<hr>
<i class="material-icons nex">remove_from_queue</i>: TheDesk Nano @@nanoDes@@<br>  @@nanoDescPlus@@
<hr>
<i class="material-icons nex">apps</i>: @@menu@@<br>  @@menuDesc@@<br>
<br>
<button class="btn waves-effect" onclick="closeStart()" style="width: 300px;">@@close@@</button>
@ -438,6 +443,10 @@
onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div>
</div>
@@btWithVis@@<br>
<button class="btn waves-effect darken-3 toot-btn-group purple" onclick="boostWith('public')"><i class="material-icons">public</i></button>
<button class="btn waves-effect darken-3 toot-btn-group blue" onclick="boostWith('unlisted')"><i class="material-icons">lock_open</i></button>
<button class="btn waves-effect darken-3 toot-btn-group orange" onclick="boostWith('private')"><i class="material-icons">lock</i></button>
<div id="toot-tools">
</div>
<div id="toot-after">
@ -806,8 +815,7 @@
<div><i class="material-icons">people_outline</i></div><span>@@local@@</span>
</div>
<div class="type waves-effect" data-type="local-media">
<div><i
class="material-icons">perm_media</i>
<div><i class="material-icons">perm_media</i>
</div><span>@@localMedia@@</span>
</div>
<div class="type waves-effect" data-type="home">
@ -817,8 +825,7 @@
<div><i class="material-icons">language</i></div><span>@@fed@@</span>
</div>
<div class="type waves-effect" data-type="pub-media">
<div><i
class="material-icons">perm_media</i></div>
<div><i class="material-icons">perm_media</i></div>
<span>@@fedMedia@@</span>
</div>
<div class="type waves-effect" data-type="dm">

View File

@ -62,6 +62,7 @@
"btedPeople":"People who boosted it",
"useOtherAcct1":"Use other account",
"useOtherAcct2":":unfav and unBT are disabled.",
"btWithVis": "Boost with visibility",
"reply":"Reply",
"bt":"Boost",
"favRegist":"Favourite",

View File

@ -62,6 +62,7 @@
"btedPeople":"このトゥートをブーストした人",
"useOtherAcct1":"他のアカウントを使用",
"useOtherAcct2":"の解除はできません",
"btWithVis": "公開範囲を指定してブースト",
"reply":"返信",
"bt":"ブースト",
"favRegist":"お気に入り",