Compare commits

...

13 Commits

Author SHA1 Message Date
43cbb80eec Fix overflow of tooltip release-status. 2023-11-12 13:48:28 +01:00
95876f1a53 New scrollbar, fix some overflow by scrollbar 2023-11-12 13:28:41 +01:00
42caebf458
Merge pull request #33 from db-2001/update-library-metadat
Added button to settings pop-up to refresh library metadata through POST request
2023-11-03 09:56:36 +01:00
ddee459aa2
Merge pull request #32 from db-2001/persistent-release-status
Move release-status to top right and keep visible
2023-11-03 09:50:24 +01:00
6952bcaa1d
Merge pull request #31 from db-2001/hover-css-onclick
Changed CSS feature to update whenever the checkbox is clicked instead of when the update button is clicked
2023-11-03 09:48:46 +01:00
db-2001
4cd06bd0e0 Added button to settings pop-up to refresh library metadata through POST request 2023-11-02 14:28:28 -04:00
db-2001
d138094a66 Move release-status to top right and keep visible 2023-11-02 14:07:17 -04:00
db-2001
d1dfeadb80 Feature 2023-11-02 13:31:48 -04:00
c315237d64
Merge pull request #27 from db-2001/release-status
Initial feature for Publication Status Indicator
2023-11-02 14:24:20 +01:00
db-2001
830252c8a7 Removed console logging 2023-11-01 20:01:28 -04:00
db-2001
54731e74e3 Revert "Moved tooltip to right for better readability"
This reverts commit 53bb83faca.
2023-11-01 19:58:38 -04:00
db-2001
53bb83faca Moved tooltip to right for better readability 2023-11-01 19:47:21 -04:00
db-2001
b03918ab5c Initial feature 2023-11-01 19:06:47 -04:00
5 changed files with 187 additions and 12 deletions

View File

@ -168,6 +168,11 @@ function ChangeStyleSheet(sheet){
PostData(uri);
}
function RefreshLibraryMetadata() {
var uri = `${apiUri}/Jobs/UpdateMetadata`;
PostData(uri);
}
function UpdateKomga(komgaUrl, komgaAuth){
var uri = `${apiUri}/LibraryConnectors/Update?libraryConnector=Komga&komgaUrl=${komgaUrl}&komgaAuth=${komgaAuth}`;
PostData(uri);

View File

@ -98,12 +98,15 @@
<label for="ntfyAuth"></label><input placeholder="Auth" id="ntfyAuth" type="text">
</div>
<div>
<input type="checkbox" id="mangaHoverCheckbox" name="css-style" value="style_mangahover.css">
<input type="checkbox" id="mangaHoverCheckbox" name="css-style" value="style_mangahover.css" onclick="updateCSS()">
<label for="css-style"> Show manga titles and sources on hover</label><br>
</div>
<div>
<input type="submit" value="Update" onclick="UpdateSettings()">
</div>
<div>
<input type="submit" value="Refresh Library Metadata" style="width: fit-content;"onclick="RefreshLibraryMetadata()">
</div>
</popup-content>
</popup-window>
</popup>

View File

@ -101,6 +101,18 @@ function Setup(){
}
Setup();
function updateCSS(){
if (document.getElementById("mangaHoverCheckbox").checked == true){
ChangeStyleSheet('hover')
document.getElementById('pagestyle').setAttribute('href', 'styles/style_mangahover.css');
//console.log('Changing theme to mangahover')
} else {
ChangeStyleSheet('default');
document.getElementById('pagestyle').setAttribute('href', 'styles/style_default.css');
//console.log('Changing theme to default')
}
}
function ResetContent(){
//Delete everything
tasksContent.replaceChildren();
@ -163,21 +175,54 @@ function GetNewMangaItems(){
//Returns a new "Publication" Item to display in the jobs section
function CreateManga(manga, connector){
//Create a new publication and set an internal ID
var mangaElement = document.createElement('publication');
mangaElement.id = GetValidSelector(manga.internalId);
//Append the cover image to the publication
var mangaImage = document.createElement('img');
mangaImage.src = GetCoverUrl(manga.internalId);
mangaElement.appendChild(mangaImage);
//Append the publication information to the publication
//console.log(manga);
var info = document.createElement('publication-information');
var connectorName = document.createElement('connector-name');
connectorName.innerText = connector;
connectorName.className = "pill";
connectorName.style.backgroundColor = stringToColour(connector);
info.appendChild(connectorName);
var mangaName = document.createElement('publication-name');
mangaName.innerText = manga.sortName;
//Create the publication status indicator
var releaseStatus = document.createElement('publication-status');
releaseStatus.setAttribute("release-status", manga.releaseStatus);
switch(manga.releaseStatus){
case 0:
releaseStatus.setAttribute("release-status", "Ongoing");
break;
case 1:
releaseStatus.setAttribute("release-status", "Completed");
break;
case 2:
releaseStatus.setAttribute("release-status", "On Hiatus");
break;
case 3:
releaseStatus.setAttribute("release-status", "Cancelled");
break;
case 4:
releaseStatus.setAttribute("release-status", "Upcoming");
break;
default:
releaseStatus.setAttribute("release-status", "Status Unavailable");
break;
}
info.appendChild(mangaName);
mangaElement.appendChild(info);
mangaElement.appendChild(releaseStatus); //Append the release status indicator to the publication element
return mangaElement;
}
@ -380,15 +425,6 @@ function UpdateSettings(){
Setup();
}
// If the checkbox is checked, set the style to style_mangahover.css and
if (document.getElementById("mangaHoverCheckbox").checked == true){
ChangeStyleSheet('hover')
//console.log('Changing theme to mangahover')
} else {
ChangeStyleSheet('default');
//console.log('Changing theme to default')
}
if(settingKomgaUrl.value != "" &&
settingKomgaUser.value != "" &&
settingKomgaPass.value != ""){

View File

@ -100,6 +100,8 @@ viewport {
flex-grow: 1;
height: 100%;
overflow-y: scroll;
scrollbar-color: var(--accent-color) var(--primary-color);
scrollbar-width: thin;
}
footer {
@ -203,7 +205,7 @@ publication{
height: 300px;
border-radius: 5px;
margin: 10px 10px;
padding: 15px 20px;
padding: 15px 19px;
position: relative;
flex-shrink: 0;
}
@ -250,6 +252,69 @@ publication-name{
font-weight: bold;
}
publication-status {
display:block;
height: 10px;
width: 10px;
border-radius: 50%;
margin: 5px;
position: absolute;
top: 5px;
right: 5px;
z-index: 2;
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 10px, rgb(51, 51, 51) 0px 0px 10px 3px;
}
publication-status::after {
content: attr(release-status);
position: absolute;
top: 0;
right: 0;
visibility: hidden;
/*Text Properties*/
font-size:10pt;
font-weight:bold;
color:white;
text-align: center;
/*Size*/
padding: 3px 8px;
border-radius: 6px;
border: 0px;
background-color: inherit;
}
publication-status:hover::after{
visibility:visible;
}
publication-status[release-status="Ongoing"]{
background-color: limegreen;
}
publication-status[release-status="Completed"]{
background-color: blueviolet;
}
publication-status[release-status="On Hiatus"]{
background-color: darkorange;
}
publication-status[release-status="Cancelled"]{
background-color: firebrick;
}
publication-status[release-status="Upcoming"]{
background-color: aqua;
}
publication-status[release-status="Status Unavailable"]{
background-color: gray;
}
publication img {
position: absolute;
top: 0;

View File

@ -100,6 +100,8 @@ viewport {
flex-grow: 1;
height: 100%;
overflow-y: scroll;
scrollbar-color: var(--accent-color) var(--primary-color);
scrollbar-width: thin;
}
footer {
@ -203,7 +205,7 @@ publication{
height: 300px;
border-radius: 5px;
margin: 10px 10px;
padding: 15px 20px;
padding: 15px 19px;
position: relative;
flex-shrink: 0;
}
@ -251,6 +253,70 @@ publication-name{
font-weight: bold;
}
publication-status {
display:block;
height: 10px;
width: 10px;
border-radius: 50%;
margin: 5px;
position: absolute;
top: 5px;
right: 5px;
z-index: 2;
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 10px, rgb(51, 51, 51) 0px 0px 10px 3px;
}
publication-status::after {
content: attr(release-status);
position: absolute;
top: 0;
right: 0;
visibility: hidden;
/*Text Properties*/
font-size:10pt;
font-weight:bold;
color:white;
text-align: center;
/*Size*/
padding: 3px 8px;
border-radius: 6px;
border: 0px;
background-color: inherit;
}
publication-status:hover::after{
visibility:visible;
}
publication-status[release-status="Ongoing"]{
background-color: limegreen;
}
publication-status[release-status="Completed"]{
background-color: blueviolet;
}
publication-status[release-status="On Hiatus"]{
background-color: darkorange;
}
publication-status[release-status="Cancelled"]{
background-color: firebrick;
}
publication-status[release-status="Upcoming"]{
background-color: aqua;
}
publication-status[release-status="Status Unavailable"]{
background-color: gray;
}
publication-details {
display: flex;
flex-direction: column;