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,6 +9,7 @@
|
||||
</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}}' });
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user