v2 update :ai

This commit is contained in:
2018-12-17 20:57:15 +01:00
parent 17c33e5bb3
commit 61357300e3
3 changed files with 110 additions and 98 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 17 2018 20:46:50 GMT+0100 (CET)*/
/*Generated on:Mon Dec 17 2018 20:57:14 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();
+14 -8
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Dec 17 2018 20:46:50 GMT+0100 (CET)*/
/*Generated on:Mon Dec 17 2018 20:57:14 GMT+0100 (CET)*/
/*
* Dexie.js - a minimalistic wrapper for IndexedDB
* ===============================================
@@ -18786,7 +18786,7 @@ class AutomaticDispose {
const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name);
self.MyRunner = self.ADisSettings.runner[runnerID];
self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID];
setTimeout(function () {
self.MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
var help_el = $('a#mission_help');
if (help_el.length > 0) {
@@ -18802,6 +18802,12 @@ class AutomaticDispose {
// console.log("Window", window.name);
// console.log("self.MyRunner", self.MyRunner);
// console.log("self.MyRunnerSettings", self.MyRunnerSettings);
if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE: " + self.MissionID);
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 {
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
@@ -18835,7 +18841,8 @@ class AutomaticDispose {
}
})
})
}, 1500);
}
}
@@ -18846,8 +18853,7 @@ 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
})
}
if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
} else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
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
@@ -19036,7 +19042,7 @@ class AutomaticDispose {
}
}
console.log("Clicked Vehicles:"+self.MissionID+":"+self.MissionConfig.type+" ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
console.log("Clicked Vehicles:" + self.MissionID + ":" + self.MissionConfig.type + " ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
console.table(self.MissionData)
self.UpdateMissionsToDone(self.MissionID).then(async () => {
@@ -19047,13 +19053,13 @@ class AutomaticDispose {
// window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!')
// window.$("a.btn.btn-success.btn-sm.alert_notify_alliance").click();
//} else {
if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length){
if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length) {
console.log('send now')
if (window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']").length > 0 && self.MissionConfig.share) {
window.$('input[type=checkbox]').prop('checked', false);
await self.WorkVerbandMission(true);
window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']")[0].click();
}else {
} else {
window.$('#mission_alarm_btn').click();
}
tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},500);`);
+13 -7
View File
@@ -1126,7 +1126,7 @@ class AutomaticDispose {
const runnerID = self.ADisSettings.runner_iframesName.indexOf(window.name);
self.MyRunner = self.ADisSettings.runner[runnerID];
self.MyRunnerSettings = self.ADisSettings.runner_settings[runnerID];
setTimeout(function () {
self.MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
var help_el = $('a#mission_help');
if (help_el.length > 0) {
@@ -1142,6 +1142,12 @@ class AutomaticDispose {
// console.log("Window", window.name);
// console.log("self.MyRunner", self.MyRunner);
// console.log("self.MyRunnerSettings", self.MyRunnerSettings);
if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE: " + self.MissionID);
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 {
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
@@ -1175,7 +1181,8 @@ class AutomaticDispose {
}
})
})
}, 1500);
}
}
@@ -1186,8 +1193,7 @@ 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
})
}
if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
} else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
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
@@ -1376,7 +1382,7 @@ class AutomaticDispose {
}
}
console.log("Clicked Vehicles:"+self.MissionID+":"+self.MissionConfig.type+" ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
console.log("Clicked Vehicles:" + self.MissionID + ":" + self.MissionConfig.type + " ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
console.table(self.MissionData)
self.UpdateMissionsToDone(self.MissionID).then(async () => {
@@ -1387,13 +1393,13 @@ class AutomaticDispose {
// window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!')
// window.$("a.btn.btn-success.btn-sm.alert_notify_alliance").click();
//} else {
if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length){
if ($('#vehicle_show_table_all input[type="checkbox"]:checked').length) {
console.log('send now')
if (window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']").length > 0 && self.MissionConfig.share) {
window.$('input[type=checkbox]').prop('checked', false);
await self.WorkVerbandMission(true);
window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']")[0].click();
}else {
} else {
window.$('#mission_alarm_btn').click();
}
tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');},500);`);