fix admin.js

This commit is contained in:
posativ 2012-10-27 22:11:40 +02:00
parent 5d15ab0ea3
commit 23232d4f0e
2 changed files with 5 additions and 26 deletions

View File

@ -1,26 +1,4 @@
function remove(path, id, func) {
$.ajax({
url: '/1.0/' + encodeURIComponent(path) + '/' + id,
method: 'DELETE',
type: 'json',
error: function(resp) {
alert('Mööp.');
},
success: function(resp) {
func();
},
});
};
// function approve(path, id, func) {
// $.ajax({
// url: ''
// })
// }
function initialize() { function initialize() {
$('article > footer > a').forEach(function(item) { $('article > footer > a').forEach(function(item) {
@ -35,9 +13,10 @@ function initialize() {
}); });
} else { } else {
$(item).on('click', function(event) { $(item).on('click', function(event) {
if (confirm("RLY?") == true) { if (confirm("RLY?") == true) {
remove(path, id, function() { $.ajax('DELETE', '/1.0/' + encodeURIComponent(path) + '/' + id).then(
$(node).remove() function() {
$(node).remove()
}); });
}; };
event.stop(); event.stop();

View File

@ -2,7 +2,7 @@
<head> <head>
<title><%block name="title" /></title> <title><%block name="title" /></title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<script type="text/javascript" src="/static/ender.js"></script> <script type="text/javascript" src="/js/ender.js"></script>
<script type="text/javascript"> <script type="text/javascript">
<%block name="js" /> <%block name="js" />
</script> </script>