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!
Pandemic love comedy!
</publication-description>
<publication-delete>Delete Task ❌</publication-delete>
<publication-add>Add Task </publication-add>
<publication-interactions>
<publication-starttask>Start Task ▶️</publication-starttask>
<publication-delete>Delete Task ❌</publication-delete>
<publication-add>Add Task </publication-add>
</publication-interactions>
</publication-information>
</publication-viewer>
</popup>

View File

@ -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`;
}
});
}

View File

@ -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 {