From a6e68ebb827a82cde1586781ddac832395e1970d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Wed, 19 Dec 2018 15:53:49 +0100 Subject: [PATCH] v2 update --- dist/autoloader.js | 2 +- dist/autoloaderV2.js | 223 ++++++++++++++++++++++--------------------- src/autoloaderV2.js | 221 +++++++++++++++++++++--------------------- 3 files changed, 224 insertions(+), 222 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 7c47bd8..1e889eb 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Tue Dec 18 2018 02:47:49 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 15:53:48 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 be9ebee..d5ba423 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Tue Dec 18 2018 02:47:49 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 15:53:48 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18409,41 +18409,41 @@ class AutomaticDispose { // return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed // }) // } else { - return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { - self.ADSettings().then((setting) => { - if (setting[self.MyRunnerSettings] === 'true') { + return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { - let where = { - missionID: self.MissionID, - runner: self.MyRunner, - done: 'false' + let where = { + missionID: self.MissionID, + runner: self.MyRunner, + done: 'false' + } + // console.log(where); + return self.ADisDB.ADisMissions.where(where).and(function (item) { + return item.next_check <= Math.floor(new Date().getTime() / 1000) + }).limit(1) + } + }).then((Wunsch) => { + if (Wunsch !== undefined) { + return Wunsch.count(function (count) { + if (count > 0) { + return Wunsch.each((mywunsch) => { + console.table(mywunsch); + return self.MainHandler() + }); + } else { + return self.UpdateMissionsToDone(self.MissionID).then(() => { + return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + }) } - // console.log(where); - return self.ADisDB.ADisMissions.where(where).and(function (item) { - return item.next_check <= Math.floor(new Date().getTime() / 1000) - }).limit(1) - } - }).then((Wunsch) => { - if (Wunsch !== undefined) { - return Wunsch.count(function (count) { - if (count > 0) { - return Wunsch.each((mywunsch) => { - console.table(mywunsch); - return self.MainHandler() - }); - } else { - return self.UpdateMissionsToDone(self.MissionID).then(() => { - return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - }) - } - }); - } else { - return self.RemoveMissionsFromQueue(self.MissionID).then(() => { - return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - }) - } - }) + }); + } else { + return self.RemoveMissionsFromQueue(self.MissionID).then(() => { + return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + }) + } }) + }) // } }, 500); } @@ -18601,91 +18601,69 @@ class AutomaticDispose { StartAlarmProcess() { const self = this; - const alarming = function alarming(self) { - Promise.resolve().then(async () => { - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.CollectInvolvedVehicles(); - }).then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.CollectPatients(); - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessEmergencyMedicalService() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessFireDepartment() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessPoliceDepartment() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessTechnicalEmergencyService() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessWaterRescue() - }).then(() => { - if (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(); - } + Promise.resolve().then(async () => { + return await self.PrepareVehicleNeedList(); + }).then(async () => { + return await self.CollectInvolvedVehicles(); + }).then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.CollectPatients(); + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessEmergencyMedicalService() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessFireDepartment() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessPoliceDepartment() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessTechnicalEmergencyService() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessWaterRescue() + }).then(() => { + + if (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(); } + } - // 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(() => { + // 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(() => { - tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); - window.$('#mission_alarm_btn').click(); - }); - }, 250); + self.UpdateMissionsToDone(self.MissionID).then(() => { + tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); + window.$('#mission_alarm_btn').click(); + }); + }, 250); + + }) - }) - }; - var $div = $("#mission-form > div:nth-child(7) > a"); - var isShow = $div.is(':hidden'); - //console.log($div, isShow); - if ($div.length && isShow && 1 == 0) { - var observer = new MutationObserver(function (mutations) { - mutations.forEach(function (mutation) { - if (mutation.attributeName === "style") { - setTimeout(function () { - alarming(self) - }, 1500); - } - }); - }); - observer.observe($div[0], { - attributes: true - }); - $div.click(); - } else { - setTimeout(function () { - alarming(self) - }, 500); - } } @@ -19637,5 +19615,28 @@ class AutomaticDispose { } } +$(document).ready(function () { + var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); + var isShow = $div.is(':hidden'); + //console.log($div, isShow); + if ($div.length && isShow && 1 == 0) { + var observer = new MutationObserver(function (mutations) { + mutations.forEach(function (mutation) { + if (mutation.attributeName === "style") { + setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 1500); + } + }); + }); + observer.observe($div[0], { + attributes: true + }); -window.AutomaticDisposeCall = new AutomaticDispose(); \ No newline at end of file + $div.click(); + } else { + setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 500); + } +}); \ No newline at end of file diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 71056a9..c1152ad 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1168,41 +1168,41 @@ class AutomaticDispose { // return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed // }) // } else { - return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { - self.ADSettings().then((setting) => { - if (setting[self.MyRunnerSettings] === 'true') { + return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { - let where = { - missionID: self.MissionID, - runner: self.MyRunner, - done: 'false' + let where = { + missionID: self.MissionID, + runner: self.MyRunner, + done: 'false' + } + // console.log(where); + return self.ADisDB.ADisMissions.where(where).and(function (item) { + return item.next_check <= Math.floor(new Date().getTime() / 1000) + }).limit(1) + } + }).then((Wunsch) => { + if (Wunsch !== undefined) { + return Wunsch.count(function (count) { + if (count > 0) { + return Wunsch.each((mywunsch) => { + console.table(mywunsch); + return self.MainHandler() + }); + } else { + return self.UpdateMissionsToDone(self.MissionID).then(() => { + return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + }) } - // console.log(where); - return self.ADisDB.ADisMissions.where(where).and(function (item) { - return item.next_check <= Math.floor(new Date().getTime() / 1000) - }).limit(1) - } - }).then((Wunsch) => { - if (Wunsch !== undefined) { - return Wunsch.count(function (count) { - if (count > 0) { - return Wunsch.each((mywunsch) => { - console.table(mywunsch); - return self.MainHandler() - }); - } else { - return self.UpdateMissionsToDone(self.MissionID).then(() => { - return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - }) - } - }); - } else { - return self.RemoveMissionsFromQueue(self.MissionID).then(() => { - return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - }) - } - }) + }); + } else { + return self.RemoveMissionsFromQueue(self.MissionID).then(() => { + return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + }) + } }) + }) // } }, 500); } @@ -1360,91 +1360,69 @@ class AutomaticDispose { StartAlarmProcess() { const self = this; - const alarming = function alarming(self) { - Promise.resolve().then(async () => { - return await self.PrepareVehicleNeedList(); - }).then(async () => { - return await self.CollectInvolvedVehicles(); - }).then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.CollectPatients(); - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessEmergencyMedicalService() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessFireDepartment() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessPoliceDepartment() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessTechnicalEmergencyService() - }) - .then(async () => { - if (self.MyRunner == 'os' && self.Vehicles.length > 0) { - return - } - return await self.ProcessWaterRescue() - }).then(() => { - if (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(); - } + Promise.resolve().then(async () => { + return await self.PrepareVehicleNeedList(); + }).then(async () => { + return await self.CollectInvolvedVehicles(); + }).then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.CollectPatients(); + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessEmergencyMedicalService() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessFireDepartment() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessPoliceDepartment() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessTechnicalEmergencyService() + }) + .then(async () => { + if (self.MyRunner == 'os' && self.Vehicles.length > 0) { + return + } + return await self.ProcessWaterRescue() + }).then(() => { + + if (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(); } + } - // 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(() => { + // 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(() => { - tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); - window.$('#mission_alarm_btn').click(); - }); - }, 250); + self.UpdateMissionsToDone(self.MissionID).then(() => { + tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); + window.$('#mission_alarm_btn').click(); + }); + }, 250); + + }) - }) - }; - var $div = $("#mission-form > div:nth-child(7) > a"); - var isShow = $div.is(':hidden'); - //console.log($div, isShow); - if ($div.length && isShow && 1 == 0) { - var observer = new MutationObserver(function (mutations) { - mutations.forEach(function (mutation) { - if (mutation.attributeName === "style") { - setTimeout(function () { - alarming(self) - }, 1500); - } - }); - }); - observer.observe($div[0], { - attributes: true - }); - $div.click(); - } else { - setTimeout(function () { - alarming(self) - }, 500); - } } @@ -2396,5 +2374,28 @@ class AutomaticDispose { } } +$(document).ready(function () { + var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); + var isShow = $div.is(':hidden'); + //console.log($div, isShow); + if ($div.length && isShow && 1 == 0) { + var observer = new MutationObserver(function (mutations) { + mutations.forEach(function (mutation) { + if (mutation.attributeName === "style") { + setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 1500); + } + }); + }); + observer.observe($div[0], { + attributes: true + }); -window.AutomaticDisposeCall = new AutomaticDispose(); \ No newline at end of file + $div.click(); + } else { + setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 500); + } +}); \ No newline at end of file