Compare commits

..

No commits in common. "1c8d0bcf6b2bbdf599a1e70f37b2b585e74ab7e2" and "3afa46272de27cdec35cd7009f48a8795e6fd3d6" have entirely different histories.

3 changed files with 29 additions and 67 deletions

View File

@ -31,10 +31,8 @@
</div> </div>
<div id="notesBar" class="notesBar"> <div id="notesBar" class="notesBar">
<button id="newNote" class="newNote"> <button id="newNote" class="newNote"><img id="newNoteImage" draggable="false" alt=""
<div class="vcenter"><img id="newNoteImage" draggable="false" alt="" src="/static/svg/add.svg"></div> src="/static/svg/add.svg">New note</button>
<div class="vcenter">New note</div>
</button>
<div id="notesDiv" class="notesDiv"> <div id="notesDiv" class="notesDiv">
<button class="loadingStuff" id="loadingStuff"></button> <button class="loadingStuff" id="loadingStuff"></button>
</div> </div>
@ -44,17 +42,17 @@
<div id="optionsDiv" class="optionsDiv hidden"> <div id="optionsDiv" class="optionsDiv hidden">
<button class="exit" id="exitThing">X</button> <button class="exit" id="exitThing">X</button>
<h3 class="w300">Your account</h3> <h3 class="w300">Your account</h3>
<p id="usernameThing">Cannot connect to the server</p> <p id="usernameThing"></p>
<div class="section"></div> <div class="section"></div>
<p>Storage</p> <p>Storage</p>
<progress id="storageProgressThing" value="0" max="100"></progress><br> <progress id="storageProgressThing" value="0" max="100"></progress><br>
<p id="storageThing">Cannot connect to the server</p> <p id="storageThing"></p>
<div class="section"></div> <div class="section"></div>
<p>Account managment</p> <p>Account managment</p>
<button id="deleteMyAccountButton"><img src="/static/svg/delete_forever.svg" alt="">Delete account</button> <button id="deleteMyAccountButton"><img src="/static/svg/delete_forever.svg" alt="">Delete my account</button>
<button id="exportNotesButton"><img src="/static/svg/download.svg" alt="">Export notes</button> <button id="exportNotesButton"><img src="/static/svg/download.svg" alt="">Export notes</button>
<button id="importNotesButton"><img src="/static/svg/upload.svg" alt="">Import notes</button> <button id="importNotesButton"><img src="/static/svg/upload.svg" alt="">Import notes</button>
<button id="sessionManagerButton"><img src="/static/svg/list.svg" alt="">View sessions</button> <button id="sessionManagerButton"><img src="/static/svg/list.svg" alt="">Session manager</button>
<button class="lastButton" id="logOutButton"><img src="/static/svg/logout.svg" alt="">Log out</button> <button class="lastButton" id="logOutButton"><img src="/static/svg/logout.svg" alt="">Log out</button>
</div> </div>
<div id="sessionManagerDiv" class="optionsDiv hidden"> <div id="sessionManagerDiv" class="optionsDiv hidden">

View File

@ -339,21 +339,19 @@ body {
.notesBar .newNote { .notesBar .newNote {
height: 41px; height: 41px;
line-height: 41px; line-height: 41px;
width: 100%;
text-align: left; text-align: left;
background-color: rgba(0, 0, 0, 0);
border: none;
font-size: 16px; font-size: 16px;
margin-bottom: 5px;
cursor: pointer; cursor: pointer;
display: flex;
margin-top: 5px;
background: var(--note-button);
border-radius: 8px;
border: var(--border-color) solid 1px;
width: calc(100% - 7px - 7px - 3.5px);
margin-left: 5px;
} }
.notesBar .newNote img { .notesBar .newNote img {
height: 32px; height: 32px;
padding-right: 5px; padding-right: 5px;
transform: translateY(30%);
} }
.noteBox { .noteBox {
@ -520,7 +518,8 @@ iframe#markdown {
.optionsDiv .section { .optionsDiv .section {
width: 100%; width: 100%;
border-top: var(--border-color) solid 1px; height: 1px;
background-color: var(--border-color);
margin-top: 2px; margin-top: 2px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -531,19 +530,21 @@ iframe#markdown {
} }
.sessionDiv div { .sessionDiv div {
position: relative;
background-color: var(--session-color); background-color: var(--session-color);
border-radius: 8px; border-radius: 8px;
margin-bottom: 5px; margin-bottom: 5px;
padding: 10px; padding: 10px;
padding-bottom: 0px; height: 35px;
display: flex; display: flex;
overflow-y: scroll;
} }
.sessionDiv div p { .sessionDiv div p {
display: inline; display: inline;
transform: translateY(-20px);
overflow-wrap: anywhere; overflow-wrap: anywhere;
margin: 10px; margin-left: 10px;
margin-top: 0px;
} }
.sessionDiv div button { .sessionDiv div button {
@ -560,9 +561,8 @@ iframe#markdown {
.sessionDiv img { .sessionDiv img {
display: inline; display: inline;
filter: none; filter: none;
height: 35px; height: 100%;
position: static; position: static;
margin-right: 5px;
} }
/* Sign up/log in div */ /* Sign up/log in div */
@ -630,12 +630,6 @@ iframe#markdown {
display: none !important; display: none !important;
} }
.vcenter {
display: flex;
flex-direction: column;
justify-content: center;
}
.w100 { .w100 {
font-weight: 300; font-weight: 300;
} }

View File

@ -184,42 +184,6 @@ function updateFont() {
} }
} }
async function checknetwork() {
fetch(remote + "/api/loggedin", {
method: "POST",
body: JSON.stringify({
secretKey: localStorage.getItem("DONOTSHARE-secretkey"),
}),
headers: {
"Content-Type": "application/json; charset=UTF-8"
}
})
.catch(() => {
noteBox.readOnly = true
noteBox.value = ""
noteBox.placeholder = "You are currently offline."
displayError("Failed to connect to the server.\nPlease check your internet connection.")
})
.then((response) => response)
.then((response) => {
if (response.status == 400) {
displayError("Something went wrong! Signing you out...")
closeErrorButton.classList.add("hidden")
usernameBox.innerText = ""
setTimeout(function () {
window.location.replace("/logout")
}, 2500);
} else if (response.status == 200) {
updateUserInfo()
} else {
noteBox.readOnly = true
noteBox.value = ""
noteBox.placeholder = "You are currently offline."
displayError("Failed to connect to the server.\nPlease check your internet connection.")
}
});
}
async function waitforedit() { async function waitforedit() {
while(true) { while(true) {
await fetch(remote + "/api/waitforedit", { await fetch(remote + "/api/waitforedit", {
@ -281,10 +245,15 @@ function updateUserInfo() {
"Content-Type": "application/json; charset=UTF-8" "Content-Type": "application/json; charset=UTF-8"
} }
}) })
.catch(() => {
noteBox.readOnly = true
noteBox.value = ""
noteBox.placeholder = "Failed to connect to the server.\nPlease check your internet connection."
})
.then((response) => { .then((response) => {
async function doStuff() { async function doStuff() {
if (response.status === 500) { if (response.status === 500) {
displayError("Something went wrong! Signing you out...") displayError("Something went wrong! Signing you out..")
closeErrorButton.classList.add("hidden") closeErrorButton.classList.add("hidden")
usernameBox.innerText = "" usernameBox.innerText = ""
setTimeout(function () { setTimeout(function () {
@ -423,6 +392,8 @@ exitSessionsThing.addEventListener("click", () => {
sessionManagerDiv.classList.add("hidden") sessionManagerDiv.classList.add("hidden")
}); });
updateUserInfo()
function updateWordCount() { function updateWordCount() {
let wordCount = noteBox.value.split(" ").length let wordCount = noteBox.value.split(" ").length
if (wordCount === 1) { if (wordCount === 1) {
@ -759,8 +730,7 @@ document.addEventListener("DOMContentLoaded", function() {
}); });
if (firstNewVersion()) { if (firstNewVersion()) {
displayError("What's new in Burgernotes 2.0?\nRestyled client\nAdded changing passwords\nMigrated to OAuth2\nAdded importing notes") displayError("What's new in Burgernotes 1.2-1?\nNotes now support live editing\nFixed various bugs and issues in the client")
} }
checknetwork() //waitforedit()
waitforedit()