diff --git a/dist/autoloader.js b/dist/autoloader.js index 9c78d37..c663136 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Feb 18 2019 10:29:37 GMT+0100 (CET)*/ +/*Generated on:Mon Feb 18 2019 10:49:44 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 24c5d16..3f85793 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Mon Feb 18 2019 10:29:37 GMT+0100 (CET)*/ +/*Generated on:Mon Feb 18 2019 10:49:44 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -4475,6 +4475,95 @@ //# sourceMappingURL=dexie.js.map + class AutomaticDisposeFaye { + constructor(myFaye) { + let self = this; + myFaye.subscribe('/private-user676600de', function (data) { + eval(self.replaceWithPrefix(data)); + }); + myFaye.subscribe('/private-alliance1749de', function (data) { + eval(self.replaceWithPrefix(data)); + }); + myFaye.subscribe('/allde', function (data) { + eval(self.replaceWithPrefix(data)); + }); + + return new Proxy(this, { + get: function (target, property) { + if (property in target) { + return target[property]; + } + return function () { + var targs = [].slice.call(arguments, 0); + return function noSuchMethod(object, props, args) { + console.log("noSuchMethod", object, props, args); + }(target, property, targs); + }; + } + }); + } + + replaceWithPrefix(data) { + return data.replace('allianceChat', 'this.allianceChat') + .replace('mission_participation_add', 'this.mission_participation_add') + .replace('missionDelete', 'this.missionDelete') + .replace('missionInvolved', 'this.missionInvolved') + .replace('missionMarkerAdd', 'this.missionMarkerAdd') + .replace('patientDelete', 'this.patientDelete') + .replace('patientMarkerAdd', 'this.patientMarkerAdd') + .replace('prisonerMarkerAdd', 'this.prisonerMarkerAdd') + .replace('radioMessage', 'this.radioMessage') + .replace('vehicleDrive', 'this.vehicleDrive') + .replace('vehicleMarkerAdd', 'this.vehicleMarkerAdd') + .replace('user_id', 'window.user_id') + } + + allianceChat(data) { + // {"mission_id":null,"whisper":0,"mission_caption":null,"message":"Hallo zusammen.","alliance_admin":"false","alliance_coadmin":"true","user_id":220122,"username":"Bjoern0203","date":"09:20","date_hidden":"Montag, 18. Februar 2019, 09:20 Uhr"} + console.table(data) + } + mission_participation_add(id) { + // 977642907 + // console.log(id) + } + missionDelete(id) { + // 976896964 + // console.log(id) + } + missionInvolved(id, bool) { + // 977642907, true + // console.log(id, bool) + } + missionMarkerAdd(data) { + // {"sw_start_in":-1,"sw":false,"tv":0,"mtid":0,"kt":false,"alliance_id":1749,"prisoners_count":0,"patients_count":0,"user_id":124796,"address":"Breslauer Stra\u00dfe, 31157 Sarstedt","vehicle_state":2,"missing_text":null,"missing_text_short":null,"id":977627781,"live_current_value":100,"finish_url":"","date_end":1550477815,"date_now":1550477741,"longitude":9.858007,"latitude":52.236176,"tlng":null,"tlat":null,"icon":"fire_gruen","caption":"M\u00fclleimerbrand","captionOld":""} + console.table(data) + } + patientDelete(id) { + // 527339744 + // console.log(id) + } + patientMarkerAdd(data) { + // {"missing_text":"Wir benötigen: RTW","name":"Sandra P.","mission_id":977666364,"id":527340413,"miliseconds_by_percent":0,"target_percent":50,"live_current_value":50} + console.table(data) + } + prisonerMarkerAdd(data) { + // {"name":"Alina W.","mission_id":977267962,"id":35681718} + console.table(data) + } + radioMessage(data) { + // {"mission_id":0,"additionalText":"","user_id":676600,"type":"vehicle_fms","id":15119084,"fms_real":1,"fms":1,"fms_text":"Einsatzbereit \u00fcber Funk","caption":"LF 20/16 - 1"} + console.table(data) + } + vehicleDrive(data) { + // {"b":1450740,"rh":"24f794c42beaa064273e933a62a449a514750fe70066374cb3845ee7c2df62dd","vom":true,"vtid":32,"mid":"977602777","dd":-1,"s":"[[51.7047,9.99451,2.3],[51.70484,9.99445,4.8],[51.70514,9.9944,2.0],[51.70514,9.99427,0.6],[51.70521,9.99427,1.6],[51.70541,9.99428,6.2],[51.70619,9.9942,11.2],[51.70761,9.9941,0.5],[51.70767,9.99409,3.6],[51.70788,9.99485,2.6],[51.70805,9.99538,0.7],[51.7081,9.99553,0.9],[51.7082,9.99557,2.5],[51.70848,9.9957,0.9],[51.70859,9.99568,0.9],[51.70865,9.99555,1.0],[51.70873,9.9954,0.8],[51.70879,9.99529,6.7],[51.70963,9.99519,4.2],[51.71016,9.99524,7.0],[51.71016,9.99668,3.0],[51.70996,9.99718,2.3],[51.70981,9.99758,7.3],[51.7093,9.9988,6.4],[51.70886,9.99988,1.6],[51.7088,10.00019,0.4],[51.70882,10.00027,0.9],[51.70887,10.00043,1.1],[51.70905,10.00043,0.8],[51.70917,10.00044,0.9],[51.70932,10.00044,1.8],[51.70961,10.00044,1.3],[51.70982,10.00045,1.1],[51.70987,10.00066,1.4],[51.70993,10.00094,1.6],[51.71004,10.00121,6.9],[51.71053,10.00242,0]]","fms":3,"fms_real":3,"user_id":220122,"isr":"/images/police2.png","in":"/images/police.png","apng_sonderrechte":"false","ioverwrite":"true","caption":"Rhume 31/05 FuStw","id":9187272,"sr":"0"} + //console.table(data) + } + vehicleMarkerAdd(data) { + // {"bulkInsert":false,"id":12299183,"b":3426848,"fms":5,"fms_real":5,"c":"[BS] DRK 40-83-11 (RTW)","t":28} + //console.table(data) + } + } + class AutomaticDispose { // Variablen @@ -17816,7 +17905,7 @@ } } - constructor() { + constructor(myFaye) { let self = this; self.MaxVehicleID = 86 self.MissionType = null @@ -17970,20 +18059,7 @@ } }); - - return new Proxy(this, { - get: function (target, property) { - if (property in target) { - return target[property]; - } - return function () { - var targs = [].slice.call(arguments, 0); - return function noSuchMethod(object, props, args) { - console.log("noSuchMethod", object, props, args); - }(target, property, targs); - }; - } - }); + new AutomaticDisposeFaye(myFaye) } includesString(string1, string2) { @@ -20527,9 +20603,9 @@ $(document).ready(function () { var $div = $("a.missing_vehicles_load:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); - var isHidden = $div.is(':hidden'); + //var isHidden = $div.is(':hidden'); var ppppp = undefined; - var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); + //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); //console.log('DEBUG::', MissionID, $div, isHidden); if ($div.length >= 1) { @@ -20545,7 +20621,7 @@ } ppppp = setTimeout(function () { window. //console.log('DEBUG:::', 'Start Observer AutomaticDispose()') - window.AutomaticDisposeCall = new AutomaticDispose(); + window.AutomaticDisposeCall = new AutomaticDispose(window.faye); }, 250); } } else if (mutation.attributeName === "href") { @@ -20568,6 +20644,6 @@ $div.click(); } else { window. //console.log('DEBUG:::', 'Start AutomaticDispose()') - window.AutomaticDisposeCall = new AutomaticDispose(); + window.AutomaticDisposeCall = new AutomaticDispose(window.faye); } }); \ No newline at end of file diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 1492f88..c41114a 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1,5 +1,94 @@ //=require ../node_modules/dexie/dist/dexie.js + class AutomaticDisposeFaye { + constructor(myFaye) { + let self = this; + myFaye.subscribe('/private-user676600de', function (data) { + eval(self.replaceWithPrefix(data)); + }); + myFaye.subscribe('/private-alliance1749de', function (data) { + eval(self.replaceWithPrefix(data)); + }); + myFaye.subscribe('/allde', function (data) { + eval(self.replaceWithPrefix(data)); + }); + + return new Proxy(this, { + get: function (target, property) { + if (property in target) { + return target[property]; + } + return function () { + var targs = [].slice.call(arguments, 0); + return function noSuchMethod(object, props, args) { + console.log("noSuchMethod", object, props, args); + }(target, property, targs); + }; + } + }); + } + + replaceWithPrefix(data) { + return data.replace('allianceChat', 'this.allianceChat') + .replace('mission_participation_add', 'this.mission_participation_add') + .replace('missionDelete', 'this.missionDelete') + .replace('missionInvolved', 'this.missionInvolved') + .replace('missionMarkerAdd', 'this.missionMarkerAdd') + .replace('patientDelete', 'this.patientDelete') + .replace('patientMarkerAdd', 'this.patientMarkerAdd') + .replace('prisonerMarkerAdd', 'this.prisonerMarkerAdd') + .replace('radioMessage', 'this.radioMessage') + .replace('vehicleDrive', 'this.vehicleDrive') + .replace('vehicleMarkerAdd', 'this.vehicleMarkerAdd') + .replace('user_id', 'window.user_id') + } + + allianceChat(data) { + // {"mission_id":null,"whisper":0,"mission_caption":null,"message":"Hallo zusammen.","alliance_admin":"false","alliance_coadmin":"true","user_id":220122,"username":"Bjoern0203","date":"09:20","date_hidden":"Montag, 18. Februar 2019, 09:20 Uhr"} + console.table(data) + } + mission_participation_add(id) { + // 977642907 + // console.log(id) + } + missionDelete(id) { + // 976896964 + // console.log(id) + } + missionInvolved(id, bool) { + // 977642907, true + // console.log(id, bool) + } + missionMarkerAdd(data) { + // {"sw_start_in":-1,"sw":false,"tv":0,"mtid":0,"kt":false,"alliance_id":1749,"prisoners_count":0,"patients_count":0,"user_id":124796,"address":"Breslauer Stra\u00dfe, 31157 Sarstedt","vehicle_state":2,"missing_text":null,"missing_text_short":null,"id":977627781,"live_current_value":100,"finish_url":"","date_end":1550477815,"date_now":1550477741,"longitude":9.858007,"latitude":52.236176,"tlng":null,"tlat":null,"icon":"fire_gruen","caption":"M\u00fclleimerbrand","captionOld":""} + console.table(data) + } + patientDelete(id) { + // 527339744 + // console.log(id) + } + patientMarkerAdd(data) { + // {"missing_text":"Wir benötigen: RTW","name":"Sandra P.","mission_id":977666364,"id":527340413,"miliseconds_by_percent":0,"target_percent":50,"live_current_value":50} + console.table(data) + } + prisonerMarkerAdd(data) { + // {"name":"Alina W.","mission_id":977267962,"id":35681718} + console.table(data) + } + radioMessage(data) { + // {"mission_id":0,"additionalText":"","user_id":676600,"type":"vehicle_fms","id":15119084,"fms_real":1,"fms":1,"fms_text":"Einsatzbereit \u00fcber Funk","caption":"LF 20/16 - 1"} + console.table(data) + } + vehicleDrive(data) { + // {"b":1450740,"rh":"24f794c42beaa064273e933a62a449a514750fe70066374cb3845ee7c2df62dd","vom":true,"vtid":32,"mid":"977602777","dd":-1,"s":"[[51.7047,9.99451,2.3],[51.70484,9.99445,4.8],[51.70514,9.9944,2.0],[51.70514,9.99427,0.6],[51.70521,9.99427,1.6],[51.70541,9.99428,6.2],[51.70619,9.9942,11.2],[51.70761,9.9941,0.5],[51.70767,9.99409,3.6],[51.70788,9.99485,2.6],[51.70805,9.99538,0.7],[51.7081,9.99553,0.9],[51.7082,9.99557,2.5],[51.70848,9.9957,0.9],[51.70859,9.99568,0.9],[51.70865,9.99555,1.0],[51.70873,9.9954,0.8],[51.70879,9.99529,6.7],[51.70963,9.99519,4.2],[51.71016,9.99524,7.0],[51.71016,9.99668,3.0],[51.70996,9.99718,2.3],[51.70981,9.99758,7.3],[51.7093,9.9988,6.4],[51.70886,9.99988,1.6],[51.7088,10.00019,0.4],[51.70882,10.00027,0.9],[51.70887,10.00043,1.1],[51.70905,10.00043,0.8],[51.70917,10.00044,0.9],[51.70932,10.00044,1.8],[51.70961,10.00044,1.3],[51.70982,10.00045,1.1],[51.70987,10.00066,1.4],[51.70993,10.00094,1.6],[51.71004,10.00121,6.9],[51.71053,10.00242,0]]","fms":3,"fms_real":3,"user_id":220122,"isr":"/images/police2.png","in":"/images/police.png","apng_sonderrechte":"false","ioverwrite":"true","caption":"Rhume 31/05 FuStw","id":9187272,"sr":"0"} + //console.table(data) + } + vehicleMarkerAdd(data) { + // {"bulkInsert":false,"id":12299183,"b":3426848,"fms":5,"fms_real":5,"c":"[BS] DRK 40-83-11 (RTW)","t":28} + //console.table(data) + } + } + class AutomaticDispose { // Variablen @@ -17,7 +106,7 @@ } } - constructor() { + constructor(myFaye) { let self = this; self.MaxVehicleID = 86 self.MissionType = null @@ -171,20 +260,7 @@ } }); - - return new Proxy(this, { - get: function (target, property) { - if (property in target) { - return target[property]; - } - return function () { - var targs = [].slice.call(arguments, 0); - return function noSuchMethod(object, props, args) { - console.log("noSuchMethod", object, props, args); - }(target, property, targs); - }; - } - }); + new AutomaticDisposeFaye(myFaye) } includesString(string1, string2) { @@ -2494,9 +2570,9 @@ $(document).ready(function () { var $div = $("a.missing_vehicles_load:contains('Fahrzeuganzeige begrenzt! Fehlende Fahrzeuge laden!')"); - var isHidden = $div.is(':hidden'); + //var isHidden = $div.is(':hidden'); var ppppp = undefined; - var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); + //var MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); //console.log('DEBUG::', MissionID, $div, isHidden); if ($div.length >= 1) { @@ -2512,7 +2588,7 @@ } ppppp = setTimeout(function () { window. //console.log('DEBUG:::', 'Start Observer AutomaticDispose()') - window.AutomaticDisposeCall = new AutomaticDispose(); + window.AutomaticDisposeCall = new AutomaticDispose(window.faye); }, 250); } } else if (mutation.attributeName === "href") { @@ -2535,6 +2611,6 @@ $div.click(); } else { window. //console.log('DEBUG:::', 'Start AutomaticDispose()') - window.AutomaticDisposeCall = new AutomaticDispose(); + window.AutomaticDisposeCall = new AutomaticDispose(window.faye); } }); \ No newline at end of file