From: <var...@us...> - 2022-01-14 11:44:46
|
Revision: 10898 http://sourceforge.net/p/phpwiki/code/10898 Author: vargenau Date: 2022-01-14 11:44:43 +0000 (Fri, 14 Jan 2022) Log Message: ----------- Warn user that leaving the page will lose modifications Modified Paths: -------------- trunk/themes/default/templates/editpage.tmpl Modified: trunk/themes/default/templates/editpage.tmpl =================================================================== --- trunk/themes/default/templates/editpage.tmpl 2022-01-13 17:42:53 UTC (rev 10897) +++ trunk/themes/default/templates/editpage.tmpl 2022-01-14 11:44:43 UTC (rev 10898) @@ -16,6 +16,24 @@ <?php echo _("Saving this page will overwrite the current version.") ?> </p> <?php } ?> +<script type="text/javascript"> +<!--// +$(document).ready(function() { + wiki_modified=0; + $('form *').change(function(){ + wiki_modified=1; + }); + window.onbeforeunload = confirmExit; + function confirmExit() { + if (wiki_modified == 1) { + return "Warning: leaving the page will lose all your modifications!"; + } + } + $("input[name='edit[save]'],input[name='edit[preview]'],input[name='edit[diff]']").click(function() { + wiki_modified=0; + }); +}); +// --></script> <form method="post" id="editpage" name="editpage" action="<?php echo $request->getPostURL() ?>" accept-charset="UTF-8"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |