mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 23:19:43 +00:00
Add an exit confirm dialog
This commit is contained in:
@@ -40,7 +40,7 @@ body
|
||||
|
||||
/* Pop ups */
|
||||
.hidden
|
||||
display: none
|
||||
display: none !important
|
||||
|
||||
#popup
|
||||
position: fixed
|
||||
|
||||
@@ -77,6 +77,12 @@
|
||||
return e.preventDefault();
|
||||
});
|
||||
|
||||
addEventListener('beforeunload', function(e) {
|
||||
if (!(butterfly.body.classList.contains('dead') || location.href.indexOf('session') > -1)) {
|
||||
return e.returnValue = 'This terminal is active and not in session. Are you sure you want to kill it?';
|
||||
}
|
||||
});
|
||||
|
||||
Popup = (function() {
|
||||
function Popup() {
|
||||
this.el = document.getElementById('popup');
|
||||
@@ -506,7 +512,7 @@
|
||||
if (theme === 'default') {
|
||||
url = "/static/main.css";
|
||||
} else {
|
||||
url = "theme/" + theme + "/style.css";
|
||||
url = "/theme/" + theme + "/style.css";
|
||||
}
|
||||
inner += '<option ';
|
||||
if (_theme === url) {
|
||||
|
||||
2
butterfly/static/ext.min.js
vendored
2
butterfly/static/ext.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -3058,7 +3058,7 @@ body {
|
||||
body::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.15); }
|
||||
body .hidden {
|
||||
display: none; }
|
||||
display: none !important; }
|
||||
body #popup {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
|
||||
5
coffees/ext/close_confirm.coffee
Normal file
5
coffees/ext/close_confirm.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
addEventListener 'beforeunload', (e) ->
|
||||
unless (butterfly.body.classList.contains('dead') or
|
||||
location.href.indexOf('session') > -1)
|
||||
e.returnValue = 'This terminal is active and not in session.
|
||||
Are you sure you want to kill it?'
|
||||
@@ -44,7 +44,7 @@ document.addEventListener 'keydown', (e) ->
|
||||
if theme is 'default'
|
||||
url = "/static/main.css"
|
||||
else
|
||||
url = "theme/#{theme}/style.css"
|
||||
url = "/theme/#{theme}/style.css"
|
||||
inner += '<option '
|
||||
|
||||
if _theme is url
|
||||
|
||||
Reference in New Issue
Block a user