diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/dist/autoloader.js b/dist/autoloader.js index 9686cf1..1bc8de8 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Nov 28 2018 19:29:19 GMT+0100 (CET)*/ +/*Generated on:Wed Nov 28 2018 20:04:00 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 8c8fe29..97a9318 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Nov 28 2018 19:29:19 GMT+0100 (CET)*/ +/*Generated on:Wed Nov 28 2018 20:04:00 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -4556,23 +4556,23 @@ class AutomaticDispose { ADisMissionsVerbandEvent: "++missionID,type,name,last_check,next_check,available,done", }); this.ADisDB.on("populate", function () { - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Krankentransport-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Sprechwunsch-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "MissionsOwn-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Alliance-Automatic", value: 'false' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "AllianceEvent-Automatic", value: 'false' }); @@ -7090,6 +7090,7 @@ class AutomaticDispose { // - Index Page Loader // - IndexPage() { + let that = this; // - // - Google Font // - @@ -7298,14 +7299,11 @@ class AutomaticDispose { box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.32); transition: all 200ms; } - - -`) - $("#adis-dashboard").css({ - display: "none", - opacity: "0" - }); + that.UIUpdateSettings(); // Create Iframes $("body").append('
'); @@ -7495,6 +7447,45 @@ class AutomaticDispose { }); } + // + // Display Settings + // + + UIUpdateSettings() { + this.ADisDB.ADisSettings.each((setting) => { + if (setting.name == "Krankentransport-Automatic") { + if (setting.value == "true") { + $("#adis-setting-krankentransport-automatic").addClass("active"); + } else { + $("#adis-setting-krankentransport-automatic").removeClass("active"); + } + } else if (setting.name == "Sprechwunsch-Automatic") { + if (setting.value == "true") { + $("#adis-setting-sprechwunsch-automatic").addClass("active"); + } else { + $("#adis-setting-sprechwunsch-automatic").removeClass("active"); + } + } else if (setting.name == "MissionsOwn-Automatic") { + if (setting.value == "true") { + $("#adis-setting-full-automatic").addClass("active"); + } else { + $("#adis-setting-full-automatic").removeClass("active"); + } + } else if (setting.name == "Alliance-Automatic") { + if (setting.value == "true") { + $("#adis-setting-alliance-automatic").addClass("active"); + } else { + $("#adis-setting-alliance-automatic").removeClass("active"); + } + } else if (setting.name == "AllianceEvents-Automatic") { + if (setting.value == "true") { + $("#adis-setting-allianceevents-automatic").addClass("active"); + } else { + $("#adis-setting-allianceevents-automatic").removeClass("active"); + } + } + }); + } } diff --git a/gulpfile.js b/gulpfile.js index 7a850e9..dbaded7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -13,13 +13,17 @@ var gulp = require("gulp"), gulp.task("scripts3", function () { console.log("-- gulp is running task 'scripts'"); - var config = fs.readFileSync('./all_missions.json', ); + var config = fs.readFileSync('./all_missions.json'); + var iframes = fs.readFileSync('./html/iframes.html'); + var navbar = fs.readFileSync('./html/navbar.html'); gulp.src("src/autoloaderV2.js") .pipe(include()) .on('error', console.log) .pipe(replace({ global:{ - ADis_AllMissions:config.toString() + ADis_AllMissions: config.toString(), + ADis_Iframes: iframes.toString(), + ADis_Navbar: navbar.toString() }, prefix:"/***", suffix:"***/0" @@ -36,7 +40,7 @@ var gulp = require("gulp"), .on('error', console.log) .pipe(replace({ global:{ - ADis_AllMissions:config.toString() + ADis_AllMissions: config.toString() }, prefix:"/***", suffix:"***/0" diff --git a/html/navbar.html b/html/navbar.html index c20b9f6..ce0de8c 100755 --- a/html/navbar.html +++ b/html/navbar.html @@ -178,132 +178,4 @@ box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.32); transition: all 200ms; } - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index b442904..8fac788 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -81,23 +81,23 @@ class AutomaticDispose { ADisMissionsVerbandEvent: "++missionID,type,name,last_check,next_check,available,done", }); this.ADisDB.on("populate", function () { - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Krankentransport-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Sprechwunsch-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "MissionsOwn-Automatic", value: 'true' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "Alliance-Automatic", value: 'false' }); - ADisDB.ADisSettings.add({ + that.ADisDB.ADisSettings.add({ name: "AllianceEvent-Automatic", value: 'false' }); @@ -332,6 +332,7 @@ class AutomaticDispose { // - Index Page Loader // - IndexPage() { + let that = this; // - // - Google Font // - @@ -360,194 +361,11 @@ class AutomaticDispose { // Create Dashboard $('#news_li').before(''); - $('#adis-nav-item').html(` - - -