Files
automatic-dispose/src/autoloader.js
2018-11-27 15:35:54 +01:00

78 lines
2.3 KiB
JavaScript
Executable File

var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime();
var ADis_AllMissions = /***ADis_AllMissions***/0
if (typeof window.name != 'undefined') {
console.log(window.name);
}
var _tellParent = window.tellParent;
window.tellParent = function (args) {
console.log('tellParent', args);
return _tellParent(args);
}
var ADis_MyHead = document.getElementsByTagName('head')[0];
var ADis_MyBody = document.getElementsByTagName('body')[0];
function includesString(string1, string2) {
return string1.toLowerCase().includes(string2.toLowerCase());
}
async function ADisSettings() {
var res = {};
await ADisDB.ADisSettings.each((setting) => {
res[setting.name] = setting.value;
});
return res;
}
//=require ../node_modules/dexie/dist/dexie.js
// Create own MDisDB to use it later
//=require ../script/dexie_db.js
ADisDB.on("ready", () => {
//console.log(ADisDB);
//console.log(ADisSettings('Krankentransport-Automatic'));
if (window.location.pathname === "/" || window.location.pathname === "/#") {
// -
// - Google Font
// -
var styleElement = document.createElement("link");
styleElement.rel = "stylesheet";
styleElement.href = "https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700";
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";
ADis_MyHead.appendChild(scriptElement);
// -
// - Navbar Dashboard
// -
//=require ../script/interface.js
var styleElement = document.createElement("link");
styleElement.rel = "stylesheet";
styleElement.type = "text/css";
styleElement.media = "screen";
styleElement.href = AutomaticDispose_URL + AutomaticDispose_Branch + "/style/interface.css";
ADis_MyHead.appendChild(styleElement);
}
//=require ../script/mission.js
//=require ../script/sprechwunsch.js
});