Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/scripts/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@ async function updateMediaType(attachmentsCount, attachmentListElem) {
const mediaTypeElem = document.getElementById('media-type');
const spoilerMediaControl = document.querySelector('.spoiler-media-control');
const ghostPostMediaControl = document.querySelector('.ghost-post-media-control');
const autoPublishTextMediaControl = document.querySelector('.auto-publish-text-media-control');

let mediaTypeDesc;
if (attachmentsCount === 0) {
mediaTypeDesc = 'Text 📝';
spoilerMediaControl.style.display = 'none';
ghostPostMediaControl.style.display = 'block';
autoPublishTextMediaControl.style.display = 'block';
} else if (attachmentsCount === 1) {
const singleAttachmentType =
attachmentListElem.querySelector('select').value;
if (singleAttachmentType === 'Image') mediaTypeDesc = 'Image 🖼️';
else mediaTypeDesc = 'Video 🎬';
spoilerMediaControl.style.display = 'block';
ghostPostMediaControl.style.display = 'none';
autoPublishTextMediaControl.style.display = 'none';
} else {
mediaTypeDesc = 'Carousel 🎠';
spoilerMediaControl.style.display = 'block';
ghostPostMediaControl.style.display = 'none';
autoPublishTextMediaControl.style.display = 'none';
}

mediaTypeElem.innerText = mediaTypeDesc;
Expand Down
10 changes: 5 additions & 5 deletions views/upload.pug
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ block content
br
input#link-attachment(type='text' name='linkAttachment' value='')
br

label(for="autoPublishText")
input(type="checkbox" name="autoPublishText" id="autoPublishText")
| Auto-Publish (only for text posts)
br
div.auto-publish-text-media-control
label(for="autoPublishText")
input(type="checkbox" name="autoPublishText" id="autoPublishText")
| Auto-Publish (only for text posts)
br

br
div.ghost-post-media-control
Expand Down