Browse Source

URI encoding

master
RENOX 4 months ago
parent
commit
f537265898
3 changed files with 33 additions and 3 deletions
  1. +13
    -1
      src/main/resources/static/css/style.css
  2. +14
    -0
      src/main/resources/static/index.html
  3. +6
    -2
      src/main/resources/static/js/main.js

+ 13
- 1
src/main/resources/static/css/style.css View File

@@ -10,7 +10,6 @@ body {
}

#name, #password {
font-family: Candara;
text-align: center;
background: transparent;
border-style: none;
@@ -43,6 +42,18 @@ body {
margin-top: 33%;
}

#about{
font-family: 'Open Sans', sans-serif;
Color: gray;
font-size: 14px;
background-color: rgb(0, 8, 13, .9);
}

#textarea{
font-family: 'Open Sans', sans-serif;
}

/* responsive tabs */
.wrapped{
display: flex;
flex-direction: row;
@@ -58,6 +69,7 @@ body {
z-index: -1;
}

/* placeholder color */
#textarea::-webkit-input-placeholder { /* Chrome */
color: black;
}


+ 14
- 0
src/main/resources/static/index.html View File

@@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="/webjars/Semantic-UI/2.4.1/semantic.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script>src = "/webjars/Semantic-UI/2.4.1/semantic.min.js"</script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
</head>

<body>
@@ -19,6 +20,19 @@
<img id="img-logo" src="imgs/logo.png" alt="logo">
</div>

<!-- <about-section> -->
<div id="about" class="ui text container" style="display: none;">
<p id='faq'>Designed with simplicity & security in mind, TextDungeon is an
<a href='https://git.planetrenox.com/textdungeon/web' target="_blank" rel="noopener">open source</a> project
which lets you store any amount of text for personal safe-keeping with only a name and password.
<br><br>All plain-text is encrypted with AES in combination of BCrypt used to generate the private key derived from
your password. This means even in the case that there's a leak, brute-forcing your password is a hopeless attempt depending on the password strength.
<br><br>Since the text can't be accessed without your password, this also means that in the case of legal
pressure we cannot harm you.
</div>
<!-- </about-section> -->


<!-- login -->
<div id="div-login-parent" class="ui center aligned container">
<div id="div-login" class="ui center aligned container basic segment">


+ 6
- 2
src/main/resources/static/js/main.js View File

@@ -143,8 +143,9 @@ function initLogout() {
}

function initAboutPage() {
document.getElementById("div-logo").style.display = "none";
//document.getElementById("div-logo").style.display = "none";
document.getElementById("div-login-parent").style.display = "none";
document.getElementById("about").style.display = "inherit";
}

function initPasswordReset() {
@@ -201,6 +202,8 @@ function loginLocalEvent(name, password) {
}

function saveLocalEvent(name, password, text, tabCount) {
password = encodeURIComponent(password);
text = encodeURIComponent(text);
let xmlrequest = new XMLHttpRequest();
xmlrequest.open("POST", "/");
xmlrequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
@@ -271,7 +274,8 @@ function populateFormLocalEvent(responseJson) {
document.getElementById("password-form").style.display = "none";
document.getElementById("btn-logout").style.display = "inherit";
document.getElementById("btn-settings").style.display = "inherit";
let entireTextArray = responseJson.DUNGEON.cleartext.split("|textdungeon-tab|");
// TODO NOT DECODING CORRECTLY
let entireTextArray = decodeURIComponent(responseJson.DUNGEON.cleartext).split("|textdungeon-tab|");
for (let i = 0; i < responseJson.DUNGEON.meta.TAB_COUNT; i++) {
if (i !== 0) initAddTab();
tabContent.set("tab" + (i + 1), entireTextArray[i]);


Loading…
Cancel
Save