v2 transaction

This commit is contained in:
2018-12-19 17:27:30 +01:00
parent fdffe19a11
commit efd95eacab
3 changed files with 42 additions and 42 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 17:18:57 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 17:27:29 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();
+21 -21
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 17:18:57 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 17:27:29 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -17203,7 +17203,7 @@ class AutomaticDispose {
RemovePoliceSprechwunschFromQueue(WunschID) { RemovePoliceSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADisDB.ADisSprechwunschPolice.where({ return await this.ADisDB.ADisSprechwunschPolice.where({
missionID: WunschID missionID: WunschID
}).delete(); }).delete();
@@ -17214,7 +17214,7 @@ class AutomaticDispose {
RemoveRescueSprechwunschFromQueue(WunschID) { RemoveRescueSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return this.ADisDB.ADisSprechwunsch.where({ return await this.ADisDB.ADisSprechwunsch.where({
vehicleID: WunschID vehicleID: WunschID
}).delete(); }).delete();
@@ -17258,8 +17258,8 @@ class AutomaticDispose {
OpenNextRescueSprechwunsch() { OpenNextRescueSprechwunsch() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return await self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
this.ADSettings().then((setting) => { return await this.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunsch.where({ return self.ADisDB.ADisSprechwunsch.where({
done: 'false' done: 'false'
@@ -17267,9 +17267,9 @@ class AutomaticDispose {
} }
}).then((Wunsch) => { }).then((Wunsch) => {
if (Wunsch !== undefined) { if (Wunsch !== undefined) {
Wunsch.each((myWunsch) => { Wunsch.each(async (myWunsch) => {
let VehicleID = myWunsch.vehicleID; let VehicleID = myWunsch.vehicleID;
self.UpdateRescueSprechwunschToDone(VehicleID).then(() => { await self.UpdateRescueSprechwunschToDone(VehicleID).then(() => {
if ($("#adis-sprechwunsch-rescue-frame").attr("vehicle_id") == "empty") { if ($("#adis-sprechwunsch-rescue-frame").attr("vehicle_id") == "empty") {
$("#adis-sprechwunsch-rescue-frame").attr("src", "https://www.leitstellenspiel.de/vehicles/" + VehicleID); $("#adis-sprechwunsch-rescue-frame").attr("src", "https://www.leitstellenspiel.de/vehicles/" + VehicleID);
$("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", VehicleID); $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", VehicleID);
@@ -17294,7 +17294,7 @@ class AutomaticDispose {
AddRescueSprechwunschToQueue(WunschID) { AddRescueSprechwunschToQueue(WunschID) {
let self = this let self = this
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return self.ADisDB.ADisSprechwunsch.put({ return await self.ADisDB.ADisSprechwunsch.put({
vehicleID: WunschID, vehicleID: WunschID,
done: 'false' done: 'false'
}) })
@@ -17307,7 +17307,7 @@ class AutomaticDispose {
UpdateRescueSprechwunschToDone(WunschID) { UpdateRescueSprechwunschToDone(WunschID) {
let self = this let self = this
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return self.ADisDB.ADisSprechwunsch.put({ return await self.ADisDB.ADisSprechwunsch.put({
vehicleID: WunschID, vehicleID: WunschID,
done: 'true' done: 'true'
}) })
@@ -17425,7 +17425,7 @@ class AutomaticDispose {
CollectPoliceSprechwuensche() { CollectPoliceSprechwuensche() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
new Promise(async (resolve, reject) => { await new Promise(async (resolve, reject) => {
await self.ADisDB.ADisSprechwunschPolice.where({ await self.ADisDB.ADisSprechwunschPolice.where({
done: 'false' done: 'false'
}).each((myWunsch) => { }).each((myWunsch) => {
@@ -17437,14 +17437,14 @@ class AutomaticDispose {
return resolve(); return resolve();
}).then(() => { }).then(() => {
var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible'); var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible');
return MOIODOS.each((_, elem) => { return MOIODOS.each(async (_, elem) => {
if ($(elem).text().match(/Gefangene sollen abtransportiert werden/g)) { if ($(elem).text().match(/Gefangene sollen abtransportiert werden/g)) {
var MissionID = $(elem).attr("mission_id"); var MissionID = $(elem).attr("mission_id");
self.AddPoliceSprechwunschToQueue(MissionID); await self.AddPoliceSprechwunschToQueue(MissionID);
} }
}); });
}).then(() => { }).then(() => {
$("#building_list").find(".building_list_vehicle_element").each((_, elem) => { $("#building_list").find(".building_list_vehicle_element").each(async (_, elem) => {
var VehicleStatus = $(elem).find(".building_list_fms").text(); var VehicleStatus = $(elem).find(".building_list_fms").text();
var VehicleType = Number(parseInt($(elem).find("a").attr("vehicle_type_id"))); var VehicleType = Number(parseInt($(elem).find("a").attr("vehicle_type_id")));
var VehicleID = $(elem).attr("vehicle_id"); var VehicleID = $(elem).attr("vehicle_id");
@@ -17454,7 +17454,7 @@ class AutomaticDispose {
var _meap = String(map2.attr('href')); var _meap = String(map2.attr('href'));
var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1); var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1);
if (MissionID) { if (MissionID) {
self.AddPoliceSprechwunschToQueue(MissionID); await self.AddPoliceSprechwunschToQueue(MissionID);
} }
} }
} }
@@ -17468,7 +17468,7 @@ class AutomaticDispose {
OpenNextPoliceSprechwunsch() { OpenNextPoliceSprechwunsch() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADSettings().then((setting) => { return await self.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunschPolice.where({ return self.ADisDB.ADisSprechwunschPolice.where({
done: 'false' done: 'false'
@@ -17476,16 +17476,16 @@ class AutomaticDispose {
} }
}).then((Wunsch) => { }).then((Wunsch) => {
if (Wunsch !== undefined) { if (Wunsch !== undefined) {
Wunsch.each((myWunsch) => { Wunsch.each(async (myWunsch) => {
let MissionID = myWunsch.missionID; let MissionID = myWunsch.missionID;
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => { await self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") { if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID); $("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID); $("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) { self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) {
let self = this; let self = this;
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
$("#adis-sprechwunsch-police-frame").attr("src", ""); $("#adis-sprechwunsch-police-frame").attr("src", "");
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
}); });
@@ -17503,7 +17503,7 @@ class AutomaticDispose {
AddPoliceSprechwunschToQueue(WunschID) { AddPoliceSprechwunschToQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADisDB.ADisSprechwunschPolice.put({ return await self.ADisDB.ADisSprechwunschPolice.put({
missionID: WunschID, missionID: WunschID,
done: 'false' done: 'false'
}) })
@@ -17515,7 +17515,7 @@ class AutomaticDispose {
UpdatePoliceSprechwunschToDone(WunschID) { UpdatePoliceSprechwunschToDone(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return self.ADisDB.ADisSprechwunschPolice.put({ return await self.ADisDB.ADisSprechwunschPolice.put({
missionID: WunschID, missionID: WunschID,
done: 'true' done: 'true'
}) })
@@ -17685,7 +17685,7 @@ class AutomaticDispose {
self.Jails.reverse(); self.Jails.reverse();
if (self.Jails.length > 0) { if (self.Jails.length > 0) {
this.Send_Vehicle_To_Jail() self.Send_Vehicle_To_Jail()
} else { } else {
$("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => { $("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => {
var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id")); var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id"));
+20 -20
View File
@@ -196,7 +196,7 @@ class AutomaticDispose {
RemovePoliceSprechwunschFromQueue(WunschID) { RemovePoliceSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADisDB.ADisSprechwunschPolice.where({ return await this.ADisDB.ADisSprechwunschPolice.where({
missionID: WunschID missionID: WunschID
}).delete(); }).delete();
@@ -207,7 +207,7 @@ class AutomaticDispose {
RemoveRescueSprechwunschFromQueue(WunschID) { RemoveRescueSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return this.ADisDB.ADisSprechwunsch.where({ return await this.ADisDB.ADisSprechwunsch.where({
vehicleID: WunschID vehicleID: WunschID
}).delete(); }).delete();
@@ -251,8 +251,8 @@ class AutomaticDispose {
OpenNextRescueSprechwunsch() { OpenNextRescueSprechwunsch() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return await self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
this.ADSettings().then((setting) => { return await this.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunsch.where({ return self.ADisDB.ADisSprechwunsch.where({
done: 'false' done: 'false'
@@ -260,9 +260,9 @@ class AutomaticDispose {
} }
}).then((Wunsch) => { }).then((Wunsch) => {
if (Wunsch !== undefined) { if (Wunsch !== undefined) {
Wunsch.each((myWunsch) => { Wunsch.each(async (myWunsch) => {
let VehicleID = myWunsch.vehicleID; let VehicleID = myWunsch.vehicleID;
self.UpdateRescueSprechwunschToDone(VehicleID).then(() => { await self.UpdateRescueSprechwunschToDone(VehicleID).then(() => {
if ($("#adis-sprechwunsch-rescue-frame").attr("vehicle_id") == "empty") { if ($("#adis-sprechwunsch-rescue-frame").attr("vehicle_id") == "empty") {
$("#adis-sprechwunsch-rescue-frame").attr("src", "https://www.leitstellenspiel.de/vehicles/" + VehicleID); $("#adis-sprechwunsch-rescue-frame").attr("src", "https://www.leitstellenspiel.de/vehicles/" + VehicleID);
$("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", VehicleID); $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", VehicleID);
@@ -287,7 +287,7 @@ class AutomaticDispose {
AddRescueSprechwunschToQueue(WunschID) { AddRescueSprechwunschToQueue(WunschID) {
let self = this let self = this
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return self.ADisDB.ADisSprechwunsch.put({ return await self.ADisDB.ADisSprechwunsch.put({
vehicleID: WunschID, vehicleID: WunschID,
done: 'false' done: 'false'
}) })
@@ -300,7 +300,7 @@ class AutomaticDispose {
UpdateRescueSprechwunschToDone(WunschID) { UpdateRescueSprechwunschToDone(WunschID) {
let self = this let self = this
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return self.ADisDB.ADisSprechwunsch.put({ return await self.ADisDB.ADisSprechwunsch.put({
vehicleID: WunschID, vehicleID: WunschID,
done: 'true' done: 'true'
}) })
@@ -418,7 +418,7 @@ class AutomaticDispose {
CollectPoliceSprechwuensche() { CollectPoliceSprechwuensche() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
new Promise(async (resolve, reject) => { await new Promise(async (resolve, reject) => {
await self.ADisDB.ADisSprechwunschPolice.where({ await self.ADisDB.ADisSprechwunschPolice.where({
done: 'false' done: 'false'
}).each((myWunsch) => { }).each((myWunsch) => {
@@ -430,14 +430,14 @@ class AutomaticDispose {
return resolve(); return resolve();
}).then(() => { }).then(() => {
var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible'); var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible');
return MOIODOS.each((_, elem) => { return MOIODOS.each(async (_, elem) => {
if ($(elem).text().match(/Gefangene sollen abtransportiert werden/g)) { if ($(elem).text().match(/Gefangene sollen abtransportiert werden/g)) {
var MissionID = $(elem).attr("mission_id"); var MissionID = $(elem).attr("mission_id");
self.AddPoliceSprechwunschToQueue(MissionID); await self.AddPoliceSprechwunschToQueue(MissionID);
} }
}); });
}).then(() => { }).then(() => {
$("#building_list").find(".building_list_vehicle_element").each((_, elem) => { $("#building_list").find(".building_list_vehicle_element").each(async (_, elem) => {
var VehicleStatus = $(elem).find(".building_list_fms").text(); var VehicleStatus = $(elem).find(".building_list_fms").text();
var VehicleType = Number(parseInt($(elem).find("a").attr("vehicle_type_id"))); var VehicleType = Number(parseInt($(elem).find("a").attr("vehicle_type_id")));
var VehicleID = $(elem).attr("vehicle_id"); var VehicleID = $(elem).attr("vehicle_id");
@@ -447,7 +447,7 @@ class AutomaticDispose {
var _meap = String(map2.attr('href')); var _meap = String(map2.attr('href'));
var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1); var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1);
if (MissionID) { if (MissionID) {
self.AddPoliceSprechwunschToQueue(MissionID); await self.AddPoliceSprechwunschToQueue(MissionID);
} }
} }
} }
@@ -461,7 +461,7 @@ class AutomaticDispose {
OpenNextPoliceSprechwunsch() { OpenNextPoliceSprechwunsch() {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADSettings().then((setting) => { return await self.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunschPolice.where({ return self.ADisDB.ADisSprechwunschPolice.where({
done: 'false' done: 'false'
@@ -469,16 +469,16 @@ class AutomaticDispose {
} }
}).then((Wunsch) => { }).then((Wunsch) => {
if (Wunsch !== undefined) { if (Wunsch !== undefined) {
Wunsch.each((myWunsch) => { Wunsch.each(async (myWunsch) => {
let MissionID = myWunsch.missionID; let MissionID = myWunsch.missionID;
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => { await self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") { if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID); $("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID); $("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) { self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) {
let self = this; let self = this;
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
$("#adis-sprechwunsch-police-frame").attr("src", ""); $("#adis-sprechwunsch-police-frame").attr("src", "");
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
}); });
@@ -496,7 +496,7 @@ class AutomaticDispose {
AddPoliceSprechwunschToQueue(WunschID) { AddPoliceSprechwunschToQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return this.ADisDB.ADisSprechwunschPolice.put({ return await self.ADisDB.ADisSprechwunschPolice.put({
missionID: WunschID, missionID: WunschID,
done: 'false' done: 'false'
}) })
@@ -508,7 +508,7 @@ class AutomaticDispose {
UpdatePoliceSprechwunschToDone(WunschID) { UpdatePoliceSprechwunschToDone(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return self.ADisDB.ADisSprechwunschPolice.put({ return await self.ADisDB.ADisSprechwunschPolice.put({
missionID: WunschID, missionID: WunschID,
done: 'true' done: 'true'
}) })
@@ -678,7 +678,7 @@ class AutomaticDispose {
self.Jails.reverse(); self.Jails.reverse();
if (self.Jails.length > 0) { if (self.Jails.length > 0) {
this.Send_Vehicle_To_Jail() self.Send_Vehicle_To_Jail()
} else { } else {
$("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => { $("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => {
var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id")); var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id"));