From d2c54b866fd8b79e1cf79553815ce50662298050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Mon, 17 Dec 2018 00:39:40 +0100 Subject: [PATCH] v2 up a90fag09u --- dist/autoloader.js | 2 +- dist/autoloaderV2.js | 131 +++++++++++++++++++++---------------------- src/autoloaderV2.js | 129 +++++++++++++++++++++--------------------- 3 files changed, 130 insertions(+), 132 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 92ceb04..60dda9a 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Dec 17 2018 00:35:59 GMT+0100 (CET)*/ +/*Generated on:Mon Dec 17 2018 00:39:40 GMT+0100 (CET)*/ var AutomaticDispose_Branch = "master"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var da_lss_adis_time = new Date().getTime(); diff --git a/dist/autoloaderV2.js b/dist/autoloaderV2.js index 0487793..5689210 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Dec 17 2018 00:35:59 GMT+0100 (CET)*/ +/*Generated on:Mon Dec 17 2018 00:39:40 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18969,6 +18969,68 @@ class AutomaticDispose { StartAlarmProcess() { const self = this; + + const alarming = function alarming(){ + Promise.resolve().then(async () => { + return await self.PrepareVehicleNeedList(); + }).then(async () => { + return await self.CollectInvolvedVehicles(); + }).then(async () => { + return await self.CollectPatients(); + }) + .then(async () => { + return await self.ProcessEmergencyMedicalService() + }) + .then(async () => { + return await self.ProcessFireDepartment() + }) + .then(async () => { + return await self.ProcessPoliceDepartment() + }) + .then(async () => { + return await self.ProcessTechnicalEmergencyService() + }) + .then(async () => { + return await self.ProcessWaterRescue() + }).then(() => { + + if (self.OweSecure) { + 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(); + } + } + + // TODO check cars driving or already there + if (self.MissionConfig.share) { + // console.log('self.MissionConfig.share',self.MissionConfig.share) + const elems = $('#vehicle_show_table_all tr input[type="checkbox"]:checked') + // console.log('elems', elems) + for (let i = 0; i < elems.length; i++) { + if (i === 0) { + continue; + } + $(elems[i]).click(); + } + } + + // console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); + // console.log("WILL KLICK SEND") + setTimeout(() => { + self.UpdateMissionsToDone(self.MissionID).then(async () => { + tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},2500);`); + if (window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { + window.$('input[type=checkbox]').prop('checked', false); + await self.WorkVerbandMission(true); + window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') + window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").click(); + } else { + window.$('#mission_alarm_btn').click(); + } + }); + }, 250); + + }) + } setTimeout(function () { var $div = $("#mission-form > div:nth-child(7) > a"); console.log($div.length, $div); @@ -18978,70 +19040,7 @@ class AutomaticDispose { if (mutation.attributeName === "class") { var attributeValue = $(mutation.target).prop(mutation.attributeName); console.log("Class attribute changed to:", attributeValue); - Promise.resolve().then(async () => { - //Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden! - // - // - #mission-form > div:nth-child(7) > a - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.CollectInvolvedVehicles(); - }).then(async () => { - return await self.CollectPatients(); - }) - .then(async () => { - return await self.ProcessEmergencyMedicalService() - }) - .then(async () => { - return await self.ProcessFireDepartment() - }) - .then(async () => { - return await self.ProcessPoliceDepartment() - }) - .then(async () => { - return await self.ProcessTechnicalEmergencyService() - }) - .then(async () => { - return await self.ProcessWaterRescue() - }).then(() => { - - if (self.OweSecure) { - 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(); - } - } - - // TODO check cars driving or already there - if (self.MissionConfig.share) { - // console.log('self.MissionConfig.share',self.MissionConfig.share) - const elems = $('#vehicle_show_table_all tr input[type="checkbox"]:checked') - // console.log('elems', elems) - for (let i = 0; i < elems.length; i++) { - if (i === 0) { - continue; - } - $(elems[i]).click(); - } - } - - // console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); - // console.log("WILL KLICK SEND") - setTimeout(() => { - self.UpdateMissionsToDone(self.MissionID).then(async () => { - tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},2500);`); - if (window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { - window.$('input[type=checkbox]').prop('checked', false); - await self.WorkVerbandMission(true); - window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') - window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").click(); - } else { - window.$('#mission_alarm_btn').click(); - } - }); - }, 250); - - }) + alarming() } }); }); @@ -19051,7 +19050,7 @@ class AutomaticDispose { $div.click(); } else { - self.UpdateMissionsToDone(self.MissionID) + alarming() } }, 500); diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 1aaa89b..196293b 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1309,6 +1309,68 @@ class AutomaticDispose { StartAlarmProcess() { const self = this; + + const alarming = function alarming(){ + Promise.resolve().then(async () => { + return await self.PrepareVehicleNeedList(); + }).then(async () => { + return await self.CollectInvolvedVehicles(); + }).then(async () => { + return await self.CollectPatients(); + }) + .then(async () => { + return await self.ProcessEmergencyMedicalService() + }) + .then(async () => { + return await self.ProcessFireDepartment() + }) + .then(async () => { + return await self.ProcessPoliceDepartment() + }) + .then(async () => { + return await self.ProcessTechnicalEmergencyService() + }) + .then(async () => { + return await self.ProcessWaterRescue() + }).then(() => { + + if (self.OweSecure) { + 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(); + } + } + + // TODO check cars driving or already there + if (self.MissionConfig.share) { + // console.log('self.MissionConfig.share',self.MissionConfig.share) + const elems = $('#vehicle_show_table_all tr input[type="checkbox"]:checked') + // console.log('elems', elems) + for (let i = 0; i < elems.length; i++) { + if (i === 0) { + continue; + } + $(elems[i]).click(); + } + } + + // console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); + // console.log("WILL KLICK SEND") + setTimeout(() => { + self.UpdateMissionsToDone(self.MissionID).then(async () => { + tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},2500);`); + if (window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { + window.$('input[type=checkbox]').prop('checked', false); + await self.WorkVerbandMission(true); + window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') + window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").click(); + } else { + window.$('#mission_alarm_btn').click(); + } + }); + }, 250); + + }) + } setTimeout(function () { var $div = $("#mission-form > div:nth-child(7) > a"); console.log($div.length, $div); @@ -1318,70 +1380,7 @@ class AutomaticDispose { if (mutation.attributeName === "class") { var attributeValue = $(mutation.target).prop(mutation.attributeName); console.log("Class attribute changed to:", attributeValue); - Promise.resolve().then(async () => { - //Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden! - // - // - #mission-form > div:nth-child(7) > a - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.CollectInvolvedVehicles(); - }).then(async () => { - return await self.CollectPatients(); - }) - .then(async () => { - return await self.ProcessEmergencyMedicalService() - }) - .then(async () => { - return await self.ProcessFireDepartment() - }) - .then(async () => { - return await self.ProcessPoliceDepartment() - }) - .then(async () => { - return await self.ProcessTechnicalEmergencyService() - }) - .then(async () => { - return await self.ProcessWaterRescue() - }).then(() => { - - if (self.OweSecure) { - 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(); - } - } - - // TODO check cars driving or already there - if (self.MissionConfig.share) { - // console.log('self.MissionConfig.share',self.MissionConfig.share) - const elems = $('#vehicle_show_table_all tr input[type="checkbox"]:checked') - // console.log('elems', elems) - for (let i = 0; i < elems.length; i++) { - if (i === 0) { - continue; - } - $(elems[i]).click(); - } - } - - // console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); - // console.log("WILL KLICK SEND") - setTimeout(() => { - self.UpdateMissionsToDone(self.MissionID).then(async () => { - tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},2500);`); - if (window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { - window.$('input[type=checkbox]').prop('checked', false); - await self.WorkVerbandMission(true); - window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') - window.$("#mission-form a.btn.btn-success.btn-sm.alert_notify_alliance").click(); - } else { - window.$('#mission_alarm_btn').click(); - } - }); - }, 250); - - }) + alarming() } }); }); @@ -1391,7 +1390,7 @@ class AutomaticDispose { $div.click(); } else { - self.UpdateMissionsToDone(self.MissionID) + alarming() } }, 500);