/edit page implemented
This commit is contained in:
@@ -15,11 +15,12 @@
|
||||
<article id="preview" style="flex: none; -webkit-flex: none"></article>
|
||||
<div class="hidden" id="dashed-line"></div>
|
||||
<div class="central-element helvetica" style="margin-bottom: 3em">
|
||||
<form action="/note" autocomplete="off" method="%METHOD%">
|
||||
<form action="/note" autocomplete="off" method="POST">
|
||||
<input id="action" value="%METHOD%" type="hidden">
|
||||
<input id="password" name="password" type="hidden">
|
||||
<input id="session" name="session" type="hidden" value="%SESSION%" />
|
||||
<input id="signature" name="signature" type="hidden" />
|
||||
<textarea id="note" name="note">Loading...</textarea>
|
||||
<textarea id="note" name="note">%CONTENT%</textarea>
|
||||
<fieldset class="hidden" id="input-elems">
|
||||
<input class="ui-elem" id="plain-password" name="plain-password" placeholder="Password for editing" type="text">
|
||||
<input class="button ui-elem" id="publish-button" type="submit" value="Publish">
|
||||
@@ -16,7 +16,7 @@ function md2html(input) {
|
||||
|
||||
function onLoad() {
|
||||
$note = $("note");
|
||||
$action = document.getElementsByTagName("form")[0].method;
|
||||
$action = $("action").value;
|
||||
$preview = $("preview");
|
||||
$plain_password = $("plain-password");
|
||||
$proposed_title = $("proposed-title");
|
||||
@@ -32,7 +32,7 @@ function onLoad() {
|
||||
$preview.innerHTML = md2html(content);
|
||||
}, delay);
|
||||
};
|
||||
if ($action.value == "update") updatePreview();
|
||||
if ($action == "UPDATE") updatePreview();
|
||||
else $note.value = "";
|
||||
$note.onkeyup = updatePreview;
|
||||
$("publish-button").onclick = function(e) {
|
||||
|
||||
Reference in New Issue
Block a user