mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 23:19:33 +00:00
Added ply checks
This commit is contained in:
@@ -174,11 +174,19 @@ function setStartTime() {
|
||||
}
|
||||
|
||||
function takeOff() {
|
||||
sendCommandToSelected('takeoff');
|
||||
if (table.getSelectedRows().length > 0) {
|
||||
askPermission('Are you sure you want to take off this copters?', function () {
|
||||
sendCommandToSelected('takeoff');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function flipCopters() {
|
||||
sendCommandToSelected('flip');
|
||||
if (table.getSelectedRows().length > 0) {
|
||||
askPermission('Are you sure you want to flip this copters?', function () {
|
||||
sendCommandToSelected('flip');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function land() {
|
||||
@@ -224,11 +232,24 @@ function emLand() {
|
||||
}
|
||||
|
||||
function startAnimation() {
|
||||
spinner.style.display = 'inline-block';
|
||||
setTimeout(function () {
|
||||
let req = new XMLHttpRequest();
|
||||
req.open('POST', '/start_animation', false);
|
||||
req.send();
|
||||
spinner.style.display = 'none';
|
||||
}, 20);
|
||||
askPermission('Are you sure you want to start animation?', function () {
|
||||
spinner.style.display = 'inline-block';
|
||||
setTimeout(function () {
|
||||
let req = new XMLHttpRequest();
|
||||
req.open('POST', '/start_animation', false);
|
||||
req.send();
|
||||
spinner.style.display = 'none';
|
||||
}, 20);
|
||||
});
|
||||
}
|
||||
|
||||
function askPermission(text, func) {
|
||||
Ply.dialog("confirm",
|
||||
{},
|
||||
text
|
||||
).done(function (e) {
|
||||
if (e.state) {
|
||||
func();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
<script lang="js" src="/static/js/jquery.min.js"></script>
|
||||
<script lang="js" src="/static/js/popper.min.js"></script>
|
||||
<script lang="js" src="/static/js/bootstrap.min.js"></script>
|
||||
<!--<script lang="js" src="/static/js/ply.js"></script>-->
|
||||
<script lang="js" src="/static/js/ply.js"></script>
|
||||
<script lang="js" src="/static/js/tabulator.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user