mirror of
https://github.com/andrigamerita/simpkey
synced 2025-06-05 22:09:26 +02:00
CW
This commit is contained in:
@ -228,11 +228,12 @@ router.post('/action/:action', async ctx => {
|
|||||||
try {
|
try {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'create-note': {
|
case 'create-note': {
|
||||||
const { text, renoteId, replyId } = ctx.request.body;
|
const { text, renoteId, replyId, useCw, cw } = ctx.request.body;
|
||||||
const opts = { i } as Record<string, string>;
|
const opts = { i } as Record<string, string>;
|
||||||
if (text) opts.text = text;
|
if (text) opts.text = text;
|
||||||
if (renoteId) opts.renoteId = renoteId;
|
if (renoteId) opts.renoteId = renoteId;
|
||||||
if (replyId) opts.replyId = replyId;
|
if (replyId) opts.replyId = replyId;
|
||||||
|
if (useCw) opts.cw = cw || '';
|
||||||
await api(host, 'notes/create', opts);
|
await api(host, 'notes/create', opts);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,10 @@ mixin note(note)
|
|||||||
|
|
||||||
mixin post-form(url, placeholder, buttonText)
|
mixin post-form(url, placeholder, buttonText)
|
||||||
form(action=url, method="post")
|
form(action=url, method="post")
|
||||||
|
div: label
|
||||||
|
input(type="checkbox", name="useCw")
|
||||||
|
span CW
|
||||||
|
input(type="text", name="cw" placeholder="注釈(省略可能)" style="max-width: 100%; min-width: 100%;")
|
||||||
textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px")
|
textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px")
|
||||||
button(type="submit")= buttonText
|
button(type="submit")= buttonText
|
||||||
block
|
block
|
||||||
|
Reference in New Issue
Block a user