@@ -69,7 +73,8 @@
},
success: function (data) {
if (isEmpty(data)) {
- alert("empty!");
+ alert("Note已过期!");
+ window.location.href = "/";
return;
} else {
$("#delay").attr("leaf-id", data.leaf.id);
@@ -79,6 +84,7 @@
showLineNumber();
hljs.initHighlighting.called = false;
hljs.initHighlighting();
+ document.title = showId
}
}
})
@@ -93,6 +99,17 @@
}
})
});
+
+ $('#delete').on('click', function () {
+ if (confirm('确定要销毁吗?')) {
+ $.ajax({
+ url: "/delete/" + $('#delay').attr('leaf-id'),
+ success: function (data) {
+ window.location.href = "/";
+ }
+ });
+ }
+ });