tazpanel rev 335
fix bug 45: ask confirmation during page load
author | border |
---|---|
date | Fri Dec 21 01:49:21 2012 -0500 (2012-12-21) |
parents | 954aa4dd7c9e |
children | 288c37594662 |
files | styles/default/footer.html styles/default/header.html |
line diff
1.1 --- a/styles/default/footer.html Thu Dec 20 10:21:27 2012 +0100 1.2 +++ b/styles/default/footer.html Fri Dec 21 01:49:21 2012 -0500 1.3 @@ -8,6 +8,9 @@ 1.4 - <a href="/index.cgi?file=/usr/share/licenses/bsd.txt">$(gettext 'BSD License')</a> 1.5 </div> 1.6 1.7 +<script type="text/javascript"> 1.8 + window.onbeforeunload = null; 1.9 +</script> 1.10 </body> 1.11 </html> 1.12 EOT
2.1 --- a/styles/default/header.html Thu Dec 20 10:21:27 2012 +0100 2.2 +++ b/styles/default/header.html Fri Dec 21 01:49:21 2012 -0500 2.3 @@ -11,6 +11,13 @@ 2.4 function showLoading(){ 2.5 document.getElementById("loading").style.display='none'; 2.6 } 2.7 + 2.8 + //Ask confirmation on close window during load time 2.9 + window.onbeforeunload = confirmExit; 2.10 + function confirmExit() 2.11 + { 2.12 + return 1; 2.13 + } 2.14 </script> 2.15 </head> 2.16 <body onload="showLoading()">