From 5c619f622cf2199ec686581b2f036f06e5c6df36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Wed, 19 Dec 2018 15:57:00 +0100 Subject: [PATCH] xx --- dist/autoloader.js | 2 +- dist/autoloaderV2.js | 30 +++++++++++++++++------------- src/autoloaderV2.js | 28 ++++++++++++++++------------ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 1e889eb..41396d9 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 15:53:48 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 15:57:00 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 d5ba423..7db9494 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 15:53:48 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 15:57:00 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18451,18 +18451,22 @@ class AutomaticDispose { MainHandler() { const self = this; - if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { - console.log("DONE!"); - console.log("DONE: ", self.MissionID); - return self.RemoveMissionsFromQueue(self.MissionID).then(() => { - return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed - }) - } else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').length > 0*/ ) { - console.log("SEND"); - console.log("SEND: ", self.MissionID); - return self.UpdateMissionsToDone(self.MissionID).then(() => { - return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full - }); + if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { + setTimeout(function () { + console.log("DONE!"); + console.log("DONE: ", self.MissionID); + return self.RemoveMissionsFromQueue(self.MissionID).then(() => { + return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed + }) + }, 250); + } else if (self.includesString($('#iframe-inside-container div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert")) { + setTimeout(function () { + console.log("SEND"); + console.log("SEND: ", self.MissionID); + return self.UpdateMissionsToDone(self.MissionID).then(() => { + return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full + }); + }, 250); } else { setTimeout(function () { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) { diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index c1152ad..85687aa 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1210,18 +1210,22 @@ class AutomaticDispose { MainHandler() { const self = this; - if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { - console.log("DONE!"); - console.log("DONE: ", self.MissionID); - return self.RemoveMissionsFromQueue(self.MissionID).then(() => { - return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed - }) - } else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').length > 0*/ ) { - console.log("SEND"); - console.log("SEND: ", self.MissionID); - return self.UpdateMissionsToDone(self.MissionID).then(() => { - return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full - }); + if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { + setTimeout(function () { + console.log("DONE!"); + console.log("DONE: ", self.MissionID); + return self.RemoveMissionsFromQueue(self.MissionID).then(() => { + return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed + }) + }, 250); + } else if (self.includesString($('#iframe-inside-container div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert")) { + setTimeout(function () { + console.log("SEND"); + console.log("SEND: ", self.MissionID); + return self.UpdateMissionsToDone(self.MissionID).then(() => { + return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full + }); + }, 250); } else { setTimeout(function () { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) {