make planned events work with auto share and callback to free slot

This commit is contained in:
2019-02-20 00:52:07 +01:00
parent 5e938178a2
commit c7f5742cf7
3 changed files with 28 additions and 14 deletions

View File

@@ -1638,10 +1638,9 @@ class AutomaticDispose {
})
.then(() => {
if (self.OweSecure && $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:checked').length == 0) {
if (self.MyRunner == 'os' && self.OweSecure && $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:checked').length == 0) {
if ($('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:not(:checked)').length > 0) {
$('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:not(:checked)')[0].click();
return;
}
}
@@ -1653,7 +1652,7 @@ class AutomaticDispose {
//tellParent(`console.log('ok:${window.name}:${self.MissionID}');`);
if (vhcalled.length == 0) {
//window.console.log('nocars selected...', vhcalled.length);
if (window.name == 'adis-krankentransporte') {
if (self.MyRunner == 'kt') {
//window.console.log('nocars selected... select KTW');
$('#aao_2753841').click();
window.$('#mission_alarm_btn').click();
@@ -1662,9 +1661,17 @@ class AutomaticDispose {
tellParent(`/*console.log('nocars:${window.name}:${self.MissionID}');*/window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
}
} else {
tellParent(`/*console.log('sendcars:${window.name}:${self.MissionID}');*/setTimeout(function(){window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},1000);`);
window.$('#mission_alarm_btn').click();
//window.console.log("WILL KLICK SEND3", self.MissionID, window.name)
if (self.MyRunner == 'os' && self.OweSecure) {
tellParent(`/*console.log('sendcars:${window.name}:${self.MissionID}');*/setTimeout(function(){window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},1000);`);
window.$('#mission_alarm_btn').click();
} else if (self.MyRunner == 'os' && !self.OweSecure) {
tellParent(`/*console.log('sendcars:${window.name}:${self.MissionID}');*/setTimeout(function(){window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},1000);`);
window.$('#container_navbar_alarm > div > div.navbar-header > div:nth-child(3) > a.btn.btn-success.btn-sm.alert_next_alliance.hidden-xs').click();
} else {
tellParent(`/*console.log('sendcars:${window.name}:${self.MissionID}');*/setTimeout(function(){window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},1000);`);
window.$('#mission_alarm_btn').click();
//window.console.log("WILL KLICK SEND3", self.MissionID, window.name)
}
}
});
})