v2 autoremove finisched alerts
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Tue Dec 18 2018 00:29:40 GMT+0100 (CET)*/
|
/*Generated on:Tue Dec 18 2018 00:38:26 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();
|
||||||
|
|||||||
Vendored
+39
-16
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Tue Dec 18 2018 00:29:40 GMT+0100 (CET)*/
|
/*Generated on:Tue Dec 18 2018 00:38:26 GMT+0100 (CET)*/
|
||||||
/*
|
/*
|
||||||
* Dexie.js - a minimalistic wrapper for IndexedDB
|
* Dexie.js - a minimalistic wrapper for IndexedDB
|
||||||
* ===============================================
|
* ===============================================
|
||||||
@@ -18125,17 +18125,40 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
ReadAndAddMissions(MissionID, Runner) {
|
ReadAndAddMissions(MissionID, Runner) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
||||||
if (typeof MissionID != 'undefined') {
|
|
||||||
return self.AddMission(MissionID, Runner);
|
self.ADSettings().then(() => {
|
||||||
} else {
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
return self.ADisSettings.runner_divs.forEach(async (RunnerX, index) => {
|
}).then((Missions) => {
|
||||||
await $("#" + RunnerX).find(".missionSideBarEntry").each(async (index, elem) => {
|
if (typeof Missions !== "undefined") {
|
||||||
MissionID = $(elem).attr("mission_id");
|
|
||||||
await self.AddMission(MissionID, RunnerX);
|
return Missions.count((count) => {
|
||||||
|
if (count > 0) {
|
||||||
|
return Missions.each((MyMission) => {
|
||||||
|
var MissionElement = $("#mission_" + MyMission.missionID);
|
||||||
|
if (MissionElement.length == 0 || $('#mission_panel_' + MyMission.missionID).hasClass('mission_panel_green')) {
|
||||||
|
// remove
|
||||||
|
console.log("Remove :", MyMission)
|
||||||
|
self.RemoveMissionsFromQueue(MyMission.missionID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
}
|
}).then(() => {
|
||||||
|
|
||||||
|
if (typeof MissionID != 'undefined') {
|
||||||
|
return self.AddMission(MissionID, Runner);
|
||||||
|
} else {
|
||||||
|
return self.ADisSettings.runner_divs.forEach(async (RunnerX, index) => {
|
||||||
|
await $("#" + RunnerX).find(".missionSideBarEntry").each(async (index, elem) => {
|
||||||
|
MissionID = $(elem).attr("mission_id");
|
||||||
|
await self.AddMission(MissionID, RunnerX);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18584,37 +18607,37 @@ class AutomaticDispose {
|
|||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
return await self.CollectInvolvedVehicles();
|
return await self.CollectInvolvedVehicles();
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.CollectPatients();
|
return await self.CollectPatients();
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessEmergencyMedicalService()
|
return await self.ProcessEmergencyMedicalService()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessFireDepartment()
|
return await self.ProcessFireDepartment()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessPoliceDepartment()
|
return await self.ProcessPoliceDepartment()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessTechnicalEmergencyService()
|
return await self.ProcessTechnicalEmergencyService()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessWaterRescue()
|
return await self.ProcessWaterRescue()
|
||||||
|
|||||||
+38
-15
@@ -884,17 +884,40 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
ReadAndAddMissions(MissionID, Runner) {
|
ReadAndAddMissions(MissionID, Runner) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], () => {
|
||||||
if (typeof MissionID != 'undefined') {
|
|
||||||
return self.AddMission(MissionID, Runner);
|
self.ADSettings().then(() => {
|
||||||
} else {
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
return self.ADisSettings.runner_divs.forEach(async (RunnerX, index) => {
|
}).then((Missions) => {
|
||||||
await $("#" + RunnerX).find(".missionSideBarEntry").each(async (index, elem) => {
|
if (typeof Missions !== "undefined") {
|
||||||
MissionID = $(elem).attr("mission_id");
|
|
||||||
await self.AddMission(MissionID, RunnerX);
|
return Missions.count((count) => {
|
||||||
|
if (count > 0) {
|
||||||
|
return Missions.each((MyMission) => {
|
||||||
|
var MissionElement = $("#mission_" + MyMission.missionID);
|
||||||
|
if (MissionElement.length == 0 || $('#mission_panel_' + MyMission.missionID).hasClass('mission_panel_green')) {
|
||||||
|
// remove
|
||||||
|
console.log("Remove :", MyMission)
|
||||||
|
self.RemoveMissionsFromQueue(MyMission.missionID)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
}
|
}).then(() => {
|
||||||
|
|
||||||
|
if (typeof MissionID != 'undefined') {
|
||||||
|
return self.AddMission(MissionID, Runner);
|
||||||
|
} else {
|
||||||
|
return self.ADisSettings.runner_divs.forEach(async (RunnerX, index) => {
|
||||||
|
await $("#" + RunnerX).find(".missionSideBarEntry").each(async (index, elem) => {
|
||||||
|
MissionID = $(elem).attr("mission_id");
|
||||||
|
await self.AddMission(MissionID, RunnerX);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1343,37 +1366,37 @@ class AutomaticDispose {
|
|||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
return await self.CollectInvolvedVehicles();
|
return await self.CollectInvolvedVehicles();
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.CollectPatients();
|
return await self.CollectPatients();
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessEmergencyMedicalService()
|
return await self.ProcessEmergencyMedicalService()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessFireDepartment()
|
return await self.ProcessFireDepartment()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessPoliceDepartment()
|
return await self.ProcessPoliceDepartment()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessTechnicalEmergencyService()
|
return await self.ProcessTechnicalEmergencyService()
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
if (self.MyRunner == 'os' && self.Vehicles.length > 0){
|
if (self.MyRunner == 'os' && self.Vehicles.length > 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await self.ProcessWaterRescue()
|
return await self.ProcessWaterRescue()
|
||||||
|
|||||||
Reference in New Issue
Block a user