From ec25900ac0d03bc3691f8abadd97b11a7a3c5b5f Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 26 May 2023 14:32:08 +0200 Subject: [PATCH] resolves #29 start manual execution --- Website/index.html | 7 +++++-- Website/interaction.js | 28 +++++++++++++++++++--------- Website/style.css | 35 +++++++++++++++++++++-------------- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/Website/index.html b/Website/index.html index 2a4f93f..0c824c4 100644 --- a/Website/index.html +++ b/Website/index.html @@ -66,8 +66,11 @@ The total opposite of his ideal male body! Pandemic love comedy! - Delete Task ❌ - Add Task ➕ + + Start Task ▶️ + Delete Task ❌ + Add Task ➕ + diff --git a/Website/interaction.js b/Website/interaction.js index 7597be2..b176927 100644 --- a/Website/interaction.js +++ b/Website/interaction.js @@ -18,6 +18,7 @@ const publicationViewerAuthor = document.querySelector("#publicationViewerAuthor const pubviewcover = document.querySelector("#pubviewcover"); const publicationDelete = document.querySelector("publication-delete"); const publicationAdd = document.querySelector("publication-add"); +const publicationTaskStart = document.querySelector("publication-starttask"); const closetaskpopup = document.querySelector("#closePopupImg"); const settingDownloadLocation = document.querySelector("#downloadLocation"); const settingKomgaUrl = document.querySelector("#komgaUrl"); @@ -39,6 +40,7 @@ document.querySelector("#blurBackgroundTaskPopup").addEventListener("click", () document.querySelector("#blurBackgroundPublicationPopup").addEventListener("click", () => HidePublicationPopup()); publicationDelete.addEventListener("click", () => DeleteTaskClick()); publicationAdd.addEventListener("click", () => AddTaskClick()); +publicationTaskStart.addEventListener("click", () => StartTaskClick()); settingApiUri.addEventListener("keypress", (event) => { if(event.key === "Enter"){ apiUri = settingApiUri.value; @@ -130,6 +132,12 @@ function AddTaskClick(){ HidePublicationPopup(); } +function StartTaskClick(){ + var toEditTask = tasks.filter(task => task.publication.internalId == toEditId)[0]; + StartTask("DownloadNewChapters", toEditTask.connectorName, toEditId); + HidePublicationPopup(); +} + function ResetContent(){ //Delete everything tasksContent.replaceChildren(); @@ -144,8 +152,6 @@ function ResetContent(){ tasksContent.appendChild(add); } function ShowPublicationViewerWindow(publicationId, event, add){ - - //Show popup publicationViewerPopup.style.display = "block"; @@ -170,12 +176,14 @@ function ShowPublicationViewerWindow(publicationId, event, add){ //Check what action should be listed if(add){ - publicationAdd.style.display = "block"; + publicationAdd.style.display = "initial"; publicationDelete.style.display = "none"; + publicationTaskStart.style.display = "none"; } else{ publicationAdd.style.display = "none"; - publicationDelete.style.display = "block"; + publicationDelete.style.display = "initial"; + publicationTaskStart.style.display = "initial"; } } @@ -259,15 +267,17 @@ function ShowRunningTasks(event){ .then(json => { tagTasksPopupContent.replaceChildren(); json.forEach(task => { - var taskname = document.createElement("footer-tag-task-name"); - taskname.innerText = task.publication.sortName; - tagTasksPopupContent.appendChild(taskname); + console.log(task); + if(task.publication != null){ + var taskname = document.createElement("footer-tag-task-name"); + taskname.innerText = task.publication.sortName; + tagTasksPopupContent.appendChild(taskname); + } }); - if(json.length > 0){ + if(tagTasksPopupContent.children.length > 0){ tagTaskPopup.style.display = "block"; tagTaskPopup.style.left = `${tagTasksRunning.offsetLeft - 20}px`; } - }); } diff --git a/Website/style.css b/Website/style.css index b282611..8297cc3 100644 --- a/Website/style.css +++ b/Website/style.css @@ -383,9 +383,6 @@ publication-viewer{ background-color: var(--accent-color); border-radius: 5px; overflow: hidden; -} - -publication-viewer{ padding: 30px; } @@ -435,22 +432,32 @@ publication-viewer publication-information publication-description { overflow-x: scroll; } -publication-viewer publication-information publication-delete { +publication-viewer publication-information publication-interactions { + display: flex; + flex-direction: row; position: absolute; - bottom: 0px; - right: 0px; - color: red; - margin: 20px; + justify-content: end; + align-items: start; + bottom: 0; + left: 0; + width: 100%; +} + +publication-viewer publication-information publication-interactions > * { + margin: 0 10px 10px 10px; font-size: 16pt; } -publication-viewer publication-information publication-add { - position: absolute; - bottom: 0px; - right: 0px; +publication-viewer publication-information publication-interactions publication-starttask { + color: var(--secondary-color); +} + +publication-viewer publication-information publication-interactions publication-delete { + color: red; +} + +publication-viewer publication-information publication-interactions publication-add { color: limegreen; - margin: 20px; - font-size: 16pt; } footer-tag-popup {