mirror of
https://github.com/openvk/openvk
synced 2025-07-07 00:09:48 +03:00
r
This commit is contained in:
parent
3b50c6d4f8
commit
fcf281bf58
3 changed files with 27 additions and 9 deletions
|
@ -189,14 +189,24 @@ tippy(".client_app", {
|
|||
}
|
||||
});
|
||||
|
||||
function addNote(textareaId, id, name)
|
||||
function addNote(textareaId, nid)
|
||||
{
|
||||
note.value = id
|
||||
if(nid > 0) {
|
||||
note.value = nid
|
||||
let noteObj = document.querySelector("#nd"+nid)
|
||||
|
||||
let nortd = document.querySelector("#post-buttons"+textareaId+" .post-has-note");
|
||||
nortd.style.display = "block"
|
||||
|
||||
nortd.innerHTML = `${tr("note")} ${escapeHtml(noteObj.dataset.name)}`
|
||||
} else {
|
||||
note.value = "none"
|
||||
|
||||
let nortd = document.querySelector("#post-buttons"+textareaId+" .post-has-note");
|
||||
nortd.style.display = "block"
|
||||
let nortd = document.querySelector("#post-buttons"+textareaId+" .post-has-note");
|
||||
nortd.style.display = "none"
|
||||
|
||||
nortd.innerHTML = `${tr("note")} ${escapeHtml(name)}`
|
||||
nortd.innerHTML = ""
|
||||
}
|
||||
|
||||
u("body").removeClass("dimmed");
|
||||
u(".ovk-diag-cont").remove();
|
||||
|
@ -215,12 +225,18 @@ async function attachNote(id)
|
|||
} else {
|
||||
body = `
|
||||
${tr("select_or_create_new")}
|
||||
<div id="notesList">
|
||||
`
|
||||
|
||||
<div id="notesList">`
|
||||
|
||||
if(note.value != "none") {
|
||||
body += `
|
||||
<div class="ntSelect" onclick="addNote(${id}, 0)">
|
||||
<span>${tr("do_not_attach_note")}</span>
|
||||
</div>`
|
||||
}
|
||||
|
||||
for(const note of notes.items) {
|
||||
body += `
|
||||
<div class="ntSelect" onclick="addNote(${id}, ${note.id}, '${note.name}')">
|
||||
<div data-name="${note.name}" class="ntSelect" id="nd${note.id}" onclick="addNote(${id}, ${note.id})">
|
||||
<span>${escapeHtml(note.name)}</span>
|
||||
</div>
|
||||
`
|
||||
|
|
|
@ -412,6 +412,7 @@
|
|||
"select_or_create_new" = "Select existing note or <a href='/notes/create'>create new one</a>";
|
||||
|
||||
"notes_closed" = "You can't attach note to post, because only you can see them.<br> You can change it in <a href=\"/settings?act=privacy\">settings</a>.";
|
||||
"do_not_attach_note" = "Do not attach note";
|
||||
|
||||
/* Menus */
|
||||
|
||||
|
|
|
@ -397,6 +397,7 @@
|
|||
"select_or_create_new" = "Выберите существующую заметку или <a href='/notes/create'>создайте новую</a>";
|
||||
|
||||
"notes_closed" = "Вы не можете прикрепить заметку к записи, так как ваши заметки видны только вам.<br><br> Вы можете поменять это в <a href=\"/settings?act=privacy\">настройках</a>.";
|
||||
"do_not_attach_note" = "Не прикреплять заметку";
|
||||
|
||||
/* Menus */
|
||||
|
||||
|
|
Loading…
Reference in a new issue