diff --git a/dist/autoloader.js b/dist/autoloader.js index bd7294c..9ed446a 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Fri Jan 11 2019 02:33:00 GMT+0100 (CET)*/ +/*Generated on:Fri Jan 11 2019 02:41:18 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 849863f..82400bf 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Fri Jan 11 2019 02:33:00 GMT+0100 (CET)*/ +/*Generated on:Fri Jan 11 2019 02:41:18 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18326,7 +18326,6 @@ class AutomaticDispose { console.log(count, runnerOpt); if (count > 0) { return Missions.each((Mission) => { - console.table(Mission); var MissionElement = $("#mission_" + ID); var _MissionID = MissionElement.attr("mission_id"); var _MissionType = MissionElement.attr("mission_type_id"); @@ -18338,6 +18337,19 @@ class AutomaticDispose { return self.ADisDB.ADisAvailabelMissions.get({ type: _MissionType }).then((available) => { + console.table(Mission) + console.table({ + "missionID": _MissionID, + "type": _MissionType, + "runner": runnerOpt, + "name": MissionName, + "street": MissionStreet, + "village": MissionVillage, + "available": (available !== undefined) ? 'true' : 'false', + "done": "false", + "last_check": Mission.last_check, + "next_check": Mission.next_check + }) return self.UpdateMissions({ "missionID": _MissionID, "type": _MissionType, @@ -18572,13 +18584,15 @@ class AutomaticDispose { 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") ) { - 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 - }); - } */ else { + } + /*else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") ) { + 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 + }); + } */ + else { setTimeout(function () { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) { console.log("WILL SEND?") @@ -18766,7 +18780,7 @@ class AutomaticDispose { window.console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); window.console.log("WILL KLICK SEND", self.MissionID, window.name) - + self.UpdateMissionsToDone(self.MissionID).then(() => { tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length == 0) { @@ -19771,24 +19785,24 @@ $(document).ready(function () { var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); var isShow = $div.is(':hidden'); var ppppp = undefined; - var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); - console.log($div, isShow, MissionID); + //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); + //console.log($div, isShow, MissionID); if ($div.length && isShow) { var observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { - console.log(mutation.type, MissionID); - console.table(mutation, MissionID); if (mutation.attributeName === "style") { - if (typeof ppppp != 'undefined'){ - clearTimeout(ppppp); + if ($(mutation.target).css('display') == 'none') { + if (typeof ppppp != 'undefined') { + clearTimeout(ppppp); + } + ppppp = setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 250); } - ppppp = setTimeout(function () { - window.AutomaticDisposeCall = new AutomaticDispose(); - }, 1500); } }); }); - $div.each(function(index,item){ + $div.each(function (index, item) { observer.observe(item, { attributes: true, characterData: true, diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 0070c0e..d41a195 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -972,7 +972,6 @@ class AutomaticDispose { console.log(count, runnerOpt); if (count > 0) { return Missions.each((Mission) => { - console.table(Mission); var MissionElement = $("#mission_" + ID); var _MissionID = MissionElement.attr("mission_id"); var _MissionType = MissionElement.attr("mission_type_id"); @@ -984,6 +983,19 @@ class AutomaticDispose { return self.ADisDB.ADisAvailabelMissions.get({ type: _MissionType }).then((available) => { + console.table(Mission) + console.table({ + "missionID": _MissionID, + "type": _MissionType, + "runner": runnerOpt, + "name": MissionName, + "street": MissionStreet, + "village": MissionVillage, + "available": (available !== undefined) ? 'true' : 'false', + "done": "false", + "last_check": Mission.last_check, + "next_check": Mission.next_check + }) return self.UpdateMissions({ "missionID": _MissionID, "type": _MissionType, @@ -1218,13 +1230,15 @@ class AutomaticDispose { 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") ) { - 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 - }); - } */ else { + } + /*else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") ) { + 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 + }); + } */ + else { setTimeout(function () { if (['adis-ownmissions', 'adis-plannedevents', 'adis-krankentransporte'].indexOf(window.name) != -1) { console.log("WILL SEND?") @@ -1412,7 +1426,7 @@ class AutomaticDispose { window.console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked')); window.console.log("WILL KLICK SEND", self.MissionID, window.name) - + self.UpdateMissionsToDone(self.MissionID).then(() => { tellParent(`console.log('ok:${window.name}:${self.MissionID}');`); if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length == 0) { @@ -2417,24 +2431,24 @@ $(document).ready(function () { var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); var isShow = $div.is(':hidden'); var ppppp = undefined; - var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); - console.log($div, isShow, MissionID); + //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); + //console.log($div, isShow, MissionID); if ($div.length && isShow) { var observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { - console.log(mutation.type, MissionID); - console.table(mutation, MissionID); if (mutation.attributeName === "style") { - if (typeof ppppp != 'undefined'){ - clearTimeout(ppppp); + if ($(mutation.target).css('display') == 'none') { + if (typeof ppppp != 'undefined') { + clearTimeout(ppppp); + } + ppppp = setTimeout(function () { + window.AutomaticDisposeCall = new AutomaticDispose(); + }, 250); } - ppppp = setTimeout(function () { - window.AutomaticDisposeCall = new AutomaticDispose(); - }, 1500); } }); }); - $div.each(function(index,item){ + $div.each(function (index, item) { observer.observe(item, { attributes: true, characterData: true,