Add unload confirmation on live preview, edit, and create.

This commit is contained in:
bootstraponline
2012-05-21 10:27:16 -06:00
parent 484629734e
commit aa7e01a085
3 changed files with 6 additions and 2 deletions
@@ -1,4 +1,6 @@
(function () {
window.onbeforeunload = function(){ return "Leaving Live Preview will discard all edits!" };
var converter = Markdown.getSanitizingConverter();
var editor = ace.edit("editor");
var editorSession = editor.getSession();
@@ -9,9 +9,10 @@
</div>
</div>
<script type="text/javascript">
window.onbeforeunload = function(){ return "Leaving will not create a new page!" };
jQuery(document).ready(function() {
$.GollumEditor({ NewFile: true, MarkupType: '{{default_markup}}' });
});
</script>
{{something}}
{{something}}
+2 -1
View File
@@ -11,7 +11,8 @@
<div id="wiki-content">{{>editor}}</div>
</div>
<script type="text/javascript">
window.onbeforeunload = function(){ return "Leaving will discard all edits!" };
jQuery(document).ready(function() {
$.GollumEditor();
});
</script>
</script>