Made all paths relative

This commit is contained in:
Tracker-Friendly 2024-02-27 17:04:31 +00:00
parent b4006fb96c
commit 91fc7703df
11 changed files with 52 additions and 52 deletions

View File

@ -1,4 +1,4 @@
@import url("/static/fonts/inter.css");
@import url("../fonts/inter.css");
:root {
--invertdm: 0%;

View File

@ -1,10 +1,10 @@
if (localStorage.getItem("DONOTSHARE-secretkey") !== null) {
window.location.replace("/app")
window.location.replace("../app/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
if (localStorage.getItem("DONOTSHARE-password") !== null) {
window.location.replace("/app")
window.location.replace("../app/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
@ -109,7 +109,7 @@ signupButton.addEventListener("click", (event) => {
return key
};
fetch("/api/login", {
fetch("https://notes.hectabit.org/api/login", {
method: "POST",
body: JSON.stringify({
username: username,
@ -129,11 +129,11 @@ signupButton.addEventListener("click", (event) => {
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
window.location.href = "/app"
window.location.href = "../app/index.html"
}
else if (response.status == 401) {
console.log("Trying oldhash")
fetch("/api/login", {
fetch("https://notes.hectabit.org/api/login", {
method: "POST",
body: JSON.stringify({
username: username,
@ -153,7 +153,7 @@ signupButton.addEventListener("click", (event) => {
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
window.location.href = "/app"
window.location.href = "../app/index.html"
}
else if (response.status == 401) {
statusBox.innerText = "Wrong username or password..."

View File

@ -1,10 +1,10 @@
if (localStorage.getItem("DONOTSHARE-secretkey") === null) {
window.location.replace("/login")
window.location.replace("../login/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
if (localStorage.getItem("DONOTSHARE-password") === null) {
window.location.replace("/login")
window.location.replace("../login/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
@ -197,7 +197,7 @@ textMinusBox.addEventListener("click", (event) => {
function updateUserInfo() {
fetch("/api/userinfo", {
fetch("https://notes.hectabit.org/api/userinfo", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey
@ -214,7 +214,7 @@ function updateUserInfo() {
closeErrorButton.classList.add("hidden")
usernameBox.innerText = ""
setTimeout(function () {
window.location.replace("/api/logout")
window.location.replace("https://notes.hectabit.org/api/logout")
}, 2500);
} else {
let responseData = await response.json()
@ -236,7 +236,7 @@ usernameBox.addEventListener("click", (event) => {
updateUserInfo()
});
logOutButton.addEventListener("click", (event) => {
window.location.replace("/api/logout")
window.location.replace("https://notes.hectabit.org/api/logout")
});
exitThing.addEventListener("click", (event) => {
optionsDiv.classList.add("hidden")
@ -244,7 +244,7 @@ exitThing.addEventListener("click", (event) => {
});
deleteMyAccountButton.addEventListener("click", (event) => {
if (confirm("Are you REALLY sure that you want to delete your account? There's no going back!") == true) {
fetch("/api/deleteaccount", {
fetch("https://notes.hectabit.org/api/deleteaccount", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey
@ -256,7 +256,7 @@ deleteMyAccountButton.addEventListener("click", (event) => {
.then((response) => response)
.then((response) => {
if (response.status == 200) {
window.location.href = "/api/logout"
window.location.href = "https://notes.hectabit.org/api/logout"
} else {
displayError("Failed to delete account (HTTP error code " + response.status + ")")
}
@ -267,7 +267,7 @@ sessionManagerButton.addEventListener("click", (event) => {
optionsDiv.classList.add("hidden")
sessionManagerDiv.classList.remove("hidden")
fetch("/api/sessions/list", {
fetch("https://notes.hectabit.org/api/sessions/list", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey
@ -307,7 +307,7 @@ sessionManagerButton.addEventListener("click", (event) => {
}
sessionRemoveButton.addEventListener("click", (event) => {
fetch("/api/sessions/remove", {
fetch("https://notes.hectabit.org/api/sessions/remove", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,
@ -320,7 +320,7 @@ sessionManagerButton.addEventListener("click", (event) => {
.then((response) => response)
.then((response) => {
if (responseData[i]["thisSession"] == true) {
window.location.replace("/api/logout")
window.location.replace("https://notes.hectabit.org/api/logout")
}
});
sessionElement.remove()
@ -358,7 +358,7 @@ function selectNote(nameithink) {
let thingArray = Array.from(document.querySelectorAll(".noteButton")).find(el => el.id == nameithink);
thingArray.classList.add("selected")
fetch("/api/readnote", {
fetch("https://notes.hectabit.org/api/readnote", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,
@ -396,7 +396,7 @@ function selectNote(nameithink) {
let encryptedText = CryptoJS.AES.encrypt(noteBox.value, password).toString();
if (selectedNote == nameithink) {
fetch("/api/editnote", {
fetch("https://notes.hectabit.org/api/editnote", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,
@ -425,7 +425,7 @@ function selectNote(nameithink) {
}
function updateNotes() {
fetch("/api/listnotes", {
fetch("https://notes.hectabit.org/api/listnotes", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey
@ -459,7 +459,7 @@ function updateNotes() {
noteButton.addEventListener("click", (event) => {
if (event.ctrlKey) {
fetch("/api/removenote", {
fetch("https://notes.hectabit.org/api/removenote", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,
@ -499,7 +499,7 @@ newNote.addEventListener("click", (event) => {
}
let encryptedName = CryptoJS.AES.encrypt(noteName, password).toString();
fetch("/api/newnote", {
fetch("https://notes.hectabit.org/api/newnote", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,
@ -535,7 +535,7 @@ function downloadObjectAsJson(exportObj, exportName) {
function exportNotes() {
let noteExport = []
fetch("/api/exportnotes", {
fetch("https://notes.hectabit.org/api/exportnotes", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey
@ -594,7 +594,7 @@ removeBox.addEventListener("click", (event) => {
if (selectedNote == 0) {
displayError("You need to select a note first!")
} else {
fetch("/api/removenote", {
fetch("https://notes.hectabit.org/api/removenote", {
method: "POST",
body: JSON.stringify({
secretKey: secretkey,

View File

@ -1,10 +1,10 @@
if (localStorage.getItem("DONOTSHARE-secretkey") !== null) {
window.location.replace("/app")
window.location.replace("../app/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
if (localStorage.getItem("DONOTSHARE-password") !== null) {
window.location.replace("/app")
window.location.replace("../app/index.html")
document.body.innerHTML = "Redirecting..."
throw new Error();
}
@ -61,7 +61,7 @@ signupButton.addEventListener("click", (event) => {
};
fetch("/api/signup", {
fetch("https://notes.hectabit.org/api/signup", {
method: "POST",
body: JSON.stringify({
username: username,
@ -81,7 +81,7 @@ signupButton.addEventListener("click", (event) => {
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
window.location.href = "/app"
window.location.href = "../app/index.html"
}
else if (response.status == 409) {
statusBox.innerText = "Username already taken!"

View File

@ -6,8 +6,8 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<script type="text/javascript" src="/static/js/crypto-js.js"></script>
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
<script type="text/javascript" src="../static/js/crypto-js.js"></script>
</head>
<body>
@ -28,7 +28,7 @@
<div id="notesBar" class="notesBar">
<button id="newNote" class="newNote"><img id="newNoteImage" draggable="false" alt=""
src="/static/svg/add.svg">New note</button>
src="../static/svg/add.svg">New note</button>
<div id="notesDiv" class="notesDiv">
<button class="loadingStuff" id="loadingStuff"></button>
</div>
@ -46,10 +46,10 @@
<p id="storageThing"></p>
<div class="section"></div>
<p>Account managment</p>
<button id="deleteMyAccountButton"><img src="/static/svg/delete_forever.svg">Delete my account</button>
<button id="exportNotesButton"><img src="/static/svg/download.svg">Export notes</button>
<button id="sessionManagerButton"><img src="/static/svg/list.svg">Session manager</button>
<button class="lastButton" id="logOutButton"><img src="/static/svg/logout.svg">Log out</button>
<button id="deleteMyAccountButton"><img src="../static/svg/delete_forever.svg">Delete my account</button>
<button id="exportNotesButton"><img src="../static/svg/download.svg">Export notes</button>
<button id="sessionManagerButton"><img src="../static/svg/list.svg">Session manager</button>
<button class="lastButton" id="logOutButton"><img src="../static/svg/logout.svg">Log out</button>
</div>
<div id="sessionManagerDiv" class="optionsDiv hidden">
<button class="exit" id="exitSessionsThing">X</button>
@ -70,7 +70,7 @@
<textarea id="noteBox" class="noteBox"></textarea>
<script type="text/javascript" src="/static/js/main.js"></script>
<script type="text/javascript" src="../static/js/main.js"></script>
<script>
for (let i = 0; i < 40; i++) {
notesDiv.appendChild(loadingStuff.cloneNode())

View File

@ -6,7 +6,7 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
</head>
<body>

View File

@ -6,8 +6,8 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<script src="/static/js/hash-wasm.js"></script>
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
<script src="../static/js/hash-wasm.js"></script>
</head>
@ -19,8 +19,8 @@
<input id="passwordBox" class="hidden" type="password" placeholder="Enter your password">
<button id="signupButton">Next</button>
<button id="backButton" class="hidden">Back</button><br><br>
<p>Don't have an account? If so, <a href="/signup">Create one here!</a></p>
<p>Don't have an account? If so, <a href="../signup/index.html">Create one here!</a></p>
</div>
<script type="text/javascript" src="/static/js/login.js"></script>
<script type="text/javascript" src="../static/js/login.js"></script>
</body>

View File

@ -11,5 +11,5 @@ Logging out..
localStorage.removeItem("DONOTSHARE-secretkey")
localStorage.removeItem("DONOTSHARE-password")
localStorage.removeItem("CACHE-username")
window.location.replace("/")
window.location.replace("../index.html")
</script>

View File

@ -17,12 +17,12 @@
<h1 class="w300">Burgernotes</h1>
<p>A simple note-taking service!</p>
<br>
<a href="/app">Open in your browser</a>
<a href="./app/index.html">Open in your browser</a>
<a href="/static/burgernotes.mobileconfig" style="margin-top: 5px;">Download for iOS</a>
<a href="./static/burgernotes.mobileconfig" style="margin-top: 5px;">Download for iOS</a>
<a style="padding: 0; padding-bottom: 0; margin-top: 5px; background-color: rgba(0, 0, 0, 0);" href="https://flathub.org/apps/org.hectabit.burgernotes">
<img class="flathubLogo" style="height: 55px;"src="/static/svg/flathublight.svg">
<img class="flathubLogo" style="height: 55px;"src="./static/svg/flathublight.svg">
</a>
</div>
<br>
@ -37,7 +37,7 @@
</div>
<div class="links">
<a href="https://centrifuge.hectabit.org/hectabit/burgernotes">Source code</a>
<a href="/privacy">Privacy policy</a>
<a href="./privacy/index.html">Privacy policy</a>
</div>
</body>

View File

@ -6,7 +6,7 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
</head>
<body>

View File

@ -6,8 +6,8 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
<script src="/static/js/hash-wasm.js"></script>
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
<script src="../static/js/hash-wasm.js"></script>
</head>
@ -20,8 +20,8 @@
<input id="passwordBox" type="password" placeholder="Password">
<button id="signupButton">Signup</button><br><br>
<p>Please note that it's impossible to reset your password, do not forget it!</p>
<p>Already have an account? If so, <a href="/login">Login</a> instead!</p>
<p>Already have an account? If so, <a href="../login/index.html">Login</a> instead!</p>
</div>
<script type="text/javascript" src="/static/js/signup.js"></script>
<script type="text/javascript" src="../static/js/signup.js"></script>
</body>