Updated to 1.2
This commit is contained in:
parent
c5a8d7995a
commit
82b6316e4a
|
@ -1,14 +1,4 @@
|
|||
#!/bin/sh
|
||||
cd $(dirname "$(readlink -f "$0")")
|
||||
git clone https://centrifuge.hectabit.org/hectabit/burgernotes --depth=1
|
||||
cd burgernotes
|
||||
mkdir -p ../website/static ../website/app ../website/error ../website/login ../website/logout ../website/privacy ../website/signup
|
||||
cp -r static/* ../website/static
|
||||
cp templates/app.html ../website/app/index.html
|
||||
cp templates/error.html ../website/error/index.html
|
||||
cp templates/login.html ../website/login/index.html
|
||||
cp ../logout.html ../website/logout/index.html
|
||||
cp templates/privacy.html ../website/privacy/index.html
|
||||
cp templates/signup.html ../website/signup/index.html
|
||||
cd ..
|
||||
rm -rf burgernotes
|
||||
git clone https://centrifuge.hectabit.org/hectabit/burgernotes-client-web.git --depth=1
|
||||
mv burgernotes-client-web/* website/
|
||||
rm -r burgernotes-client-web website/index.html website/README.md website/LICENSE
|
||||
|
|
|
@ -8,6 +8,16 @@
|
|||
<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="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -7,6 +7,16 @@
|
|||
<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="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -8,18 +8,33 @@
|
|||
<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="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p class="credit">Image by perga (@pergagreen on discord)</p>
|
||||
<img src="/static/img/background.jpg" class="background">
|
||||
<div class="inoutdiv">
|
||||
<h2 class="w300">Login</h2>
|
||||
<p id="statusBox"></p>
|
||||
<span id="inputNameBox" style="margin-right: 10px;color: var(--text-color);"></span><input id="usernameBox" class="hidden" type="text" placeholder="Enter your username">
|
||||
<span id="inputNameBox" style="margin-right: 10px;color: var(--text-color);"></span>
|
||||
<input id="usernameBox" class="hidden" type="text" placeholder="Enter your username">
|
||||
<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>
|
||||
<button id="backButton" class="hidden">Back</button>
|
||||
<br>
|
||||
<br>
|
||||
<p>Don't have an account? If so, <a href="../signup/index.html">Create one here!</a></p>
|
||||
<div style="display: flex;"><p id="homeserver">Your homeserver is loading... </p><div style="display: flex;flex-direction: column;justify-content: center;"><a href="/homeserver">Change</a></div></div>
|
||||
<a href="../privacy/index.html">Privacy & Terms</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -5,6 +5,16 @@
|
|||
<title>Burgernotes</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<link rel="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<head>
|
||||
Logging out..
|
||||
<script>
|
||||
|
|
|
@ -7,6 +7,16 @@
|
|||
<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="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -8,10 +8,21 @@
|
|||
<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="icon" href="../static/svg/favicon.svg">
|
||||
<script>
|
||||
if (window.location.href.endsWith('/index.html')) {
|
||||
if (window.location.origin !== null) {
|
||||
var currentUrl = window.location.href;
|
||||
var newUrl = currentUrl.replace('/index.html', '');
|
||||
window.location.href = newUrl;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p class="credit">Image by perga (@pergagreen on discord)</p>
|
||||
<img src="/static/img/background.jpg" class="background">
|
||||
<div class="inoutdiv">
|
||||
<h2 class="w300">Signup</h2>
|
||||
<p>Signup for a Burgernotes account</p>
|
||||
|
@ -19,10 +30,10 @@
|
|||
<input id="usernameBox" type="text" placeholder="Username">
|
||||
<input id="passwordBox" type="password" placeholder="Password"><br>
|
||||
<button id="signupButton">Signup</button><br><br>
|
||||
<p>Already have an account? If so, <a href="../login/index.html">Login</a> instead!</p>
|
||||
<p>Please note that it's impossible to reset your password, do not forget it!</p>
|
||||
By signing up, you agree to our <a href="../privacy/index.html">Privacy & Terms</a>.<br><br>
|
||||
<p>Already have an account? If so, <a href="../login/index.html">Login</a> instead!</p><br>
|
||||
<div style="display: flex;"><p id="homeserver">Your homeserver is loading... </p><div style="display: flex;flex-direction: column;justify-content: center;"><a href="/homeserver">Change</a></div></div>
|
||||
<a href="../privacy/index.html">Privacy & Terms</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="../static/js/signup.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
@import url("../fonts/inter.css");
|
||||
|
||||
:root {
|
||||
--contrast: #eee;
|
||||
--contrast2: #fff;
|
||||
--invertdm: 0%;
|
||||
--bar: #f4f4f4;
|
||||
--editor: #ffffff;
|
||||
|
@ -23,6 +25,8 @@
|
|||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--invertdm: 100%;
|
||||
--contrast: #2d2f21;
|
||||
--contrast2: #2d2f21;
|
||||
--bar: #2d2f31;
|
||||
--editor: #202124;
|
||||
--text-color: #ffffff;
|
||||
|
@ -52,7 +56,7 @@
|
|||
}
|
||||
|
||||
.newNote img {
|
||||
filter: invert(100%)
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
#errorDiv p {
|
||||
|
@ -64,7 +68,7 @@
|
|||
}
|
||||
|
||||
.burgerSession img {
|
||||
filter: invert(100%) !important
|
||||
filter: invert(100%) !important;
|
||||
}
|
||||
|
||||
.links a {
|
||||
|
@ -81,16 +85,16 @@
|
|||
|
||||
.inoutdiv input {
|
||||
color: white;
|
||||
background-color: #202124;
|
||||
background-color: var(--editor);
|
||||
}
|
||||
|
||||
.flathubLogo {
|
||||
filter: invert(100%)
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
||||
.feature {
|
||||
background-color: rgba(0, 0, 0, 0) !important;
|
||||
color: var(--text-color)
|
||||
color: var(--text-color);
|
||||
}
|
||||
.mainDiv .yellow {
|
||||
border-color: #e9e98d !important;
|
||||
|
@ -127,6 +131,14 @@ body {
|
|||
font-family: "Inter", sans-serif;
|
||||
}
|
||||
|
||||
.hiddenButton {
|
||||
right: 0px;
|
||||
position: fixed;
|
||||
background-color: var(--editor);
|
||||
color: var(--editor);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* Web app */
|
||||
.topBar {
|
||||
position: fixed;
|
||||
|
@ -198,7 +210,6 @@ body {
|
|||
|
||||
background-color: var(--bar);
|
||||
|
||||
|
||||
border: solid;
|
||||
border-color: var(--border-color);
|
||||
border-width: 1px;
|
||||
|
@ -210,19 +221,15 @@ body {
|
|||
width: calc(100% - 14px - 4px - 7px);
|
||||
color: var(--text-color);
|
||||
background-color: #ffffff;
|
||||
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin: 7px;
|
||||
padding-left: 7px;
|
||||
|
||||
border: solid;
|
||||
border-color: var(--border-color);
|
||||
border-width: 1px;
|
||||
border-radius: 8px;
|
||||
|
||||
font-size: 15px;
|
||||
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
@ -248,7 +255,6 @@ body {
|
|||
height: calc(100% - 50px - 30px - 1px);
|
||||
|
||||
background-color: var(--bar);
|
||||
|
||||
border: solid;
|
||||
border-color: var(--border-color);
|
||||
border-width: 0px;
|
||||
|
@ -270,27 +276,26 @@ body {
|
|||
margin-bottom: 0;
|
||||
background-color: var(--note-button);
|
||||
color: var(--unselected-note-button-text-color);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
|
||||
border: solid;
|
||||
border-color: var(--border-color);
|
||||
border-width: 1px;
|
||||
|
||||
font-size: 15px;
|
||||
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.notesBar .loadingStuff {
|
||||
border: none;
|
||||
|
||||
background:
|
||||
linear-gradient(0.25turn, transparent, #fff, transparent),
|
||||
linear-gradient(#eee, #eee),
|
||||
linear-gradient(0.25turn, transparent, var(--contrast2), transparent),
|
||||
linear-gradient(var(--contrast), var(--contrast)),
|
||||
radial-gradient(38px circle at 19px 19px, #eee 50%, transparent 51%),
|
||||
linear-gradient(#eee, #eee);
|
||||
linear-gradient(var(--contrast), var(--contrast));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 315px 250px, 315px 180px, 100px 100px, 225px 30px;
|
||||
background-position: -315px 0, 0 0, 0px 190px, 50px 195px;
|
||||
|
@ -317,7 +322,6 @@ body {
|
|||
background-color: rgba(0, 0, 0, 0);
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -344,7 +348,7 @@ body {
|
|||
}
|
||||
|
||||
.noteBox:focus {
|
||||
outline: none
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.optionsCoverDiv {
|
||||
|
@ -360,14 +364,14 @@ body {
|
|||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 300px;
|
||||
position: fixed;
|
||||
background-color: var(--option-background);
|
||||
padding: 10px;
|
||||
color: var(--text-color);
|
||||
border-radius: 8px;
|
||||
min-width: 338.5px;
|
||||
min-width: 300px;
|
||||
z-index: 3;
|
||||
|
||||
}
|
||||
|
||||
.optionsDiv button {
|
||||
|
@ -384,6 +388,7 @@ body {
|
|||
background-color: var(--theme-color);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
.optionsDiv .normalButton {
|
||||
|
@ -398,7 +403,7 @@ body {
|
|||
.optionsDiv input {
|
||||
width: calc(100% - 12px);
|
||||
height: 25px;
|
||||
background-color: ffffff;
|
||||
background-color: #ffffff;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-bottom: 7px;
|
||||
|
@ -511,8 +516,11 @@ body {
|
|||
/* Sign up/log in div */
|
||||
|
||||
.inoutdiv {
|
||||
border-radius: 8px;
|
||||
margin: 10%;
|
||||
padding: 15px;
|
||||
padding: 30px;
|
||||
border: solid 1px var(--border-color);
|
||||
background-color: var(--bar);
|
||||
}
|
||||
|
||||
.inoutdiv input {
|
||||
|
@ -526,6 +534,7 @@ body {
|
|||
border-color: var(--border-color);
|
||||
border-width: 1px;
|
||||
border-radius: 8px;
|
||||
|
||||
}
|
||||
|
||||
.inoutdiv button {
|
||||
|
@ -540,6 +549,7 @@ body {
|
|||
border-radius: 8px;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
}
|
||||
|
||||
.inoutdiv a {
|
||||
|
@ -547,6 +557,23 @@ body {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.background {
|
||||
position: fixed;
|
||||
z-index: -2;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.credit {
|
||||
position: fixed;
|
||||
left: 5px;
|
||||
color: white;
|
||||
z-index: -1;
|
||||
margin: 0;
|
||||
bottom: 5px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
@ -661,20 +688,24 @@ body {
|
|||
.links a {
|
||||
margin-left: 5px;
|
||||
text-decoration: none;
|
||||
background-color: #f8f8f8;
|
||||
background-color: var(--bar);
|
||||
color: var(--text-color);
|
||||
padding: 10px;
|
||||
padding-top: 2.5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 10px;
|
||||
transition: background-color .2s;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.links a:hover {
|
||||
background-color: #eaeaea;
|
||||
background-color: var(--editor);
|
||||
}
|
||||
|
||||
.links a img {
|
||||
transform: translateY(5px);
|
||||
padding-right: 10px;
|
||||
filter: invert(var(--invertdm));
|
||||
}
|
||||
|
||||
.links a:hover {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
|
@ -0,0 +1,49 @@
|
|||
let homeserverBox = document.getElementById("homeserverBox")
|
||||
let statusBox = document.getElementById("statusBox")
|
||||
let changeButton = document.getElementById("changeButton")
|
||||
|
||||
function showElements(yesorno) {
|
||||
if (!yesorno) {
|
||||
homeserverBox.classList.add("hidden")
|
||||
changeButton.classList.add("hidden")
|
||||
}
|
||||
else {
|
||||
homeserverBox.classList.remove("hidden")
|
||||
changeButton.classList.remove("hidden")
|
||||
}
|
||||
}
|
||||
|
||||
changeButton.addEventListener("click", (event) => {
|
||||
async function doStuff() {
|
||||
let remote = homeserverBox.value
|
||||
|
||||
if (remote == "") {
|
||||
statusBox.innerText = "A homeserver is required!"
|
||||
return
|
||||
}
|
||||
|
||||
showElements(false)
|
||||
statusBox.innerText = "Connecting to homeserver..."
|
||||
|
||||
fetch(remote + "/api/version")
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
async function doStuff() {
|
||||
if (response.status == 200) {
|
||||
localStorage.setItem("homeserverURL", remote)
|
||||
|
||||
window.location.href = document.referrer;
|
||||
}
|
||||
else if (response.status == 404) {
|
||||
statusBox.innerText = "Not a valid homeserver!"
|
||||
}
|
||||
else {
|
||||
statusBox.innerText = "Something went wrong!"
|
||||
showElements(true)
|
||||
}
|
||||
}
|
||||
doStuff()
|
||||
});
|
||||
}
|
||||
doStuff()
|
||||
});
|
|
@ -9,6 +9,12 @@ if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
|||
throw new Error();
|
||||
}
|
||||
|
||||
let remote = localStorage.getItem("homeserverURL")
|
||||
if (remote == null) {
|
||||
localStorage.setItem("homeserverURL", "https://notes.hectabit.org")
|
||||
remote = "https://notes.hectabit.org"
|
||||
}
|
||||
|
||||
let usernameBox = document.getElementById("usernameBox")
|
||||
let passwordBox = document.getElementById("passwordBox")
|
||||
let statusBox = document.getElementById("statusBox")
|
||||
|
@ -65,6 +71,10 @@ function showElements(yesorno) {
|
|||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById("homeserver").innerText = "Your homeserver is: " + remote + ". "
|
||||
});
|
||||
|
||||
signupButton.addEventListener("click", (event) => {
|
||||
if (passwordBox.classList.contains("hidden")) {
|
||||
if (usernameBox.value == "") {
|
||||
|
@ -109,7 +119,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
return key
|
||||
};
|
||||
|
||||
fetch("https://notes.hectabit.org/api/login", {
|
||||
fetch(remote + "/api/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
@ -133,7 +143,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
}
|
||||
else if (response.status == 401) {
|
||||
console.log("Trying oldhash")
|
||||
fetch("https://notes.hectabit.org/api/login", {
|
||||
fetch(remote + "/api/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
|
|
@ -13,6 +13,12 @@ if (localStorage.getItem("CACHE-username") !== null) {
|
|||
document.getElementById("usernameBox").innerText = localStorage.getItem("CACHE-username")
|
||||
}
|
||||
|
||||
let remote = localStorage.getItem("homeserverURL")
|
||||
if (remote == null) {
|
||||
localStorage.setItem("homeserverURL", "https://notes.hectabit.org")
|
||||
remote = "https://notes.hectabit.org"
|
||||
}
|
||||
|
||||
function formatBytes(a, b = 2) { if (!+a) return "0 Bytes"; const c = 0 > b ? 0 : b, d = Math.floor(Math.log(a) / Math.log(1000)); return `${parseFloat((a / Math.pow(1000, d)).toFixed(c))} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d]}` }
|
||||
|
||||
function truncateString(str, num) {
|
||||
|
@ -196,8 +202,17 @@ textMinusBox.addEventListener("click", (event) => {
|
|||
});
|
||||
|
||||
|
||||
function truncateString(str, num) {
|
||||
if (str.length > num) {
|
||||
return str.slice(0, num) + "..";
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateUserInfo() {
|
||||
fetch("https://notes.hectabit.org/api/userinfo", {
|
||||
fetch(remote + "/api/userinfo", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -248,7 +263,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("https://notes.hectabit.org/api/deleteaccount", {
|
||||
fetch(remote + "/api/deleteaccount", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -257,7 +272,6 @@ deleteMyAccountButton.addEventListener("click", (event) => {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
if (response.status == 200) {
|
||||
window.location.href = "../logout/index.html"
|
||||
|
@ -271,7 +285,7 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
optionsDiv.classList.add("hidden")
|
||||
sessionManagerDiv.classList.remove("hidden")
|
||||
|
||||
fetch("https://notes.hectabit.org/api/sessions/list", {
|
||||
fetch(remote + "/api/sessions/list", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -280,7 +294,6 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
async function doStuff() {
|
||||
let responseData = await response.json()
|
||||
|
@ -292,9 +305,9 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
let sessionRemoveButton = document.createElement("button")
|
||||
sessionText.classList.add("w300")
|
||||
if (responseData[i]["thisSession"] == true) {
|
||||
sessionText.innerText = "(current) " + truncateString(responseData[i]["device"], 18)
|
||||
sessionText.innerText = "(current) " + responseData[i]["device"]
|
||||
} else {
|
||||
sessionText.innerText = truncateString(responseData[i]["device"], 27)
|
||||
sessionText.innerText = responseData[i]["device"]
|
||||
}
|
||||
sessionText.title = responseData[i]["device"]
|
||||
sessionRemoveButton.innerText = "x"
|
||||
|
@ -311,7 +324,7 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
}
|
||||
|
||||
sessionRemoveButton.addEventListener("click", (event) => {
|
||||
fetch("https://notes.hectabit.org/api/sessions/remove", {
|
||||
fetch(remote + "/api/sessions/remove", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -321,7 +334,6 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
if (responseData[i]["thisSession"] == true) {
|
||||
window.location.replace("../logout/index.html")
|
||||
|
@ -362,7 +374,7 @@ function selectNote(nameithink) {
|
|||
let thingArray = Array.from(document.querySelectorAll(".noteButton")).find(el => el.id == nameithink);
|
||||
thingArray.classList.add("selected")
|
||||
|
||||
fetch("https://notes.hectabit.org/api/readnote", {
|
||||
fetch(remote + "/api/readnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -378,7 +390,6 @@ function selectNote(nameithink) {
|
|||
noteBox.placeholder = ""
|
||||
displayError("Something went wrong... Please try again later!")
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
selectedNote = nameithink
|
||||
noteBox.readOnly = false
|
||||
|
@ -397,21 +408,28 @@ function selectNote(nameithink) {
|
|||
updateWordCount()
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
let encryptedTitle = "New note"
|
||||
if (noteBox.value.substring(0, noteBox.value.indexOf("\n")) != "") {
|
||||
let firstTitle = noteBox.value.substring(0, noteBox.value.indexOf("\n"));
|
||||
|
||||
document.getElementById(nameithink).innerText = firstTitle
|
||||
encryptedTitle = CryptoJS.AES.encrypt(firstTitle, password).toString();
|
||||
}
|
||||
let encryptedText = CryptoJS.AES.encrypt(noteBox.value, password).toString();
|
||||
|
||||
if (selectedNote == nameithink) {
|
||||
fetch("https://notes.hectabit.org/api/editnote", {
|
||||
fetch(remote + "/api/editnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
noteId: nameithink,
|
||||
content: encryptedText,
|
||||
title: encryptedTitle
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
if (response.status == 418) {
|
||||
displayError("You've ran out of storage... Changes will not be saved until you free up storage!")
|
||||
|
@ -429,7 +447,7 @@ function selectNote(nameithink) {
|
|||
}
|
||||
|
||||
function updateNotes() {
|
||||
fetch("https://notes.hectabit.org/api/listnotes", {
|
||||
fetch(remote + "/api/listnotes", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -438,7 +456,6 @@ function updateNotes() {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
async function doStuff() {
|
||||
document.querySelectorAll(".noteButton").forEach((el) => el.remove());
|
||||
|
@ -459,11 +476,11 @@ function updateNotes() {
|
|||
let originalTitle = bytes.toString(CryptoJS.enc.Utf8);
|
||||
|
||||
noteButton.id = responseData[i]["id"]
|
||||
noteButton.innerText = originalTitle
|
||||
noteButton.innerText = truncateString(originalTitle, 15)
|
||||
|
||||
noteButton.addEventListener("click", (event) => {
|
||||
if (event.ctrlKey) {
|
||||
fetch("https://notes.hectabit.org/api/removenote", {
|
||||
fetch(remote + "/api/removenote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -473,7 +490,6 @@ function updateNotes() {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
updateNotes()
|
||||
})
|
||||
|
@ -494,16 +510,9 @@ function updateNotes() {
|
|||
updateNotes()
|
||||
|
||||
newNote.addEventListener("click", (event) => {
|
||||
let noteName = displayPrompt("Note name?", "E.G Shopping list", burgerFunction)
|
||||
function burgerFunction(noteName) {
|
||||
if (noteName != null) {
|
||||
if (noteName.length > 21) {
|
||||
displayError("Invalid note name: Too long (max 21 characters)");
|
||||
return;
|
||||
}
|
||||
|
||||
let noteName = "New note"
|
||||
let encryptedName = CryptoJS.AES.encrypt(noteName, password).toString();
|
||||
fetch("https://notes.hectabit.org/api/newnote", {
|
||||
fetch(remote + "/api/newnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -524,8 +533,6 @@ newNote.addEventListener("click", (event) => {
|
|||
updateNotes()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
function downloadObjectAsJson(exportObj, exportName) {
|
||||
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
|
||||
|
@ -539,7 +546,7 @@ function downloadObjectAsJson(exportObj, exportName) {
|
|||
|
||||
function exportNotes() {
|
||||
let noteExport = []
|
||||
fetch("https://notes.hectabit.org/api/exportnotes", {
|
||||
fetch(remote + "/api/exportnotes", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -548,7 +555,6 @@ function exportNotes() {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
async function doStuff() {
|
||||
let responseData = await response.json()
|
||||
|
@ -588,6 +594,16 @@ function isFirstTimeVisitor() {
|
|||
}
|
||||
}
|
||||
|
||||
function firstNewVersion() {
|
||||
if (document.cookie.indexOf("version=1.2") !== -1) {
|
||||
return false;
|
||||
} else {
|
||||
var expirationDate = new Date();
|
||||
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
||||
document.cookie = "version=1.2; expires=" + expirationDate.toUTCString() + "; path=/; SameSite=strict";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
exportNotesButton.addEventListener("click", (event) => {
|
||||
exportNotesButton.innerText = "Downloading..."
|
||||
|
@ -598,7 +614,7 @@ removeBox.addEventListener("click", (event) => {
|
|||
if (selectedNote == 0) {
|
||||
displayError("You need to select a note first!")
|
||||
} else {
|
||||
fetch("https://notes.hectabit.org/api/removenote", {
|
||||
fetch(remote + "/api/removenote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -608,7 +624,6 @@ removeBox.addEventListener("click", (event) => {
|
|||
"Content-Type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
.then((response) => response)
|
||||
.then((response) => {
|
||||
updateNotes()
|
||||
})
|
||||
|
@ -621,3 +636,7 @@ removeBox.addEventListener("click", (event) => {
|
|||
if (isFirstTimeVisitor() && /Android|iPhone|iPod/i.test(navigator.userAgent)) {
|
||||
displayError("To use Burgernotes:\n Swipe Right on a note to open it\n Swipe left in the text boxes to return to notes\n Click on a note to highlight it")
|
||||
}
|
||||
|
||||
if (firstNewVersion()) {
|
||||
displayError("What's new in Burgernotes 1.2?\n\nNote titles are now the first line of a note \(will not break compatibility with older notes\)\nIntroduced improved login screen\nNote titles now scroll correctly")
|
||||
}
|
||||
|
|
|
@ -9,6 +9,12 @@ if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
|||
throw new Error();
|
||||
}
|
||||
|
||||
let remote = localStorage.getItem("homeserverURL")
|
||||
if (remote == null) {
|
||||
localStorage.setItem("homeserverURL", "https://notes.hectabit.org")
|
||||
remote = "https://notes.hectabit.org"
|
||||
}
|
||||
|
||||
let usernameBox = document.getElementById("usernameBox")
|
||||
let passwordBox = document.getElementById("passwordBox")
|
||||
let statusBox = document.getElementById("statusBox")
|
||||
|
@ -27,6 +33,10 @@ function showElements(yesorno) {
|
|||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById("homeserver").innerText = "Your homeserver is: " + remote + ". "
|
||||
});
|
||||
|
||||
signupButton.addEventListener("click", (event) => {
|
||||
async function doStuff() {
|
||||
let username = usernameBox.value
|
||||
|
@ -61,7 +71,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
};
|
||||
|
||||
|
||||
fetch("https://notes.hectabit.org/api/signup", {
|
||||
fetch(remote + "/api/signup", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<svg width="527" height="533" viewBox="0 0 527 533" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_6_27)">
|
||||
<path d="M451 352.333C451 375.896 431.896 395 408.333 395H152.333C128.771 395 109.667 375.896 109.667 352.333V142.339C109.667 118.776 171.437 75 195 75H393.667C426.669 75 451 99.6613 451 132.333V352.333Z" fill="#226699"/>
|
||||
<path d="M429.667 395C429.667 418.563 410.563 437.667 387 437.667H173.667C150.104 437.667 131 418.563 131 395V139C131 95.064 130.776 96.3333 184.333 96.3333H387C410.563 96.3333 429.667 115.437 429.667 139V395Z" fill="url(#paint0_linear_6_27)"/>
|
||||
<path d="M408.333 405.667C408.333 423.341 394.008 437.667 376.333 437.667H141.667C123.992 437.667 109.667 423.341 109.667 405.667V149.667C109.667 131.992 123.992 117.667 141.667 117.667H376.333C394.008 117.667 408.333 131.992 408.333 149.667V405.667Z" fill="#E1E8ED"/>
|
||||
<path d="M158.115 426.776C158.115 434.264 151 440.333 142.221 440.333C133.453 440.333 126.339 434.264 126.339 426.776C126.339 419.299 133.453 413.219 142.221 413.219C151 413.219 158.115 419.288 158.115 426.776Z" fill="#662113"/>
|
||||
<path d="M140.536 419.224C135.416 419.811 132.088 423.224 129.688 427C126.413 432.173 118.947 437.667 109.667 437.667C97.8906 437.667 88.3333 430.509 88.3333 421.667C88.3333 412.824 97.8906 405.667 109.667 405.667V384.376C86.552 384.6 67.8853 401.176 67.8853 421.667C67.8853 442.296 86.7866 459 110.104 459C129.88 459 145.805 447.853 151.715 431.597C154.669 423.501 146.712 418.541 140.536 419.224Z" fill="url(#paint1_linear_6_27)"/>
|
||||
<path d="M158.115 341.443C158.115 348.931 151 355 142.221 355C133.453 355 126.339 348.931 126.339 341.443C126.339 333.965 133.453 327.885 142.221 327.885C151 327.885 158.115 333.955 158.115 341.443Z" fill="#662113"/>
|
||||
<path d="M140.536 333.891C135.416 334.477 132.088 337.891 129.688 341.667C126.413 346.84 118.947 352.333 109.667 352.333C97.8906 352.333 88.3333 345.176 88.3333 336.333C88.3333 327.491 97.8906 320.333 109.667 320.333V299.043C86.552 299.267 67.8853 315.843 67.8853 336.333C67.8853 356.963 86.7866 373.667 110.104 373.667C129.88 373.667 145.805 362.52 151.715 346.264C154.669 338.168 146.712 333.208 140.536 333.891Z" fill="url(#paint2_linear_6_27)"/>
|
||||
<path d="M158.115 256.109C158.115 263.597 151 269.667 142.221 269.667C133.453 269.667 126.339 263.597 126.339 256.109C126.339 248.632 133.453 242.552 142.221 242.552C151 242.552 158.115 248.621 158.115 256.109Z" fill="#662113"/>
|
||||
<path d="M140.536 248.557C135.416 249.144 132.088 252.557 129.688 256.333C126.413 261.507 118.947 267 109.667 267C97.8906 267 88.3333 259.843 88.3333 251C88.3333 242.157 97.8906 235 109.667 235V213.709C86.552 213.933 67.8853 230.509 67.8853 251C67.8853 271.629 86.7866 288.333 110.104 288.333C129.88 288.333 145.805 277.187 151.715 260.931C154.669 252.835 146.712 247.875 140.536 248.557Z" fill="url(#paint3_linear_6_27)"/>
|
||||
<path d="M158.115 170.776C158.115 178.264 151 184.333 142.221 184.333C133.453 184.333 126.339 178.264 126.339 170.776C126.339 163.299 133.453 157.219 142.221 157.219C151 157.219 158.115 163.288 158.115 170.776Z" fill="#662113"/>
|
||||
<path d="M140.536 163.224C135.416 163.811 132.088 167.224 129.688 171C126.413 176.173 118.947 181.667 109.667 181.667C97.8906 181.667 88.3333 174.509 88.3333 165.667C88.3333 156.824 97.8906 149.667 109.667 149.667V128.376C86.5626 128.589 67.8853 145.176 67.8853 165.667C67.8853 186.296 86.7866 203 110.104 203C129.88 203 145.805 191.853 151.715 175.597C154.669 167.501 146.712 162.541 140.536 163.224Z" fill="url(#paint4_linear_6_27)"/>
|
||||
<path d="M281 300.771C192.496 300.771 120.756 298.646 120.756 361.47C120.756 424.266 192.496 438.556 281 438.556C369.504 438.556 441.244 424.266 441.244 361.47C441.244 298.655 369.504 300.771 281 300.771Z" fill="#D99E82"/>
|
||||
<path d="M436.55 305.54C436.55 305.54 358.926 296.247 281 295.85C203.074 296.247 125.45 305.54 125.45 305.54C117.772 366.683 181.522 391.872 281 391.872C380.478 391.872 444.228 366.683 436.55 305.54Z" fill="#662113"/>
|
||||
<path d="M431.035 281.098L130.182 287.199C119.793 287.199 111.095 308.251 122.116 313.757C204.358 339.332 270.47 365.21 270.47 365.21C279.555 370.234 282.625 370.253 291.72 365.238C291.72 365.238 383.009 328.707 441.65 313.36C449.971 311.188 441.414 281.098 431.035 281.098Z" fill="#FFCC4D"/>
|
||||
<path d="M438.958 281.891C421.014 265.354 422.053 274.156 408.302 270.274C403.079 268.801 365.707 220.493 280.528 220.493H280.339C195.159 220.493 157.788 268.801 152.565 270.274C138.814 274.156 139.853 265.354 121.908 281.891C113.673 289.484 111.444 293.432 120.133 295.397C133.223 298.353 132.033 306.277 141.411 309.034C152.763 312.368 157.429 306.277 175.732 308.77C191.344 310.895 192.364 331.144 208.117 331.144C223.871 331.144 223.871 323.588 239.614 323.588C255.358 323.588 264.671 343.856 280.424 343.856C296.177 343.856 305.48 323.588 321.233 323.588C336.987 323.588 336.987 331.144 352.731 331.144C368.484 331.144 369.504 310.895 385.116 308.77C403.419 306.286 408.094 312.368 419.437 309.034C428.815 306.277 427.625 298.362 440.715 295.397C449.423 293.442 447.203 289.484 438.958 281.891Z" fill="#77B255"/>
|
||||
<path d="M432.838 264.022C432.838 292.204 364.857 305.512 281 305.512C197.143 305.512 129.162 292.204 129.162 264.022C129.162 212.994 138.285 212.994 281 212.994C423.715 212.994 432.838 213.003 432.838 264.022Z" fill="#DD2E44"/>
|
||||
<path d="M281 112.949C192.496 112.949 120.756 154.419 120.756 217.234C120.756 275.082 192.496 277.443 281 277.443C369.504 277.443 441.244 275.082 441.244 217.234C441.244 154.41 369.504 112.949 281 112.949Z" fill="#D99E82"/>
|
||||
<path d="M212.849 142.897C208.146 139.884 201.903 141.263 198.899 145.967C195.896 150.67 197.266 156.922 201.969 159.916C206.672 162.929 218.591 165.177 221.604 160.473C224.607 155.77 217.552 145.901 212.849 142.897ZM304.781 133.122C299.473 134.841 290.152 142.623 291.88 147.931C293.608 153.239 305.707 154.051 311.014 152.332C316.322 150.613 319.222 144.909 317.493 139.601C315.774 134.303 310.07 131.394 304.781 133.122ZM407.811 199.564C403.542 195.975 392.841 201.689 389.243 205.958C385.654 210.236 386.211 216.602 390.48 220.191C394.749 223.779 401.124 223.222 404.713 218.953C408.311 214.675 412.089 203.153 407.811 199.564ZM373.404 152.342C368.701 149.338 362.458 150.717 359.446 155.421C356.442 160.124 357.821 166.367 362.524 169.37C367.228 172.383 379.147 174.631 382.15 169.927C385.163 165.214 378.108 155.345 373.404 152.342ZM231.738 218.453C227.034 215.449 220.792 216.828 217.779 221.532C214.776 226.226 216.154 232.478 220.858 235.472C225.561 238.484 237.48 240.742 240.483 236.029C243.496 231.326 236.441 221.456 231.738 218.453ZM260.506 173.044C257.332 177.634 254.65 189.468 259.249 192.641C263.839 195.814 273.954 189.109 277.128 184.519C280.301 179.929 279.139 173.639 274.549 170.466C269.969 167.292 263.669 168.454 260.506 173.044ZM335.627 218.453C330.923 215.449 324.681 216.828 321.668 221.532C318.664 226.226 320.043 232.487 324.747 235.472C329.45 238.484 341.369 240.742 344.372 236.029C347.385 231.326 340.33 221.456 335.627 218.453ZM157.731 181.742C154.01 185.907 149.864 197.307 154.029 201.028C158.175 204.749 169.055 199.384 172.776 195.219C176.507 191.064 176.148 184.679 171.992 180.949C167.846 177.228 161.452 177.587 157.731 181.742Z" fill="#FFE8B6"/>
|
||||
</g>
|
||||
<path d="M408.333 416.333C408.333 439.896 389.229 459 365.667 459H163C139.437 459 120.333 439.896 120.333 416.333V181.667C120.333 158.104 139.437 139 163 139H365.667C389.229 139 408.333 158.104 408.333 181.667V416.333Z" fill="#3B88C3"/>
|
||||
<path d="M387 416.333C387 439.896 367.896 459 344.333 459H163C139.437 459 120.333 439.896 120.333 416.333V203C120.333 179.437 139.437 160.333 163 160.333H347.907C371.469 160.333 387 175.864 387 199.427V416.333Z" fill="url(#paint5_linear_6_27)"/>
|
||||
<path d="M163 139C144.995 139 144.536 118.499 152.333 109.667C161.208 99.6293 175 96.3333 199.672 96.3333H216.333V75H187.331C144.995 75 109.667 101.667 109.667 132.333V416.333C109.667 439.896 128.771 459 152.333 459H173.667V139H163Z" fill="#226699"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_6_27" x1="280.333" y1="96.3295" x2="280.333" y2="437.667" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#CCD6DD"/>
|
||||
<stop offset="1" stop-color="#CCD6DD" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_6_27" x1="110.118" y1="384.376" x2="110.118" y2="459" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#66757F"/>
|
||||
<stop offset="1" stop-color="#50585C"/>
|
||||
<stop offset="1" stop-color="#50585C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_6_27" x1="110.118" y1="299.043" x2="110.118" y2="373.667" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#66757F"/>
|
||||
<stop offset="1" stop-color="#50585C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_6_27" x1="110.118" y1="213.709" x2="110.118" y2="288.333" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#66757F"/>
|
||||
<stop offset="1" stop-color="#50585C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_6_27" x1="110.118" y1="128.376" x2="110.118" y2="203" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#66757F"/>
|
||||
<stop offset="1" stop-color="#50585C"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_6_27" x1="253.667" y1="160.333" x2="253.667" y2="459" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#55ACEE"/>
|
||||
<stop offset="1" stop-color="#55ACEE" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_6_27">
|
||||
<rect width="384" height="384" fill="white" transform="translate(67 75)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 9.2 KiB |
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 244 KiB |
Reference in New Issue