summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--public/js/index.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index b139ad2a..63d7f3db 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -740,7 +740,8 @@ var ui = {
editable: $(".ui-permission-editable"),
locked: $(".ui-permission-locked"),
private: $(".ui-permission-private")
- }
+ },
+ delete: $(".ui-delete-note")
},
toc: {
toc: $('.ui-toc'),
@@ -2115,6 +2116,13 @@ ui.infobar.permission.locked.click(function () {
ui.infobar.permission.private.click(function () {
emitPermission("private");
});
+// delete note
+ui.infobar.delete.click(function () {
+ $('.delete-modal').modal('show');
+});
+$('.ui-delete-modal-confirm').click(function () {
+ socket.emit('delete');
+});
function emitPermission(_permission) {
if (_permission != permission) {
@@ -2216,6 +2224,11 @@ socket.on('error', function (data) {
if (data.message && data.message.indexOf('AUTH failed') === 0)
location.href = serverurl + "/403";
});
+socket.on('delete', function () {
+ deleteServerHistory(noteid, function (err, data) {
+ if (!err) location.href = serverurl;
+ });
+});
var retryOnDisconnect = false;
var retryTimer = null;
socket.on('maintenance', function () {