diff --git a/dist/autoloader.js b/dist/autoloader.js index ff2cbe4..5b5f7c3 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Dec 03 2018 21:41:35 GMT+0100 (CET)*/ +/*Generated on:Mon Dec 03 2018 21:55:31 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 ce83c57..9c5f0e4 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Dec 03 2018 21:41:35 GMT+0100 (CET)*/ +/*Generated on:Mon Dec 03 2018 21:55:31 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -21038,12 +21038,15 @@ class AutomaticDispose { // - // - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - WorkVerbandMission() { + WorkVerbandMission(myself) { + if (typeof myself === 'undefined') { + myself=false + } const self = this; - self.ADSettings().then((setting) => { + return self.ADSettings().then((setting) => { var title = document.getElementById('missionH1'); var isVerband = title.innerText.toLowerCase().includes("[verband]"); - if (setting['Alliance-Automatic'] == 'true' && isVerband) { + if ((setting['Alliance-Automatic'] == 'true' && isVerband) || myself) { if ([52, 55, 129, 203].indexOf(self.MissionType) !== -1 && $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]').size() > 0) { $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]')[0].click(); } else if ([53, 130, 202].indexOf(self.MissionType) !== -1) { @@ -21082,7 +21085,7 @@ class AutomaticDispose { } } // Todo add alternative cars, please no LF because of Mülltonne.... - if ($('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0) { + if ($('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0 && myself == false) { $('#mission_alarm_btn').click(); } } @@ -21204,9 +21207,11 @@ class AutomaticDispose { // 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(() => { + self.UpdateMissionsToDone(self.MissionID).then( async () => { tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`); 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 { window.$('#mission_alarm_btn').click(); diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index ef13ca1..bb0c665 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1186,12 +1186,15 @@ class AutomaticDispose { // - // - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - WorkVerbandMission() { + WorkVerbandMission(myself) { + if (typeof myself === 'undefined') { + myself=false + } const self = this; - self.ADSettings().then((setting) => { + return self.ADSettings().then((setting) => { var title = document.getElementById('missionH1'); var isVerband = title.innerText.toLowerCase().includes("[verband]"); - if (setting['Alliance-Automatic'] == 'true' && isVerband) { + if ((setting['Alliance-Automatic'] == 'true' && isVerband) || myself) { if ([52, 55, 129, 203].indexOf(self.MissionType) !== -1 && $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]').size() > 0) { $('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]')[0].click(); } else if ([53, 130, 202].indexOf(self.MissionType) !== -1) { @@ -1230,7 +1233,7 @@ class AutomaticDispose { } } // Todo add alternative cars, please no LF because of Mülltonne.... - if ($('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0) { + if ($('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0 && myself == false) { $('#mission_alarm_btn').click(); } } @@ -1352,9 +1355,11 @@ class AutomaticDispose { // 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(() => { + self.UpdateMissionsToDone(self.MissionID).then( async () => { tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`); 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 { window.$('#mission_alarm_btn').click();