v2 update

This commit is contained in:
2018-12-19 15:53:49 +01:00
parent f95f4a6483
commit a6e68ebb82
3 changed files with 224 additions and 222 deletions

223
dist/autoloaderV2.js vendored
View File

@@ -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();
$div.click();
} else {
setTimeout(function () {
window.AutomaticDisposeCall = new AutomaticDispose();
}, 500);
}
});