Browse Source

Warn before navigating away from unfinished posts

tags/0.3.0
Lal'C Mellk Mal 7 years ago
parent
commit
b72be15e0f
2 changed files with 5 additions and 1 deletions
  1. +0
    -1
      TODO
  2. +5
    -0
      client/posting.js

+ 0
- 1
TODO View File

@@ -1,6 +1,5 @@
* Update `syncs` in client when on /live
* Actually tell user when a particular thread failed to sync
* Tokenize text instead of multiple levels of regexps
* When navigating away from a page, commit any outstanding text
* Should retrieve live body and hctr in one transaction
* Consolidate or disambiguate the (three!) different hook/trigger mechanisms

+ 5
- 0
client/posting.js View File

@@ -245,6 +245,10 @@ on_allocation: function (msg) {
this.resize_input();
this.input.focus();
}

window.onbeforeunload = function () {
return "You have an unfinished post.";
};
},

on_image_alloc: function (msg) {
@@ -558,6 +562,7 @@ remove: function () {
this.$iframe = null;
}
this.stopListening();
window.onbeforeunload = null;
},

render_buttons: function () {


Loading…
Cancel
Save