1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added feature for Issue #12

This commit is contained in:
Zack Scholl
2016-02-10 21:16:54 -05:00
parent ec605e1b8f
commit c95720fe54
3 changed files with 68 additions and 13 deletions

View File

@@ -10,7 +10,11 @@
<link rel="stylesheet" type="text/css" href="/static/css/katex.min.css">
<script src="/static/js/katex.min.js"></script>
<style>
a.deleteable {
cursor: pointer;
}
</style>
</head>
<body>
@@ -82,6 +86,25 @@ $(document).keydown(function(e){
}
});
{{ if .AdminKey }}
$('.deleteable').click(function(event) {
event.preventDefault();
var deleteName = $(this).attr('id')
var href = $(this).attr('href')
console.log(deleteName)
$.ajax({
url: "/deletepage" + '?' + $.param({
"DeleteName": deleteName,
"AdminKey": "{{ .AdminKey }}"
}),
type: 'DELETE',
success: function() {
window.location.reload(true);
}
});
});
{{ end }}
</script>
</body>