refactor: more refactoring to topics as the top-level organization
This commit is contained in:
parent
11ecd86bb9
commit
4347d20263
18 changed files with 730 additions and 317 deletions
|
|
@ -11,7 +11,12 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
bottom: 5rem;
|
||||
padding: 0.5rem;
|
||||
padding: 1.5rem 1.5rem 0.75rem 1.5rem;
|
||||
}
|
||||
@media screen and (max-width: 1200px) {
|
||||
#chat #topic-chat-content {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
#chat #topic-chat-entry-container {
|
||||
|
|
@ -51,7 +56,7 @@
|
|||
cursor: pointer;
|
||||
align-content: center;
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid var(--text);
|
||||
border: 1px solid rgba(128, 128, 128, 0.2);
|
||||
}
|
||||
|
||||
#chat #topic-chat-entry-container form textarea {
|
||||
|
|
@ -60,6 +65,10 @@
|
|||
background: inherit;
|
||||
color: inherit;
|
||||
border-radius: var(--border-radius);
|
||||
border: 1px solid rgba(128, 128, 128, 0.2);
|
||||
resize: none;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
padding: 0.4rem;
|
||||
}
|
||||
|
||||
#chat .message-container {
|
||||
|
|
@ -67,7 +76,7 @@
|
|||
transition: all 0.33s;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
margin-top: 0.75rem;
|
||||
padding: 2px;
|
||||
padding: 0.5rem;
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +146,7 @@
|
|||
padding: 0.25rem 0 0 0;
|
||||
text-align: center;
|
||||
text-wrap: nowrap;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#chat .message-container .message-actions-container label {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
id="file-upload-and-share-input"
|
||||
aria-label="Upload and share file"
|
||||
type="file"
|
||||
name="file-upload-and-share"
|
||||
multiple
|
||||
/>
|
||||
<label for="file-upload-and-share-input">
|
||||
|
|
@ -36,7 +35,7 @@
|
|||
id="topic-chat-input"
|
||||
class="topic-chat-input"
|
||||
rows="1"
|
||||
name="data.message"
|
||||
name="data.content"
|
||||
></textarea>
|
||||
<button id="topic-chat-send" class="primary" aria-label="Send a message">
|
||||
<i class="icon send"></i>
|
||||
|
|
@ -44,9 +43,7 @@
|
|||
<script>
|
||||
{
|
||||
const form = document.currentScript.closest("form");
|
||||
const file_input = document.querySelector(
|
||||
'input[name="file-upload-and-share"]',
|
||||
);
|
||||
const file_input = document.querySelector('input[type="file"]');
|
||||
const chat_input = document.getElementById("topic-chat-input");
|
||||
const parent_id_input = document.getElementById("parent-id");
|
||||
const topic_chat_container =
|
||||
|
|
@ -64,7 +61,7 @@
|
|||
|
||||
form.on_submit = async (event) => {
|
||||
const user = JSON.parse(document.body.dataset.user);
|
||||
const topic_id = topic_chat_container.dataset.topic_id;
|
||||
const topic_id = document.body.dataset.topic;
|
||||
if (!topic_id) {
|
||||
alert("Failed to get topic_id!");
|
||||
return false;
|
||||
|
|
@ -123,10 +120,10 @@
|
|||
|
||||
if (form.uploaded_urls.length) {
|
||||
json.data = json.data ?? {};
|
||||
json.data.message =
|
||||
(typeof json.data.message === "string" &&
|
||||
json.data.message.trim().length
|
||||
? json.data.message.trim() + "\n"
|
||||
json.data.content =
|
||||
(typeof json.data.content === "string" &&
|
||||
json.data.content.trim().length
|
||||
? json.data.content.trim() + "\n"
|
||||
: "") + form.uploaded_urls.join("\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,10 +282,10 @@ function render_text_event(topic_chat_content, event, creator, existing_element)
|
|||
<div class="icon more-borderless"></div>
|
||||
</label>
|
||||
|
||||
<button class="message-action" data-action="react"><i class="icon more-circle"></i><span class="action-name">React</span></button>
|
||||
<button class="message-action mockup" data-action="react"><i class="icon circle"></i><span class="action-name">React</span></button>
|
||||
<button class="message-action" data-action="reply" onclick="document.getElementById( 'parent-id' ).value = '${message_id}';"><i class="icon reply"></i><span class="action-name">Reply</span></button>
|
||||
<button class="message-action" data-action="forward_copy"><i class="icon forward-copy"></i><span class="action-name">Copy Link</span></button>
|
||||
<button class="message-action" data-action="delete"><i class="icon trash"></i><span class="action-name">Delete</span></button>
|
||||
<button class="message-action mockup" data-action="forward_copy"><i class="icon forward-copy"></i><span class="action-name">Copy Link</span></button>
|
||||
<button class="message-action mockup" data-action="delete"><i class="icon trash"></i><span class="action-name">Delete</span></button>
|
||||
</div>
|
||||
<div class="info-container">
|
||||
<div class="avatar-container">
|
||||
|
|
@ -299,7 +299,7 @@ function render_text_event(topic_chat_content, event, creator, existing_element)
|
|||
<span class="short">${event_datetime.short}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-content-container">${message_text_to_html(event.data.message)}</div>
|
||||
<div class="message-content-container">${message_text_to_html(event.data.content)}</div>
|
||||
</div>`;
|
||||
|
||||
if (existing_element) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue