This commit is contained in:
2018-12-19 18:28:19 +01:00
parent 36ddb429fa
commit 03acece31b
3 changed files with 72 additions and 24 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Tue Dec 18 2018 02:47:49 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 18:28:18 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();
+46 -22
View File
@@ -1,4 +1,4 @@
/*Generated on:Tue Dec 18 2018 02:47:49 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 18:28:18 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -17038,20 +17038,20 @@ class AutomaticDispose {
self.Vehicles = {} self.Vehicles = {}
self.Patients = {} self.Patients = {}
this.ADis_MyHead = document.getElementsByTagName('head')[0]; self.ADis_MyHead = document.getElementsByTagName('head')[0];
this.ADis_MyBody = document.getElementsByTagName('body')[0]; self.ADis_MyBody = document.getElementsByTagName('body')[0];
// - // -
// - Sprechwunsch Variablen // - Sprechwunsch Variablen
// - // -
this.Jails = []; self.Jails = [];
this.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g; self.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g;
this.Hospitals = []; self.Hospitals = [];
this.RescueVehicleFrameWatchDog = null; self.RescueVehicleFrameWatchDog = null;
this.PoliceVehicleFrameWatchDog = null; self.PoliceVehicleFrameWatchDog = null;
this.ADisDB = new Dexie('LSS_AutomaticDispo'); self.ADisDB = new Dexie('LSS_AutomaticDispo');
this.ADisDB.version(1).stores({ self.ADisDB.version(1).stores({
/** /**
* AvailabelMissions * AvailabelMissions
* - missionID * - missionID
@@ -17096,7 +17096,7 @@ class AutomaticDispose {
*/ */
ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]" ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]"
}); });
this.ADisDB.on("populate", () => { self.ADisDB.on("populate", () => {
self.ADisDB.ADisSettings.add({ self.ADisDB.ADisSettings.add({
name: "Krankentransport-Automatic", name: "Krankentransport-Automatic",
value: 'true' value: 'true'
@@ -17118,10 +17118,10 @@ class AutomaticDispose {
value: 'false' value: 'false'
}); });
}); });
this.ADisDB.open().catch((err) => { self.ADisDB.open().catch((err) => {
console.error(err.stack || err); console.error(err.stack || err);
}); });
this.ADisDB.on("ready", async () => { self.ADisDB.on("ready", async () => {
self.adis_settings = { self.adis_settings = {
'Krankentransport-Automatic': false, 'Krankentransport-Automatic': false,
'Sprechwunsch-Automatic': false, 'Sprechwunsch-Automatic': false,
@@ -17242,7 +17242,7 @@ class AutomaticDispose {
OpenNextRescueSprechwunsch() { OpenNextRescueSprechwunsch() {
let self = this; let self = this;
this.ADSettings().then((setting) => { self.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'
@@ -17372,7 +17372,7 @@ class AutomaticDispose {
}); });
self.Hospitals.reverse(); self.Hospitals.reverse();
this.Send_Vehicle_To_Hospital() self.Send_Vehicle_To_Hospital()
} }
// Krankenhaus einlieferung // Krankenhaus einlieferung
@@ -17432,7 +17432,7 @@ class AutomaticDispose {
OpenNextPoliceSprechwunsch() { OpenNextPoliceSprechwunsch() {
let self = this; let self = this;
this.ADSettings().then((setting) => { 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'
@@ -17635,7 +17635,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"));
@@ -17685,7 +17685,7 @@ class AutomaticDispose {
var styleElement = document.createElement("link"); var styleElement = document.createElement("link");
styleElement.rel = "stylesheet"; styleElement.rel = "stylesheet";
styleElement.href = "https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700"; styleElement.href = "https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700";
this.ADis_MyHead.appendChild(styleElement); self.ADis_MyHead.appendChild(styleElement);
// - // -
// - FontAwesome 5 // - FontAwesome 5
@@ -17693,7 +17693,7 @@ class AutomaticDispose {
var scriptElement = document.createElement("script"); var scriptElement = document.createElement("script");
scriptElement.type = "text/javascript"; scriptElement.type = "text/javascript";
scriptElement.src = "https://use.fontawesome.com/releases/v5.5.0/js/all.js"; scriptElement.src = "https://use.fontawesome.com/releases/v5.5.0/js/all.js";
this.ADis_MyHead.appendChild(scriptElement); self.ADis_MyHead.appendChild(scriptElement);
// - // -
// - Navbar Dashboard // - Navbar Dashboard
@@ -17702,8 +17702,8 @@ class AutomaticDispose {
styleElement.rel = "stylesheet"; styleElement.rel = "stylesheet";
styleElement.type = "text/css"; styleElement.type = "text/css";
styleElement.media = "screen"; styleElement.media = "screen";
styleElement.href = this.ADisSettings.url + this.ADisSettings.branch + "/style/interface.css"; styleElement.href = self.ADisSettings.url + self.ADisSettings.branch + "/style/interface.css";
this.ADis_MyHead.appendChild(styleElement); self.ADis_MyHead.appendChild(styleElement);
// Create Dashboard // Create Dashboard
$('#news_li').before('<li id="adis-nav-item"></li>'); $('#news_li').before('<li id="adis-nav-item"></li>');
@@ -19638,4 +19638,28 @@ class AutomaticDispose {
} }
window.AutomaticDisposeCall = new 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
});
$div.click();
} else {
setTimeout(function () {
window.AutomaticDisposeCall = new AutomaticDispose();
}, 500);
}
});
+25 -1
View File
@@ -2397,4 +2397,28 @@ class AutomaticDispose {
} }
window.AutomaticDisposeCall = new 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
});
$div.click();
} else {
setTimeout(function () {
window.AutomaticDisposeCall = new AutomaticDispose();
}, 500);
}
});