2
0

resolves #29 start manual execution

This commit is contained in:
glax 2023-05-26 14:32:08 +02:00
parent e5fe14a09e
commit ec25900ac0
3 changed files with 45 additions and 25 deletions

View File

@ -66,8 +66,11 @@
The total opposite of his ideal male body! The total opposite of his ideal male body!
Pandemic love comedy! Pandemic love comedy!
</publication-description> </publication-description>
<publication-delete>Delete Task ❌</publication-delete> <publication-interactions>
<publication-add>Add Task </publication-add> <publication-starttask>Start Task ▶️</publication-starttask>
<publication-delete>Delete Task ❌</publication-delete>
<publication-add>Add Task </publication-add>
</publication-interactions>
</publication-information> </publication-information>
</publication-viewer> </publication-viewer>
</popup> </popup>

View File

@ -18,6 +18,7 @@ const publicationViewerAuthor = document.querySelector("#publicationViewerAuthor
const pubviewcover = document.querySelector("#pubviewcover"); const pubviewcover = document.querySelector("#pubviewcover");
const publicationDelete = document.querySelector("publication-delete"); const publicationDelete = document.querySelector("publication-delete");
const publicationAdd = document.querySelector("publication-add"); const publicationAdd = document.querySelector("publication-add");
const publicationTaskStart = document.querySelector("publication-starttask");
const closetaskpopup = document.querySelector("#closePopupImg"); const closetaskpopup = document.querySelector("#closePopupImg");
const settingDownloadLocation = document.querySelector("#downloadLocation"); const settingDownloadLocation = document.querySelector("#downloadLocation");
const settingKomgaUrl = document.querySelector("#komgaUrl"); const settingKomgaUrl = document.querySelector("#komgaUrl");
@ -39,6 +40,7 @@ document.querySelector("#blurBackgroundTaskPopup").addEventListener("click", ()
document.querySelector("#blurBackgroundPublicationPopup").addEventListener("click", () => HidePublicationPopup()); document.querySelector("#blurBackgroundPublicationPopup").addEventListener("click", () => HidePublicationPopup());
publicationDelete.addEventListener("click", () => DeleteTaskClick()); publicationDelete.addEventListener("click", () => DeleteTaskClick());
publicationAdd.addEventListener("click", () => AddTaskClick()); publicationAdd.addEventListener("click", () => AddTaskClick());
publicationTaskStart.addEventListener("click", () => StartTaskClick());
settingApiUri.addEventListener("keypress", (event) => { settingApiUri.addEventListener("keypress", (event) => {
if(event.key === "Enter"){ if(event.key === "Enter"){
apiUri = settingApiUri.value; apiUri = settingApiUri.value;
@ -130,6 +132,12 @@ function AddTaskClick(){
HidePublicationPopup(); HidePublicationPopup();
} }
function StartTaskClick(){
var toEditTask = tasks.filter(task => task.publication.internalId == toEditId)[0];
StartTask("DownloadNewChapters", toEditTask.connectorName, toEditId);
HidePublicationPopup();
}
function ResetContent(){ function ResetContent(){
//Delete everything //Delete everything
tasksContent.replaceChildren(); tasksContent.replaceChildren();
@ -144,8 +152,6 @@ function ResetContent(){
tasksContent.appendChild(add); tasksContent.appendChild(add);
} }
function ShowPublicationViewerWindow(publicationId, event, add){ function ShowPublicationViewerWindow(publicationId, event, add){
//Show popup //Show popup
publicationViewerPopup.style.display = "block"; publicationViewerPopup.style.display = "block";
@ -170,12 +176,14 @@ function ShowPublicationViewerWindow(publicationId, event, add){
//Check what action should be listed //Check what action should be listed
if(add){ if(add){
publicationAdd.style.display = "block"; publicationAdd.style.display = "initial";
publicationDelete.style.display = "none"; publicationDelete.style.display = "none";
publicationTaskStart.style.display = "none";
} }
else{ else{
publicationAdd.style.display = "none"; 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 => { .then(json => {
tagTasksPopupContent.replaceChildren(); tagTasksPopupContent.replaceChildren();
json.forEach(task => { json.forEach(task => {
var taskname = document.createElement("footer-tag-task-name"); console.log(task);
taskname.innerText = task.publication.sortName; if(task.publication != null){
tagTasksPopupContent.appendChild(taskname); 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.display = "block";
tagTaskPopup.style.left = `${tagTasksRunning.offsetLeft - 20}px`; tagTaskPopup.style.left = `${tagTasksRunning.offsetLeft - 20}px`;
} }
}); });
} }

View File

@ -383,9 +383,6 @@ publication-viewer{
background-color: var(--accent-color); background-color: var(--accent-color);
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
}
publication-viewer{
padding: 30px; padding: 30px;
} }
@ -435,22 +432,32 @@ publication-viewer publication-information publication-description {
overflow-x: scroll; overflow-x: scroll;
} }
publication-viewer publication-information publication-delete { publication-viewer publication-information publication-interactions {
display: flex;
flex-direction: row;
position: absolute; position: absolute;
bottom: 0px; justify-content: end;
right: 0px; align-items: start;
color: red; bottom: 0;
margin: 20px; left: 0;
width: 100%;
}
publication-viewer publication-information publication-interactions > * {
margin: 0 10px 10px 10px;
font-size: 16pt; font-size: 16pt;
} }
publication-viewer publication-information publication-add { publication-viewer publication-information publication-interactions publication-starttask {
position: absolute; color: var(--secondary-color);
bottom: 0px; }
right: 0px;
publication-viewer publication-information publication-interactions publication-delete {
color: red;
}
publication-viewer publication-information publication-interactions publication-add {
color: limegreen; color: limegreen;
margin: 20px;
font-size: 16pt;
} }
footer-tag-popup { footer-tag-popup {