CW when reply

This commit is contained in:
cutls 2020-11-17 01:10:59 +09:00
parent f2a4900f18
commit fa20278727
6 changed files with 24 additions and 7 deletions

View File

@ -227,7 +227,8 @@ $(function($) {
var acct_id = $('#timeline_' + selectedColumn).attr('data-acct')
var ats_cm = $('.selectedToot .rep-btn').attr('data-men')
var mode = $('.selectedToot .rep-btn').attr('data-visen')
re(id, ats_cm, acct_id, mode)
var cwTxt = $('#cw-text').val()
re(id, ats_cm, acct_id, mode, cwTxt)
return false
}
}

View File

@ -79,8 +79,8 @@ function loadVis() {
loadVis()
//コンテントワーニング
function cw() {
if ($('#cw').hasClass('cw-avail')) {
function cw(force) {
if ($('#cw').hasClass('cw-avail') || !force) {
$('#cw-text').val()
$('#cw-text').hide()
$('#cw').removeClass('yellow-text')

View File

@ -475,7 +475,7 @@ function draftToPost(json, acct_id, id) {
}
$('#textarea').val(html)
if (json.spoiler_text) {
cw()
cw(true)
$('#cw-text').val(json.spoiler_text)
}
if (json.sensitive) {

View File

@ -1,5 +1,5 @@
/*リプライ*/
function re(id, ats_cm, acct_id, mode) {
function re(id, ats_cm, acct_id, mode, cwTxt) {
clear()
var ats = ats_cm.split(',')
localStorage.setItem('nohide', true)
@ -25,13 +25,18 @@ function re(id, ats_cm, acct_id, mode) {
}
$('#acct-sel-prof').attr('src', profimg)
vis(mode)
if(localStorage.getItem('cw-continue') == 'yes') {
cw(true)
$('#cw-text').val(cwTxt)
}
}
function reEx(id) {
$('#tootmodal').modal('close')
var at = $('#tootmodal').attr('data-user')
var acct_id = $('#status-acct-sel').val()
var mode = $('#tootmodal .vis-data').attr('data-vis')
re(id, at, acct_id, mode)
var cwTxt = $('#cw-text').val()
re(id, at, acct_id, mode, cwTxt)
}
//引用
function qt(id, acct_id, at, url) {

View File

@ -1085,7 +1085,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
</a>
</div>
<div class="action ${disp['re']} ${noauth}">
<a onclick="re('${toot.id}','${to_mention}','${acct_id}','${visen}')"
<a onclick="re('${toot.id}','${to_mention}','${acct_id}','${visen}','${escapeHTML(toot.spoiler_text)}')"
class="waves-effect waves-dark btn-flat actct rep-btn"
data-men="${to_mention}" data-visen="${visen}" style="padding:0" title="${lang.lang_parse_replyto}">
<i class="fas fa-share"></i>

View File

@ -523,6 +523,17 @@ var postConstruction = [
checkbox: yesno
}
},
{
id: 'cw-continue',
storage: 'cw-continue',
checkbox: true,
setValue: 'no',
text: {
head: '@@cwContinue@@',
desc: '',
checkbox: yesno
}
},
{
id: 'vis',
storage: 'vis',