feat: enable deployment in subdirectory

This commit is contained in:
Jadeiin
2024-02-19 09:24:15 +01:00
committed by GitHub
parent 902cf3038a
commit e2af9afc32
8 changed files with 24 additions and 22 deletions
+2 -2
View File
@@ -266,7 +266,7 @@ function setSortOption(sortOption) {
const daysToExpire = 30;
const expirationDate = new Date();
expirationDate.setDate(expirationDate.getDate() + daysToExpire);
const cookieValue = encodeURIComponent(sortOption) + '; expires=' + expirationDate.toUTCString() + '; path=/';
const cookieValue = encodeURIComponent(sortOption) + '; expires=' + expirationDate.toUTCString();
document.cookie = 'sortOrder=' + cookieValue;
fetchSubscriptions();
toggleSortOptions();
@@ -314,4 +314,4 @@ document.addEventListener('DOMContentLoaded', function() {
document.querySelector('#sort-options').addEventListener('focus', function() {
isSortOptionsOpen = true;
});
});
});
+2 -2
View File
@@ -5,7 +5,7 @@ function setCookie(name, value, days) {
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + value + expires + "; path=/";
document.cookie = name + "=" + value + expires;
}
function storeFormFieldValue(fieldId) {
@@ -66,4 +66,4 @@ window.onload = function () {
restoreFormFields();
removeFromStorage();
runDatabaseMigration();
};
};
+7 -7
View File
@@ -522,7 +522,7 @@ function saveNotificationsButton() {
fromemail: fromEmail
};
fetch('/endpoints/notifications/save.php', {
fetch('endpoints/notifications/save.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -562,7 +562,7 @@ function testNotificationButton() {
fromemail: fromEmail
};
fetch('/endpoints/notifications/sendtestmail.php', {
fetch('endpoints/notifications/sendtestmail.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -589,27 +589,27 @@ function switchTheme() {
darkThemeCss.disabled = !darkThemeCss.disabled;
const themeChoice = darkThemeCss.disabled ? 'light' : 'dark';
document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
}
function setShowMonthlyPriceCookie() {
const showMonthlyPriceCheckbox = document.querySelector("#monthlyprice");
const value = showMonthlyPriceCheckbox.checked;
document.cookie = `showMonthlyPrice=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
document.cookie = `showMonthlyPrice=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
}
function setConvertCurrencyCookie() {
const convertCurrencyCheckbox = document.querySelector("#convertcurrency");
const value = convertCurrencyCheckbox.checked;
document.cookie = `convertCurrency=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
document.cookie = `convertCurrency=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
}
function setRemoveBackgroundCookie() {
const removeBackgroundCheckbox = document.querySelector("#removebackground");
const value = removeBackgroundCheckbox.checked;
document.cookie = `removeBackground=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
document.cookie = `removeBackground=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
}
function exportToJson() {
window.location.href = "endpoints/subscriptions/export.php";
}
}