From: Stefan Lage Date: Thu, 23 May 2013 23:48:18 +0000 (-0400) Subject: nitdoc: Add a secure when the user reload the page X-Git-Tag: v0.6~46^2~17 X-Git-Url: http://nitlanguage.org?ds=sidebyside nitdoc: Add a secure when the user reload the page If a the page is reloaded or quit when a comment is being edit, we ask if the customer really want to continue. signed-off by: Stefan Lage --- diff --git a/share/nitdoc/scripts/js-facilities.js b/share/nitdoc/scripts/js-facilities.js index 58cbddf..ccbfbb5 100644 --- a/share/nitdoc/scripts/js-facilities.js +++ b/share/nitdoc/scripts/js-facilities.js @@ -53,6 +53,12 @@ var currentTable = null; //Hightlighted index in search result preview table var currentIndex = -1; +// Check if a comment is editing +window.onbeforeunload = function() { + if(editComment > 0){ + return 'Are you sure you want to leave this page?'; + } +}; /* * Add folding and filtering facilities to class description page.