deletions: easy delete button on page editor

This commit is contained in:
mappu 2018-04-02 17:39:34 +12:00
parent 6c70f37ef8
commit 6a56a4b1b2

View File

@ -67,6 +67,16 @@ func (this *WikiServer) routeModify(w http.ResponseWriter, r *http.Request, arti
}
content += `
|
<a href="javascript:;" id="delete-page">delete</a>
<script type="text/javascript">
document.getElementById("delete-page").addEventListener("click", function() {
if (confirm('Are you sure you want to delete this page?\nThe history will be preserved.')) {
document.getElementsByName("content")[0].value = '[delete]';
document.getElementById("form-edit-page").submit();
}
});
</script>
</div>
<div id="contentctr"><textarea name="content">` + template.HTMLEscapeString(existingBody) + `</textarea></div>
</form>