diff --git a/dist/autoloader.js b/dist/autoloader.js index 7dded0c..74b647e 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Tue Dec 11 2018 19:22:03 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 12 2018 22:39:11 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 59fdeba..6db2633 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Tue Dec 11 2018 19:22:03 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 12 2018 22:39:11 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18974,10 +18974,11 @@ class AutomaticDispose { setTimeout(() => { self.UpdateMissionsToDone(self.MissionID).then(async () => { tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`); - if (window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']").length > 0 && self.MissionConfig.share) { + if (window.$("#mission-form > div.pull-right > div:nth-child(1) > div > a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { window.$('input[type=checkbox]').prop('checked', false); await self.WorkVerbandMission(true); - window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']")[0].click(); + window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') + window.$("#mission-form > div.pull-right > div:nth-child(1) > div > a.btn.btn-success.btn-sm.alert_notify_alliance").click(); } else { window.$('#mission_alarm_btn').click(); } diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 26efbb4..b93d9b8 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1357,10 +1357,11 @@ class AutomaticDispose { setTimeout(() => { self.UpdateMissionsToDone(self.MissionID).then(async () => { tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`); - if (window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']").length > 0 && self.MissionConfig.share) { + if (window.$("#mission-form > div.pull-right > div:nth-child(1) > div > a.btn.btn-success.btn-sm.alert_notify_alliance").length > 0 && self.MissionConfig.share) { window.$('input[type=checkbox]').prop('checked', false); await self.WorkVerbandMission(true); - window.$("a[title='Alarmieren, im Verband freigeben und nächsten Einsatz aufrufen']")[0].click(); + window.$('#allianceShareText').val('Kein RD, die Patiernten gehören mir! Anonsten kann nach 2h geschlossen werden. Danke für die Aufmerksamkeit!') + window.$("#mission-form > div.pull-right > div:nth-child(1) > div > a.btn.btn-success.btn-sm.alert_notify_alliance").click(); } else { window.$('#mission_alarm_btn').click(); } diff --git a/src/watch_missions.js b/src/watch_missions.js index d310827..82e4dc9 100644 --- a/src/watch_missions.js +++ b/src/watch_missions.js @@ -8,9 +8,9 @@ class WatchMissions { - constructor(){ + constructor() { let self = this; - self.DB = new Dexie('LSS_AutomaticDispo'); + self.DB = new Dexie('LSS_WatchMissions'); self.DB.version(1).stores({ @@ -18,6 +18,7 @@ class WatchMissions { * Missions to Watch * - missionID - Mission ID that should be watched. * - limit - If the Mission turns green more than 6 times, no more requests will be sent. + * - data - {name, datetime, onsite{ username:{ cars: [ {name, type} ] } } } */ Missions: "++missionID" }); @@ -28,28 +29,214 @@ class WatchMissions { // index page if (window.location.pathname === "/" || window.location.pathname === "/#" || window.location.pathname === "/#_=_") { self.RegisterIndexPage(); - } + } // mission page else if (window.location.pathname.indexOf("/missions/") !== -1 && window.name == 'watchMission') { self.RegisterMissionPage(); } - - }) } get RandomTime() { const max = 6; const min = 1; - return Math.floor((Math.random()*(max-min+1)+min)*1000); + return Math.floor((Math.random() * (max - min + 1) + min) * 1000); } RegisterIndexPage() { + let self = this; + // - + // - Google Font + // - + 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); + // - + // - FontAwesome 5 + // - + 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); + + // - + // - Navbar Dashboard + // - + var styleElement = document.createElement("link"); + 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); + + // Create Dashboard + $('#news_li').before('
'); + $('#adis-nav-item').html(`/***ADis_Navbar***/0`) + $("#adis-dashboard").css({ + display: "none", + opacity: "0" + }); } - RegisterMissionPage() { + // Generate HTML Table + // Builds the HTML Table out of myList json data from Ivy restful service. + buildHtmlTable() { + const self = this; + self.addTable(myList, $("#excelDataTable")); + } + addTable(list, appendObj) { + const self = this; + appendObj.html(''); + var columns = self.addAllColumnHeaders(list, appendObj); + + for (var i = 0; i < list.length; i++) { + var row$ = $('