This commit is contained in:
2019-01-11 02:41:19 +01:00
parent e8da6536d9
commit 22b2bca429
3 changed files with 68 additions and 40 deletions
+1 -1
View File
@@ -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_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();
+25 -11
View File
@@ -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 * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -18326,7 +18326,6 @@ class AutomaticDispose {
console.log(count, runnerOpt); console.log(count, runnerOpt);
if (count > 0) { if (count > 0) {
return Missions.each((Mission) => { return Missions.each((Mission) => {
console.table(Mission);
var MissionElement = $("#mission_" + ID); var MissionElement = $("#mission_" + ID);
var _MissionID = MissionElement.attr("mission_id"); var _MissionID = MissionElement.attr("mission_id");
var _MissionType = MissionElement.attr("mission_type_id"); var _MissionType = MissionElement.attr("mission_type_id");
@@ -18338,6 +18337,19 @@ class AutomaticDispose {
return self.ADisDB.ADisAvailabelMissions.get({ return self.ADisDB.ADisAvailabelMissions.get({
type: _MissionType type: _MissionType
}).then((available) => { }).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({ return self.UpdateMissions({
"missionID": _MissionID, "missionID": _MissionID,
"type": _MissionType, "type": _MissionType,
@@ -18572,13 +18584,15 @@ class AutomaticDispose {
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 {
setTimeout(function () { setTimeout(function () {
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?")
@@ -19771,24 +19785,24 @@ $(document).ready(function () {
var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')");
var isShow = $div.is(':hidden'); var isShow = $div.is(':hidden');
var ppppp = undefined; var ppppp = undefined;
var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
console.log($div, isShow, MissionID); //console.log($div, isShow, MissionID);
if ($div.length && isShow) { if ($div.length && isShow) {
var observer = new MutationObserver(function (mutations) { var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) { mutations.forEach(function (mutation) {
console.log(mutation.type, MissionID);
console.table(mutation, MissionID);
if (mutation.attributeName === "style") { if (mutation.attributeName === "style") {
if (typeof ppppp != 'undefined'){ if ($(mutation.target).css('display') == 'none') {
if (typeof ppppp != 'undefined') {
clearTimeout(ppppp); clearTimeout(ppppp);
} }
ppppp = setTimeout(function () { ppppp = setTimeout(function () {
window.AutomaticDisposeCall = new AutomaticDispose(); window.AutomaticDisposeCall = new AutomaticDispose();
}, 1500); }, 250);
}
} }
}); });
}); });
$div.each(function(index,item){ $div.each(function (index, item) {
observer.observe(item, { observer.observe(item, {
attributes: true, attributes: true,
characterData: true, characterData: true,
+24 -10
View File
@@ -972,7 +972,6 @@ class AutomaticDispose {
console.log(count, runnerOpt); console.log(count, runnerOpt);
if (count > 0) { if (count > 0) {
return Missions.each((Mission) => { return Missions.each((Mission) => {
console.table(Mission);
var MissionElement = $("#mission_" + ID); var MissionElement = $("#mission_" + ID);
var _MissionID = MissionElement.attr("mission_id"); var _MissionID = MissionElement.attr("mission_id");
var _MissionType = MissionElement.attr("mission_type_id"); var _MissionType = MissionElement.attr("mission_type_id");
@@ -984,6 +983,19 @@ class AutomaticDispose {
return self.ADisDB.ADisAvailabelMissions.get({ return self.ADisDB.ADisAvailabelMissions.get({
type: _MissionType type: _MissionType
}).then((available) => { }).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({ return self.UpdateMissions({
"missionID": _MissionID, "missionID": _MissionID,
"type": _MissionType, "type": _MissionType,
@@ -1218,13 +1230,15 @@ class AutomaticDispose {
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 {
setTimeout(function () { setTimeout(function () {
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?")
@@ -2417,24 +2431,24 @@ $(document).ready(function () {
var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); var $div = $("a:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')");
var isShow = $div.is(':hidden'); var isShow = $div.is(':hidden');
var ppppp = undefined; var ppppp = undefined;
var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
console.log($div, isShow, MissionID); //console.log($div, isShow, MissionID);
if ($div.length && isShow) { if ($div.length && isShow) {
var observer = new MutationObserver(function (mutations) { var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) { mutations.forEach(function (mutation) {
console.log(mutation.type, MissionID);
console.table(mutation, MissionID);
if (mutation.attributeName === "style") { if (mutation.attributeName === "style") {
if (typeof ppppp != 'undefined'){ if ($(mutation.target).css('display') == 'none') {
if (typeof ppppp != 'undefined') {
clearTimeout(ppppp); clearTimeout(ppppp);
} }
ppppp = setTimeout(function () { ppppp = setTimeout(function () {
window.AutomaticDisposeCall = new AutomaticDispose(); window.AutomaticDisposeCall = new AutomaticDispose();
}, 1500); }, 250);
}
} }
}); });
}); });
$div.each(function(index,item){ $div.each(function (index, item) {
observer.observe(item, { observer.observe(item, {
attributes: true, attributes: true,
characterData: true, characterData: true,