@lexho111/plainblog 0.6.6 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Blog.js +4 -2
- package/Formatter.js +2 -2
- package/package.json +1 -1
- package/src/fetchData.js +0 -12
- package/src/styles.css +6 -1
package/Blog.js
CHANGED
|
@@ -403,8 +403,10 @@ export default class Blog {
|
|
|
403
403
|
<h1>Blog</h1>
|
|
404
404
|
<!-- Message container -->
|
|
405
405
|
<div id="statusMessage"></div>
|
|
406
|
-
|
|
407
|
-
<input type="
|
|
406
|
+
<label for="username">Username</label>
|
|
407
|
+
<input type="username" class="form_element" name="username" placeholder="username" required />
|
|
408
|
+
<label for="password">Password</label>
|
|
409
|
+
<input type="password" class="form_element" name="password" placeholder="password" required />
|
|
408
410
|
<button class="btn" type="submit">Login</button>
|
|
409
411
|
</form>
|
|
410
412
|
|
package/Formatter.js
CHANGED
|
@@ -26,7 +26,7 @@ export function formatHTML(data) {
|
|
|
26
26
|
const button = "";
|
|
27
27
|
let form1 = "";
|
|
28
28
|
if (data.loggedin) {
|
|
29
|
-
form1 = `<form action="/" method="POST">
|
|
29
|
+
form1 = `<form id="createNew" action="/" method="POST">
|
|
30
30
|
<h3>Add a New Article</h3>
|
|
31
31
|
<input type="text" id="title" class="form_element new_title wide" name="title" placeholder="Article Title" required>
|
|
32
32
|
<textarea id="content" class="form_element new_content wide" name="content" placeholder="Article Content" required></textarea>
|
|
@@ -34,7 +34,7 @@ export function formatHTML(data) {
|
|
|
34
34
|
</form>
|
|
35
35
|
<hr>`;
|
|
36
36
|
}
|
|
37
|
-
const form =
|
|
37
|
+
const form = form1;
|
|
38
38
|
return `${header(data.title)}
|
|
39
39
|
<body>
|
|
40
40
|
<nav>
|
package/package.json
CHANGED
package/src/fetchData.js
CHANGED
|
@@ -191,19 +191,7 @@ function fillWithContent(title, content, date, id, targetContainer) {
|
|
|
191
191
|
const loggedin = document.querySelector('a[href="/logout"]') !== null;
|
|
192
192
|
if (loggedin) {
|
|
193
193
|
const buttons = document.createElement("div");
|
|
194
|
-
const editButton = document.createElement("div");
|
|
195
|
-
const deleteButton = document.createElement("div");
|
|
196
|
-
const somethingButton = document.createElement("div");
|
|
197
194
|
buttons.setAttribute("class", "buttons");
|
|
198
|
-
editButton.setAttribute("class", "btn edit");
|
|
199
|
-
deleteButton.setAttribute("class", "btn delete");
|
|
200
|
-
somethingButton.setAttribute("class", "btn light");
|
|
201
|
-
editButton.textContent = "edit";
|
|
202
|
-
deleteButton.textContent = "delete";
|
|
203
|
-
somethingButton.textContent = "something else";
|
|
204
|
-
buttons.appendChild(editButton);
|
|
205
|
-
buttons.appendChild(deleteButton);
|
|
206
|
-
buttons.appendChild(somethingButton);
|
|
207
195
|
|
|
208
196
|
const actions = [
|
|
209
197
|
{ label: "edit", type: "edit", class: "btn edit" },
|
package/src/styles.css
CHANGED