Browse Source

form page 50%

master
RENOX 5 months ago
parent
commit
6c25d9239b
3 changed files with 76 additions and 23 deletions
  1. +0
    -4
      src/main/resources/static/css/style.css
  2. +55
    -12
      src/main/resources/static/index.html
  3. +21
    -7
      src/main/resources/static/js/post.js

+ 0
- 4
src/main/resources/static/css/style.css View File

@@ -52,10 +52,6 @@ body
margin-top: 33%;
}

#label-name
{

}

/* filmgrain.js dep */
#canvas


+ 55
- 12
src/main/resources/static/index.html View File

@@ -14,10 +14,6 @@
crossorigin="anonymous"></script>
<script>src = "/webjars/Semantic-UI/2.4.1/semantic.min.js"</script>

<!-- <link rel="stylesheet" href="/webjars/uikit/dist/css/uikit.min.css" />
<script src="webjars/uikit/dist/js/uikit.min.js"></script>
<script src="webjars/uikit/dist/js/uikit-icons.min.js"></script>-->

</head>

<body>
@@ -40,10 +36,10 @@
<a class="active item">
<span style="color: #007373; font-weight: bold;">Enter</span>
</a>
<a class="item">
<a class="item" onclick="initEmptyForm();">
<span style="color: #005151;">Create</span>
</a>
<a class="item">
<a class="item" onclick="initAboutPage();">
<span style="color: #005151;">About</span>
</a>
</div>
@@ -69,15 +65,62 @@
</div>


<!--
<div>
<textarea id="textarea" rows="4" cols="50"></textarea>
<br>
<input id="btn-save" type="button">
<!-- FORM PAGE -->

<div id="page-form-menu" class="ui inverted attached stackable menu" style="display: none; background-color: #0f2229">
<div class="ui container">

<a class="item">
<i class="save icon"></i> Save
</a>
<div class="ui simple dropdown item">
Settings
<i class="dropdown icon"></i>
<div class="menu">
<a class="item"><i class="key icon"></i> Change Password</a>
<a class="item"><i class="trash icon"></i> Delete</a>
</div></div>

<div class="right item">

<div class="ui input"><input type="text" placeholder="Name"></div>

<a class="ui item">
Logout
</a>
</div>
</div>
</div>
-->



<div id="page-form" class="ui container" style="display: none">
<!-- tab container -->
<div class="ui inverted top attached tabular menu">
<a class="active item">
Active Project
</a>
<a class="item" style="color: aliceblue; background-color: #005151;">
Project #2
</a>
<div class="right menu">
<a class="item">
<i class="add icon"></i> New Tab
</a>
</div>
</div>
<div class="ui bottom attached segment" style="background-color: #1b1c1d;">
<!-- tab segment -->
<div class="ui form">
<div class="field">
<textarea id="textarea" style="background-color: #1b1f23; color: ghostwhite"></textarea>
</div>
</div>
</div>


</div>

<script src="js/post.js"></script>
<script src="js/filmgrain.js"></script>
</body>


+ 21
- 7
src/main/resources/static/js/post.js View File

@@ -37,8 +37,7 @@ function loginEvent() {
xmlrequest.open("POST", "/");
xmlrequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xmlrequest.send("type=login&name=" + name + "&password=" + password);
xmlrequest.onload = function ()
{
xmlrequest.onload = function () {
console.log(xmlrequest.response); // not prod
loginResponseEvent(xmlrequest.response);
}
@@ -56,7 +55,7 @@ function btnSaveEvent() {
xmlrequest.send("name=" + name + "&password=" + password + "&text=" + text);
xmlrequest.onload = function () // not prod
{
console.log(xmlrequest.response)
console.log(xmlrequest.response) // not prod
}
}

@@ -114,9 +113,24 @@ function loginResponseEvent(response) {
label_password.textContent = "Incorrect.";
label_password.style.display = "initial";
} else if (responseJson.DOCUMENT_TYPE === "NEW_USER" || responseJson.DOCUMENT_TYPE === "DECRYPT_SUCCESS") {
console.log("da");
let div_logo = document.getElementById("div-logo");
div_logo.style.visibility = "hidden"; // display none or ??????
// WIP
initEmptyForm();
}
}


function initEmptyForm() {
let div_logo = document.getElementById("div-logo");
let div_login = document.getElementById("div-login-parent");
let page_form_menu = document.getElementById("page-form-menu");
let page_form = document.getElementById("page-form");
div_logo.style.display = "none";
div_login.style.display = "none";
document.getElementById("textarea").rows = window.innerHeight/24;
page_form_menu.style.display = "inherit";
page_form.style.display = "inherit";
}


function initAboutPage(){

}

Loading…
Cancel
Save