Add unload confirmation on live preview, edit, and create.
This commit is contained in:
@@ -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}}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user