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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user