2023-01-12 12:59:17 +00:00
|
|
|
const current = (function () {
|
|
|
|
let r = "";
|
|
|
|
if (document.currentScript) {
|
|
|
|
r = document.currentScript.src;
|
|
|
|
} else {
|
|
|
|
var scripts = document.getElementsByTagName('script'),
|
|
|
|
script = scripts[scripts.length - 1];
|
|
|
|
if (script.src) {
|
|
|
|
r = script.src;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return r.replace(/[^/]*$/, '')
|
|
|
|
})();
|
2023-01-10 12:46:36 +00:00
|
|
|
var flyout_contents = [];
|
|
|
|
const registerCategory = (category_dir, subcategories) => {
|
|
|
|
for (let sbctgr of subcategories) {
|
2023-01-12 12:59:17 +00:00
|
|
|
let fname = current + category_dir + '/' + sbctgr + "/index.js";
|
2023-01-10 12:46:36 +00:00
|
|
|
let script = document.createElement('script');
|
|
|
|
script.type = 'text/javascript';
|
|
|
|
script.src = fname;
|
|
|
|
script.async = false;
|
|
|
|
document.body.appendChild(script);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// センサーカテゴリ
|
|
|
|
registerCategory('sensors', [ // カテゴリディレクトリ名
|
|
|
|
"amg8833",
|
|
|
|
"paj7620",
|
|
|
|
"bme280",
|
|
|
|
"dht11",
|
|
|
|
"z-line" // フライアウト下端の不可視ライン。スクリプトにカテゴリ名を含むので注意
|
|
|
|
]);
|