Add: quote

This commit is contained in:
Cutls 2019-09-08 01:33:01 +09:00
parent bc5be9449d
commit 3b69c4e7c1
16 changed files with 80 additions and 94 deletions

View File

@ -47,7 +47,7 @@
#bottom .leftside {
display: flex;
}
#tips{
#tips {
display: flex;
align-items: center;
}
@ -280,7 +280,7 @@ iframe,
white-space: nowrap;
text-overflow: ellipsis;
}
.acct-note p{
.acct-note p {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
@ -290,7 +290,7 @@ iframe,
}
.area-toot.acct-note p:first-child:after {
content: "...";
color: var(--gray)
color: var(--gray);
}
.area-actions {
@ -316,11 +316,13 @@ iframe,
margin: 2px;
grid-area: side;
}
.quote-inline {
display: none;
}
.quote-renote {
display: grid;
grid-template-columns: 43px 2fr 1fr;
grid-template-areas: "ricon ruser" "ricon rtext";
grid-template-columns: 43px 2fr 25px;
grid-template-areas: "ricon ruser rdet" "ricon rtext rdet";
border: 1px solid;
margin-top: 3px;
padding: 1px;
@ -328,9 +330,13 @@ iframe,
}
.renote-icon {
grid-area: ricon;
padding: 5px;
}
.renote-details {
grid-area: rdet;
}
.renote-icon img {
width: 43px;
width: 100%;
}
.renote-user {
grid-area: ruser;
@ -696,7 +702,7 @@ audio {
animation-duration: 0.1s;
animation-name: fadeInDown;
}
.urbadge{
.urbadge {
line-height: normal;
height: 2rem;
font-size: 1rem;

View File

@ -9,16 +9,11 @@ var idata = {
"kirishima.cloud_public": "パブリックタイムライン",
"minohdon.jp": "instance",
"minohdon.jp_name": "箕面どん",
"minohdon.jp_letters": "500",
"minohdon.jp_bbcode": "disabled",
"minohdon.jp_markdown": "disabled",
"minohdon.jp_glitch": "disabled",
"fedibird.com":"instance",
"fedibird.com_name":"Fedibird",
"fedibird.com_quote":"enabled",
"mastodos.com": "instance",
"mastodos.com_name": "マストどす",
"mastodos.com_letters": "500",
"mastodos.com_bbcode": "disabled",
"mastodos.com_markdown": "disabled",
"mastodos.com_glitch": "disabled",
"dev.kirishima.cloud": "hidden",
"dev.kirishima.cloud_name": "アスタルテ(Dev)",
"dev.kirishima.cloud_letters": "6229",
@ -27,15 +22,8 @@ var idata = {
"dev.kirishima.cloud_glitch": "enabled",
"mstdn.y-zu.org": "instance",
"mstdn.y-zu.org_name": "Yづドン(Y-zuDon)",
"mstdn.y-zu.org_letters": "500",
"mstdn.y-zu.org_bbcode": "disabled",
"mstdn.y-zu.org_markdown": "enabled",
"mstdn.y-zu.org_glitch": "disabled",
"imastodon.net": "instance",
"imastodon.net_name": "im@stodon",
"imastodon.net_letters": "500",
"imastodon.net_bbcode": "disabled",
"imastodon.net_markdown": "disabled",
"imastodon.net_home": "オフィス",
"imastodon.net_local": "楽屋",
"imastodon.net_notification": "ホワイトボード",
@ -44,12 +32,6 @@ var idata = {
"imastodon.net_fav": "の頭にティンときたようです",
"imastodon.net_bt": ":「わかるわ」",
"imastodon.net_follow": "名刺をいただきました",
"imastodon.net_glitch": "disabled",
"mstdn.osaka": "instance",
"mstdn.osaka_name": "大阪丼",
"mstdn.osaka_letters": "500",
"mstdn.osaka_bbcode": "disabled",
"mstdn.osaka_markdown": "disabled",
"mstdn.osaka_home": "ウチ",
"mstdn.osaka_local": "近所",
"mstdn.osaka_notification": "あめちゃん",
@ -58,12 +40,9 @@ var idata = {
"mstdn.osaka_fav": "がええやん言いました",
"mstdn.osaka_bt": "がしばいた",
"mstdn.osaka_follow": "ツルまれました",
"mstdn.osaka_glitch": "disabled",
"mstdn.kemono-friends.info": "instance",
"mstdn.kemono-friends.info_name": "ますとどんちほー",
"mstdn.kemono-friends.info_letters": "1024",
"mstdn.kemono-friends.info_bbcode": "disabled",
"mstdn.kemono-friends.info_markdown": "disabled",
"mstdn.kemono-friends.info_home": "なわばり",
"mstdn.kemono-friends.info_local": "ますとどんちほー",
"mstdn.kemono-friends.info_notification": "ねえねえ!",
@ -71,19 +50,13 @@ var idata = {
"mstdn.kemono-friends.info_post": "がおー!",
"mstdn.kemono-friends.info_fav": ":「すごーい」",
"mstdn.kemono-friends.info_bt": ":「たーのしー」",
"mstdn.kemono-friends.info_glitch": "disabled",
"itabashi.0j0.jp": "instance",
"itabashi.0j0.jp_name": "板橋丼",
"itabashi.0j0.jp_letters": "1024",
"itabashi.0j0.jp_bbcode": "disabled",
"itabashi.0j0.jp_markdown": "disabled",
"itabashi.0j0.jp_glitch": "disabled",
"itabashi.0j0.jp_quote":"enabled",
"dtp-mstdn.jp": "instance",
"dtp-mstdn.jp_name": "DTP鯖",
"dtp-mstdn.jp_letters": "500",
"dtp-mstdn.jp_bbcode": "disabled",
"dtp-mstdn.jp_markdown": "disabled",
"dtp-mstdn.jp_glitch": "disabled",
"dtp-mstdn.jp_name": "dtp-mstdn.jp",
"dtp-mstdn.jp_quote":"enabled",
"misskey.io": "misskey",
"misskey.io_name": "misskey.io",
"misskey.io_letters": "1000",
@ -105,10 +78,11 @@ var idata = {
"precure.ml": "instance",
"precure.ml_name": "キュアスタ!",
"precure.ml_letters": "1024",
"precure.ml_bbcode": "disabled",
"precure.ml_markdown": "disabled",
"precure.ml_post": "キュア!",
"precure.ml_glitch": "disabled"
"odakyu.app_quote":"enabled",
"nitiasa.com_quote":"enabled",
"biwakodon.com_quote":"enabled",
"comm.cx_quote":"enabled"
};
localStorage.setItem("instance", JSON.stringify(idata));

View File

@ -3,6 +3,7 @@
//アスタルテ判定初期化
localStorage.removeItem("kirishima")
localStorage.removeItem("quoters")
localStorage.removeItem("imas")
localStorage.removeItem("image");
localStorage.removeItem("stable")
@ -314,7 +315,6 @@ function ckdb(acct_id) {
localStorage.removeItem("followlocale_" + acct_id);
if (domain == "kirishima.cloud") {
localStorage.setItem("kirishima", "true");
$("#ranking-btn").show();
} else if (domain == "imastodon.net") {
localStorage.setItem("imas", "true");
$(".imasonly").show();
@ -322,8 +322,13 @@ function ckdb(acct_id) {
var at = localStorage.getItem("acct_" + acct_id + "_at");
var bbcode = domain + "_bbcode";
var letters = domain + "_letters";
var quoteMarker = domain + "_quote";
if (localStorage.getItem("instance")) {
var json = JSON.parse(localStorage.getItem("instance"));
if (json[quoteMarker] == "enabled") {
localStorage.setItem("quoters", "true");
localStorage.setItem("quote_" + acct_id, "true");
}
if (json[bbcode]) {
if (json[bbcode] == "enabled") {
localStorage.setItem("bb_" + acct_id, "true");

View File

@ -79,6 +79,10 @@ function post(mode, postvis) {
if (media) {
toot.media_ids = media.split(",");
}
var quote = $("#quote").val();
if (quote) {
toot.quote_id = quote;
}
if ($("#nsfw").hasClass("nsfw-avail")) {
var nsfw = "true";
toot.sensitive = nsfw;
@ -243,6 +247,7 @@ function clear() {
}
$("#textarea").attr("placeholder", lang.lang_toot);
$("#reply").val("");
$("#quote").val("");
$("#media").val("");
var cwt = localStorage.getItem("cw-text");
if (cwt) {

View File

@ -57,6 +57,21 @@ function qt(id, acct_id, at, url) {
html = html.replace(/<\/p>/, "\n");
html = $.strip_tags(html);
$("#textarea").val("\n" + "@" + at + " " + html + "\n" + url);
} else if (qt == "apiQuote") {
clear();
localStorage.setItem("nohide", true);
show();
$("#quote").val(id);
$("#post-acct-sel").val(acct_id);
$("#post-acct-sel").prop("disabled", true);
$('select').formSelect();
$("#textarea").attr("placeholder", lang.lang_usetxtbox_reply);
$("#textarea").focus();
var profimg = localStorage.getItem("prof_" + acct_id);
if (!profimg) {
profimg = "../../img/missing.svg";
}
$("#acct-sel-prof").attr("src", profimg);
}
$("#post-acct-sel").val(acct_id);
$('select').formSelect();

View File

@ -25,7 +25,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (qt == "nothing" || !qt) {
var qtClass = "hide";
} else {
var qtClass = "";
if (qt == "apiQuote") {
if (localStorage.getItem("quote_" + acct_id)) {
var qtClass = "";
} else {
var qtClass = "hide";
}
} else {
var qtClass = "";
}
}
var datetype = localStorage.getItem("datetype");
var nsfwtype = localStorage.getItem("nsfw");
@ -826,7 +834,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
for (var i = 0; i < tickerdata.length; i++) {
var value = tickerdata[i];
if (value.domain == thisdomain) {
var tickerdom = '<div style="background:linear-gradient(90deg, ' + value.bg + ', transparent 96%) !important; color:' + value.text + ';width:100%; height:0.9rem; font-size:0.8rem;"><img draggable="false" src="' + value.image + '" style="height:100%;" onerror="this.src=\'../../img/loading.svg\'"><span style="position:relative; top:-0.2rem;"> ' + escapeHTML(value.name) + '</span></div>';
var tickerdom = '<div style="user-select:none;cursor:default;background:linear-gradient(90deg, ' + value.bg + ', transparent 96%) !important; color:' + value.text + ';width:100%; height:0.9rem; font-size:0.8rem;"><img draggable="false" src="' + value.image + '" style="height:100%;" onerror="this.src=\'../../img/loading.svg\'"><span style="position:relative; top:-0.2rem;"> ' + escapeHTML(value.name) + '</span></div>';
break;
}
}
@ -834,7 +842,14 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
}
//Quote
if (toot.quote) {
poll = poll + '<div class="quote-renote"><div class="renote-icon"><img src="' + toot.quote.account.avatar + '"></div><div class="renote-user">' + escapeHTML(toot.quote.account.display_name) + '</div><div class="renote-text">' + toot.quote.content + '</div></div>'
var quoteUser = toot.quote.account.display_name
if(!quoteUser){
quoteUser = toot.quote.account.acct
}
poll = poll + '<div class="quote-renote"><div class="renote-icon"><a onclick="udg(\'' + toot.quote.account.id +
'\',' + acct_id + ');" user="' + toot.quote.account.acct + '" class="udg"><img draggable="false" src="' + toot.quote.account.avatar + '"></a>'+
'</div><div class="renote-user">' + escapeHTML(quoteUser) + '</div><div class="renote-text">' + toot.quote.content + '</div><div class="renote-details"><a onclick="details(\'' + toot.quote.id + '\',' + acct_id +
',\'' + tlid + '\',\'normal\')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div></div>'
}
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
boostback + ' ' + fav_app + ' ' + rt_app + ' ' + pin_app +

View File

@ -45,7 +45,7 @@ var tlView = new Vue({
});
var postView = new Vue({
el: '#postView',
data: { config: postConstruction, kirishima: localStorage.getItem('kirishima') },
data: { config: postConstruction, kirishima: localStorage.getItem('kirishima'), quoters: localStorage.getItem('quoters') },
methods: {
complete: function (i, val) {
var ls = postView.config[i];

View File

@ -219,6 +219,7 @@
</ul>
<!--hidden area-->
<input type="hidden" id="reply">
<input type="hidden" id="quote">
<input type="hidden" id="media">
<!--END hidden area-->
</div>

View File

@ -113,6 +113,7 @@
"mention": "URL and acct(mention to the user)",
"full": "URL, text and acct(mention to the user)",
"notqt": "Disabled(Hide buttons on TLs)",
"apiQuote": "API(only some instances)",
"main": "Default accounts of actions",
"mainwarn": "Main account can be set on Account Manager.",
"lastacct": "Account you used recently",

View File

@ -113,6 +113,7 @@
"mention": "URL and acct(mention to the user)",
"full": "URL, text and acct(mention to the user)",
"notqt": "Disabled(Hide buttons on TLs)",
"apiQuote": "API(only some instances)",
"main": "Default accounts of actions",
"mainwarn": "Main account can be set on Account Manager.",
"lastacct": "Account you used recently",

View File

@ -113,6 +113,7 @@
"mention": "URL und Name (Hinweis auf den Benutzer)",
"full": "URL, Text und Name(Hinweis auf den Benutzer)",
"notqt": "Deaktiviert (Taste in Verlauf ausgeblendet)",
"apiQuote": "API(only some instances)",
"main": "Standard-Konto für Aktionen",
"mainwarn": "Das Hauptkonto kann in der Kontoverwaltung gestellt werden.",
"lastacct": "Konto, das Sie kürzlich verwendet haben",

View File

@ -113,6 +113,7 @@
"mention": "URL and acct(mention to the user)",
"full": "URL, text and acct(mention to the user)",
"notqt": "Disabled(Hide buttons on TLs)",
"apiQuote": "API(only some instances)",
"main": "Default accounts of actions",
"mainwarn": "Main account can be set on Account Manager.",
"lastacct": "Account you used recently",

View File

@ -113,6 +113,7 @@
"mention": "URLとアカウント名(相手に通知)",
"full": "本文・URL・アカウント名",
"notqt": "使わない(TL上にボタンも表示されません)",
"apiQuote": "パラメーター(対応インスタンス)",
"main": "投稿後や起動時のアカウント",
"mainwarn": "メインアカウントはアカウント設定で指定できます。投稿以外のアカウント選択にも影響します。",
"lastacct": "最後に使用したアカウント",

View File

@ -262,7 +262,7 @@
</template>
<template v-if="item.checkbox">
<template v-for="(check, j) in item.text.checkbox">
<template v-if="!check.kirishima || (check.kirishima && kirishima)">
<template v-if="(!check.kirishima || (check.kirishima && kirishima) )&& (!check.quote || (check.quote && quoters))">
<label><input class="with-gap" v-on:click="complete(i,check.value)"
v-model="item.setValue" type="radio" v-bind:id="item.id+check.value"
v-bind:value="check.value" />

View File

@ -481,6 +481,10 @@ var postConstruction = [
}, {
text: "@@full@@",
value: "full"
}, {
text: "@@apiQuote@@",
value: "apiQuote",
quote: true
}, {
text: "@@notqt@@",
value: "nothing"

View File

@ -1,44 +0,0 @@
{
"kirishima.cloud":"instance",
"kirishima.cloud_name":"アスタルテ",
"kirishima.cloud_letters":"6229",
"kirishima.cloud_bbcode":"enabled",
"kirishima.cloud_markdown":"enabled",
"minohdon.jp":"instance",
"minohdon.jp_name":"箕面どん",
"fedibird.com":"instance",
"fedibird.com_name":"Fedibird",
"fedibird.com_quote":"enabled",
"mastodos.com":"instance",
"mastodos.com_name":"マストどす",
"dev.kirishima.cloud":"hidden",
"dev.kirishima.cloud_name":"アスタルテ(Dev)",
"dev.kirishima.cloud_letters":"6229",
"dev.kirishima.cloud_bbcode":"enabled",
"dev.kirishima.cloud_markdown":"enabled",
"mstdn.y-zu.org":"instance",
"mstdn.y-zu.org_name":"Yづドン",
"imastodon.net":"instance",
"imastodon.net_name":"im@stodon",
"imastodon.net_home":"オフィス",
"imastodon.net_local":"楽屋",
"imastodon.net_notification":"ホワイトボード",
"imastodon.net_public":"ライブステージ",
"mstdn.osaka_home":"ウチ",
"mstdn.osaka_local":"近所",
"mstdn.osaka_notification":"あめちゃん",
"mstdn.osaka_public":"新世界",
"mstdn.kemono-friends.info":"instance",
"mstdn.kemono-friends.info_name":"ますとどんちほー",
"mstdn.kemono-friends.info_letters":"1024",
"mstdn.kemono-friends.info_home":"なわばり",
"mstdn.kemono-friends.info_local":"ますとどんちほー",
"mstdn.kemono-friends.info_notification":"ねえねえ!",
"mstdn.kemono-friends.info_public":"ジャパリパーク",
"odakyu.app_quote":"enabled",
"nitiasa.com_quote":"enabled",
"dtp-mstdn.jp_quote":"enabled",
"biwakodon.com_quote":"enabled",
"itabashi.0j0.jp_quote":"enabled",
"comm.cx_quote":"enabled"
}