diff --git a/dist/autoloader.js b/dist/autoloader.js index 7c47bd8..2ce932c 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -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_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 be9ebee..14a87ee 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -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 * =============================================== @@ -17038,20 +17038,20 @@ class AutomaticDispose { self.Vehicles = {} self.Patients = {} - this.ADis_MyHead = document.getElementsByTagName('head')[0]; - this.ADis_MyBody = document.getElementsByTagName('body')[0]; + self.ADis_MyHead = document.getElementsByTagName('head')[0]; + self.ADis_MyBody = document.getElementsByTagName('body')[0]; // - // - Sprechwunsch Variablen // - - this.Jails = []; - this.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g; - this.Hospitals = []; - this.RescueVehicleFrameWatchDog = null; - this.PoliceVehicleFrameWatchDog = null; + self.Jails = []; + self.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g; + self.Hospitals = []; + self.RescueVehicleFrameWatchDog = null; + self.PoliceVehicleFrameWatchDog = null; - this.ADisDB = new Dexie('LSS_AutomaticDispo'); - this.ADisDB.version(1).stores({ + self.ADisDB = new Dexie('LSS_AutomaticDispo'); + self.ADisDB.version(1).stores({ /** * AvailabelMissions * - missionID @@ -17096,7 +17096,7 @@ class AutomaticDispose { */ 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({ name: "Krankentransport-Automatic", value: 'true' @@ -17118,10 +17118,10 @@ class AutomaticDispose { value: 'false' }); }); - this.ADisDB.open().catch((err) => { + self.ADisDB.open().catch((err) => { console.error(err.stack || err); }); - this.ADisDB.on("ready", async () => { + self.ADisDB.on("ready", async () => { self.adis_settings = { 'Krankentransport-Automatic': false, 'Sprechwunsch-Automatic': false, @@ -17242,7 +17242,7 @@ class AutomaticDispose { OpenNextRescueSprechwunsch() { let self = this; - this.ADSettings().then((setting) => { + self.ADSettings().then((setting) => { if (setting['Sprechwunsch-Automatic'] == 'true') { return self.ADisDB.ADisSprechwunsch.where({ done: 'false' @@ -17372,7 +17372,7 @@ class AutomaticDispose { }); self.Hospitals.reverse(); - this.Send_Vehicle_To_Hospital() + self.Send_Vehicle_To_Hospital() } // Krankenhaus einlieferung @@ -17432,7 +17432,7 @@ class AutomaticDispose { OpenNextPoliceSprechwunsch() { let self = this; - this.ADSettings().then((setting) => { + self.ADSettings().then((setting) => { if (setting['Sprechwunsch-Automatic'] == 'true') { return self.ADisDB.ADisSprechwunschPolice.where({ done: 'false' @@ -17635,7 +17635,7 @@ class AutomaticDispose { self.Jails.reverse(); if (self.Jails.length > 0) { - this.Send_Vehicle_To_Jail() + self.Send_Vehicle_To_Jail() } else { $("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => { var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id")); @@ -17685,7 +17685,7 @@ class AutomaticDispose { var styleElement = document.createElement("link"); styleElement.rel = "stylesheet"; 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 @@ -17693,7 +17693,7 @@ class AutomaticDispose { var scriptElement = document.createElement("script"); scriptElement.type = "text/javascript"; 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 @@ -17702,8 +17702,8 @@ class AutomaticDispose { styleElement.rel = "stylesheet"; styleElement.type = "text/css"; styleElement.media = "screen"; - styleElement.href = this.ADisSettings.url + this.ADisSettings.branch + "/style/interface.css"; - this.ADis_MyHead.appendChild(styleElement); + styleElement.href = self.ADisSettings.url + self.ADisSettings.branch + "/style/interface.css"; + self.ADis_MyHead.appendChild(styleElement); // Create Dashboard $('#news_li').before('
'); @@ -19638,4 +19638,28 @@ class AutomaticDispose { } -window.AutomaticDisposeCall = new AutomaticDispose(); \ No newline at end of file +$(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); + } +}); \ No newline at end of file diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 6e53704..02fa340 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -2397,4 +2397,28 @@ class AutomaticDispose { } -window.AutomaticDisposeCall = new AutomaticDispose(); \ No newline at end of file +$(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); + } +}); \ No newline at end of file