diff --git a/src/core/js/ext_prop_display.js b/src/core/js/ext_prop_display.js index b94403def289acbbba76a118ca4479dde07beb54..0b706b0580760806fdade3bf25c6de3a8784b863 100644 --- a/src/core/js/ext_prop_display.js +++ b/src/core/js/ext_prop_display.js @@ -21,8 +21,36 @@ 'use strict'; /** - * + * @requires jQuery (library) + * @requires log (singleton from loglevel library) + * @requires load_config (function from webcaosdb.js) */ -var prop_display = new function () {} +var prop_display = new function ($, logger, load_config) { + + /** + * Return the property-display config file; `ext_prop_display.json` by + * default. + * + * @param {string} resource - file name of the config file + */ + this.load_config = async function (resource) { + + var conf = {}; + try { + resource = resource || "ext_prop_display.json"; + conf = await load_config(resource); + console.log(`Successfully loaded config: ${JSON.stringify(conf, undefined, 2)}`); + } catch (err) { + logger.error(err); + } + + return conf; + } + + this.init = async function() { + console.log("initializing ext_prop_display.js"); + const conf = await this.load_config(); + } +}($, log.getLogger("ext_prop_display"), load_config); $(document).ready(() => caosdb_modules.register(prop_display));