diff --git a/dist/autoloader.js b/dist/autoloader.js index becf2cd..18d0608 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 16:08:19 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 16:12:04 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 f0613c1..5f56b06 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 16:08:19 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 16:12:04 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18487,6 +18487,9 @@ class AutomaticDispose { WorkVerbandMission() { const self = this; + const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); + self.MyRunner = self.ADisSettings.runner[runnerID]; + self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; self.ADSettings().then((setting) => { var title = document.getElementById('missionH1'); var isVerband = title.innerText.toLowerCase().includes("[verband]"); @@ -18544,15 +18547,13 @@ class AutomaticDispose { CheckMissionAutomatic() { const self = this; - var setOpt; - if (window.name == 'adis-ownmissions' || window.name == 'adis-plannedevents') { - setOpt = 'MissionsOwn-Automatic'; - } else if (window.name == 'adis-krankentransporte') { - setOpt = 'Krankentransport-Automatic'; - } - if (setOpt && self.MyRunner) { - self.ADSettings().then((setting) => { - if (setting[setOpt] == 'true') { + + const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); + self.MyRunner = self.ADisSettings.runner[runnerID]; + self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; + if (self.MyRunnerSettings && self.MyRunner) { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { let where = { missionID: self.MissionID, runner: self.MyRunner, @@ -18577,6 +18578,8 @@ class AutomaticDispose { tellParent(`console.log('config:1000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full } }); + } else { + tellParent(`console.log('config:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full } } diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 9f8a198..d11872b 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1246,6 +1246,9 @@ class AutomaticDispose { WorkVerbandMission() { const self = this; + const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); + self.MyRunner = self.ADisSettings.runner[runnerID]; + self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; self.ADSettings().then((setting) => { var title = document.getElementById('missionH1'); var isVerband = title.innerText.toLowerCase().includes("[verband]"); @@ -1303,15 +1306,13 @@ class AutomaticDispose { CheckMissionAutomatic() { const self = this; - var setOpt; - if (window.name == 'adis-ownmissions' || window.name == 'adis-plannedevents') { - setOpt = 'MissionsOwn-Automatic'; - } else if (window.name == 'adis-krankentransporte') { - setOpt = 'Krankentransport-Automatic'; - } - if (setOpt && self.MyRunner) { - self.ADSettings().then((setting) => { - if (setting[setOpt] == 'true') { + + const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name); + self.MyRunner = self.ADisSettings.runner[runnerID]; + self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID]; + if (self.MyRunnerSettings && self.MyRunner) { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { let where = { missionID: self.MissionID, runner: self.MyRunner, @@ -1336,6 +1337,8 @@ class AutomaticDispose { tellParent(`console.log('config:1000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full } }); + } else { + tellParent(`console.log('config:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full } }