v2 up aof8auoj

This commit is contained in:
2018-12-19 16:13:49 +01:00
parent 16838dae86
commit 4e591be16b
3 changed files with 46 additions and 42 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 16:12:04 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 16:13:48 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+23 -21
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 16:12:04 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 16:13:48 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -18453,28 +18453,28 @@ class AutomaticDispose {
const self = this; const self = this;
if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE!"); console.log("DONE!");
console.log("DONE: ", self.MissionID); console.log("DONE: ", self.MissionID);
return self.RemoveMissionsFromQueue(self.MissionID).then(() => { 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 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")) { } else if (self.includesString($('#iframe-inside-container div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert")) {
console.log("SEND"); console.log("SEND");
console.log("SEND: ", self.MissionID); console.log("SEND: ", self.MissionID);
return self.UpdateMissionsToDone(self.MissionID).then(() => { 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 return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}); });
} else { } else {
if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) {
console.log("WILL SEND?") console.log("WILL SEND?")
self.CheckMissionAutomatic(); return self.CheckMissionAutomatic();
} else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) { } else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) {
self.WorkVerbandMission(); return self.WorkVerbandMission();
} }
} }
} }
@@ -18547,13 +18547,14 @@ class AutomaticDispose {
CheckMissionAutomatic() { CheckMissionAutomatic() {
const self = this; const self = this;
const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name);
self.MyRunner = self.ADisSettings.runner[runnerID]; self.MyRunner = self.ADisSettings.runner[runnerID];
self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID];
if (self.MyRunnerSettings && self.MyRunner) { if (self.MyRunnerSettings && self.MyRunner) {
self.ADSettings().then((setting) => { console.log("debug 1");
if (setting[self.MyRunnerSettings] === 'true') { self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
let where = { let where = {
missionID: self.MissionID, missionID: self.MissionID,
runner: self.MyRunner, runner: self.MyRunner,
@@ -18568,6 +18569,7 @@ class AutomaticDispose {
return coll.limit(1).toArray() return coll.limit(1).toArray()
} }
}).then((Missions) => { }).then((Missions) => {
console.log("debug 2", Missions);
if (Missions.length > 0) { if (Missions.length > 0) {
var Mission = Missions[0]; var Mission = Missions[0];
if (self.MyRunner == 'os') { if (self.MyRunner == 'os') {
+22 -20
View File
@@ -1212,28 +1212,28 @@ class AutomaticDispose {
const self = this; const self = this;
if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) { if (self.includesString($('div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE!"); console.log("DONE!");
console.log("DONE: ", self.MissionID); console.log("DONE: ", self.MissionID);
return self.RemoveMissionsFromQueue(self.MissionID).then(() => { 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 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")) { } else if (self.includesString($('#iframe-inside-container div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert")) {
console.log("SEND"); console.log("SEND");
console.log("SEND: ", self.MissionID); console.log("SEND: ", self.MissionID);
return self.UpdateMissionsToDone(self.MissionID).then(() => { 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 return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
}); });
} else { } else {
if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) {
console.log("WILL SEND?") console.log("WILL SEND?")
self.CheckMissionAutomatic(); return self.CheckMissionAutomatic();
} else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) { } else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) {
self.WorkVerbandMission(); return self.WorkVerbandMission();
} }
} }
} }
@@ -1306,13 +1306,14 @@ class AutomaticDispose {
CheckMissionAutomatic() { CheckMissionAutomatic() {
const self = this; const self = this;
const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name);
self.MyRunner = self.ADisSettings.runner[runnerID]; self.MyRunner = self.ADisSettings.runner[runnerID];
self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID];
if (self.MyRunnerSettings && self.MyRunner) { if (self.MyRunnerSettings && self.MyRunner) {
self.ADSettings().then((setting) => { console.log("debug 1");
if (setting[self.MyRunnerSettings] === 'true') { self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
let where = { let where = {
missionID: self.MissionID, missionID: self.MissionID,
runner: self.MyRunner, runner: self.MyRunner,
@@ -1327,6 +1328,7 @@ class AutomaticDispose {
return coll.limit(1).toArray() return coll.limit(1).toArray()
} }
}).then((Missions) => { }).then((Missions) => {
console.log("debug 2", Missions);
if (Missions.length > 0) { if (Missions.length > 0) {
var Mission = Missions[0]; var Mission = Missions[0];
if (self.MyRunner == 'os') { if (self.MyRunner == 'os') {