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")) { if ($("#pub_" + id).hasClass("rted")) {
var flag = "unreblog"; var flag = "unreblog";
} else { } else {
@ -64,7 +64,11 @@ function rt(id, acct_id, remote) {
httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.setRequestHeader('Content-Type', 'application/json');
httpreq.setRequestHeader('Authorization', 'Bearer ' + at); httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
httpreq.responseType = "json"; httpreq.responseType = "json";
httpreq.send(); if(vis){
httpreq.send(JSON.stringify({visibility: vis}));
}else{
httpreq.send();
}
httpreq.onreadystatechange = function () { httpreq.onreadystatechange = function () {
if (httpreq.readyState === 4) { if (httpreq.readyState === 4) {
var json = httpreq.response; 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) { 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); $("#toot-this .rt_ct").text(json.reblogs_count);
$("#tootmodal").attr("data-url", url); $("#tootmodal").attr("data-url", url);
$("#tootmodal").attr("data-id", json.id); $("#tootmodal").attr("data-id", json.id);
$("#tootmodal").attr("data-acct", acct_id);
if (local) { if (local) {
$("#tootmodal").attr("data-user", scn + "@" + domain); $("#tootmodal").attr("data-user", scn + "@" + domain);
} else { } else {

View File

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

View File

@ -38,34 +38,39 @@
<!--TL--> <!--TL-->
<!--スターター--> <!--スターター-->
<div id="start"> <div id="start">
<div id="start-content"><h3 class="center">@@demoBottomBtns@@</h3> <div id="start-content">
<h3 class="center">@@demoBottomBtns@@</h3>
@@lookAtBottom@@ @@lookAtBottom@@
<div id="demobottom"> <div id="demobottom">
<button class="btn waves-effect" <button class="btn waves-effect"
style="width: 300px;height: 2.5rem;line-height: 0;margin: 0; background-color: var(--accentbtn);"> style="width: 300px;height: 2.5rem;line-height: 0;margin: 0; background-color: var(--accentbtn);">
<i class="material-icons" <i class="material-icons"
style="position: relative; top: 5px; font-size: 1.5rem; text-align: center; margin-right: 10px;">edit</i>@@toot@@ style="position: relative; top: 5px; font-size: 1.5rem; text-align: center; margin-right: 10px;">edit</i>@@toot@@
</button> </button>
<div class="leftside reverse" id="demogroup"> <div class="leftside reverse" id="demogroup">
<div class="btnsgroup" style="margin-left: 5px;"> <div class="btnsgroup" style="margin-left: 5px;">
<a href="#" class="nex waves-effect"> <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"
</a> title="@@acctMan@@(Ctrl+Shift+M)">account_circle</i>
<a href="#" class="nex waves-effect"> </a>
<i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i> <a href="#" class="nex waves-effect">
</a> <i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i>
<a class="nex waves-effect"> </a>
<i class="material-icons" title="@@nanoDes@@TheDesk Nano">remove_from_queue</i> <a class="nex waves-effect">
</a> <i class="material-icons" title="@@nanoDes@@TheDesk Nano">remove_from_queue</i>
<aside class="nex waves-effect" id="list-tgl"> </a>
<i class="material-icons" title="@@menu@@">apps</i> <aside class="nex waves-effect" id="list-tgl">
</a> <i class="material-icons" title="@@menu@@">apps</i>
</a>
</div>
</div> </div>
</div>
</div><br> </div><br>
<i class="material-icons nex big-icon">account_circle</i>: @@acctMan@@<br>  @@acctManDesc@@<hr> <i class="material-icons nex big-icon">account_circle</i>: @@acctMan@@<br>  @@acctManDesc@@
<i class="material-icons nex">settings</i>: @@setting@@<br>  @@settingDesc@@<hr> <hr>
<i class="material-icons nex">remove_from_queue</i>: TheDesk Nano @@nanoDes@@<br>  @@nanoDescPlus@@<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> <i class="material-icons nex">apps</i>: @@menu@@<br>  @@menuDesc@@<br>
<br> <br>
<button class="btn waves-effect" onclick="closeStart()" style="width: 300px;">@@close@@</button> <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> onclick="staEx('fav')"><i class="fas fa-star"></i></button>
</div> </div>
</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 id="toot-tools">
</div> </div>
<div id="toot-after"> <div id="toot-after">
@ -806,8 +815,7 @@
<div><i class="material-icons">people_outline</i></div><span>@@local@@</span> <div><i class="material-icons">people_outline</i></div><span>@@local@@</span>
</div> </div>
<div class="type waves-effect" data-type="local-media"> <div class="type waves-effect" data-type="local-media">
<div><i <div><i class="material-icons">perm_media</i>
class="material-icons">perm_media</i>
</div><span>@@localMedia@@</span> </div><span>@@localMedia@@</span>
</div> </div>
<div class="type waves-effect" data-type="home"> <div class="type waves-effect" data-type="home">
@ -817,8 +825,7 @@
<div><i class="material-icons">language</i></div><span>@@fed@@</span> <div><i class="material-icons">language</i></div><span>@@fed@@</span>
</div> </div>
<div class="type waves-effect" data-type="pub-media"> <div class="type waves-effect" data-type="pub-media">
<div><i <div><i class="material-icons">perm_media</i></div>
class="material-icons">perm_media</i></div>
<span>@@fedMedia@@</span> <span>@@fedMedia@@</span>
</div> </div>
<div class="type waves-effect" data-type="dm"> <div class="type waves-effect" data-type="dm">

View File

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

View File

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