Use a single js namespace as parent for all other nopaque namespaces.

This commit is contained in:
Patrick Jentsch
2023-11-09 14:29:01 +01:00
parent e8fe67d290
commit e3166ca54c
45 changed files with 322 additions and 325 deletions

View File

@ -1,11 +1,11 @@
var ResourceLists = {};
nopaque.resource_lists = {};
ResourceLists.AutoInit = () => {
for (let propertyName in ResourceLists) {
let property = ResourceLists[propertyName];
// Call autoInit of all properties that are subclasses of `ResourceLists.ResourceList`.
// This does not include `ResourceLists.ResourceList` itself.
if (property.prototype instanceof ResourceLists.ResourceList) {
nopaque.resource_lists.AutoInit = () => {
for (let propertyName in nopaque.resource_lists) {
let property = nopaque.resource_lists[propertyName];
// Call autoInit of all properties that are subclasses of `nopaque.resource_lists.ResourceList`.
// This does not include `nopaque.resource_lists.ResourceList` itself.
if (property.prototype instanceof nopaque.resource_lists.ResourceList) {
// Check if the static `htmlClass` property is defined.
if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class