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

@ -290,7 +290,7 @@ iframe,
} }
.area-toot.acct-note p:first-child:after { .area-toot.acct-note p:first-child:after {
content: "..."; content: "...";
color: var(--gray) color: var(--gray);
} }
.area-actions { .area-actions {
@ -316,11 +316,13 @@ iframe,
margin: 2px; margin: 2px;
grid-area: side; grid-area: side;
} }
.quote-inline {
display: none;
}
.quote-renote { .quote-renote {
display: grid; display: grid;
grid-template-columns: 43px 2fr 1fr; grid-template-columns: 43px 2fr 25px;
grid-template-areas: "ricon ruser" "ricon rtext"; grid-template-areas: "ricon ruser rdet" "ricon rtext rdet";
border: 1px solid; border: 1px solid;
margin-top: 3px; margin-top: 3px;
padding: 1px; padding: 1px;
@ -328,9 +330,13 @@ iframe,
} }
.renote-icon { .renote-icon {
grid-area: ricon; grid-area: ricon;
padding: 5px;
}
.renote-details {
grid-area: rdet;
} }
.renote-icon img { .renote-icon img {
width: 43px; width: 100%;
} }
.renote-user { .renote-user {
grid-area: ruser; grid-area: ruser;

View File

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

View File

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

View File

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

View File

@ -57,6 +57,21 @@ function qt(id, acct_id, at, url) {
html = html.replace(/<\/p>/, "\n"); html = html.replace(/<\/p>/, "\n");
html = $.strip_tags(html); html = $.strip_tags(html);
$("#textarea").val("\n" + "@" + at + " " + html + "\n" + url); $("#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); $("#post-acct-sel").val(acct_id);
$('select').formSelect(); $('select').formSelect();

View File

@ -25,7 +25,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
if (qt == "nothing" || !qt) { if (qt == "nothing" || !qt) {
var qtClass = "hide"; var qtClass = "hide";
} else { } else {
if (qt == "apiQuote") {
if (localStorage.getItem("quote_" + acct_id)) {
var qtClass = ""; var qtClass = "";
} else {
var qtClass = "hide";
}
} else {
var qtClass = "";
}
} }
var datetype = localStorage.getItem("datetype"); var datetype = localStorage.getItem("datetype");
var nsfwtype = localStorage.getItem("nsfw"); 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++) { for (var i = 0; i < tickerdata.length; i++) {
var value = tickerdata[i]; var value = tickerdata[i];
if (value.domain == thisdomain) { 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; break;
} }
} }
@ -834,7 +842,14 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
} }
//Quote //Quote
if (toot.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 ' + templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
boostback + ' ' + fav_app + ' ' + rt_app + ' ' + pin_app + boostback + ' ' + fav_app + ' ' + rt_app + ' ' + pin_app +

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -262,7 +262,7 @@
</template> </template>
<template v-if="item.checkbox"> <template v-if="item.checkbox">
<template v-for="(check, j) in item.text.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)" <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-model="item.setValue" type="radio" v-bind:id="item.id+check.value"
v-bind:value="check.value" /> v-bind:value="check.value" />

View File

@ -481,6 +481,10 @@ var postConstruction = [
}, { }, {
text: "@@full@@", text: "@@full@@",
value: "full" value: "full"
}, {
text: "@@apiQuote@@",
value: "apiQuote",
quote: true
}, { }, {
text: "@@notqt@@", text: "@@notqt@@",
value: "nothing" 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"
}