2026-03-11 15:35:28 +01:00
|
|
|
/**
|
|
|
|
|
* MenuUtils — UI menu helper for Node-RED editor.
|
|
|
|
|
* Methods are split across focused modules under ./menu/ and mixed onto the prototype.
|
|
|
|
|
*/
|
2025-06-10 12:36:39 +02:00
|
|
|
|
2026-03-11 15:35:28 +01:00
|
|
|
const toggles = require('./menu/toggles');
|
|
|
|
|
const dataFetching = require('./menu/dataFetching');
|
|
|
|
|
const urlUtils = require('./menu/urlUtils');
|
|
|
|
|
const dropdownPopulation = require('./menu/dropdownPopulation');
|
|
|
|
|
const htmlGeneration = require('./menu/htmlGeneration');
|
2025-06-10 12:36:39 +02:00
|
|
|
|
2026-03-11 15:35:28 +01:00
|
|
|
class MenuUtils {
|
|
|
|
|
constructor() {
|
|
|
|
|
this.isCloud = false;
|
|
|
|
|
this.configData = null;
|
2025-06-10 12:36:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-11 15:35:28 +01:00
|
|
|
// Mix all method groups onto the prototype
|
|
|
|
|
const mixins = [toggles, dataFetching, urlUtils, dropdownPopulation, htmlGeneration];
|
|
|
|
|
for (const mixin of mixins) {
|
|
|
|
|
for (const [name, fn] of Object.entries(mixin)) {
|
|
|
|
|
if (typeof fn === 'function') {
|
|
|
|
|
Object.defineProperty(MenuUtils.prototype, name, {
|
|
|
|
|
value: fn,
|
|
|
|
|
writable: true,
|
|
|
|
|
configurable: true,
|
|
|
|
|
enumerable: false,
|
2025-06-10 12:36:39 +02:00
|
|
|
});
|
2026-03-11 15:35:28 +01:00
|
|
|
}
|
2025-06-12 17:04:02 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-11 15:35:28 +01:00
|
|
|
module.exports = MenuUtils;
|