diff --git a/src/core/js/ext_bottom_line.js b/src/core/js/ext_bottom_line.js index c9d0b9f196b68fbefd534a42a8f75096fa82ca65..fca4b671792232a8eeed483d0fe39ea569734845 100644 --- a/src/core/js/ext_bottom_line.js +++ b/src/core/js/ext_bottom_line.js @@ -45,8 +45,15 @@ */ var ext_bottom_line = function ($, logger, is_in_view_port, load_config, getEntityPath, connection) { + /** + * @property {string|function} create - a function with one parameter + * (entity) Note: This property can as well be a + * javascript string which evaluates to a function. + */ /** * @type {BottomLineConfig} + * @property {string|HTMLElement} fallback - Fallback content if none of + * the creators are applicable. * @property {string} version - the version of the configuration which must * match this module's version. * @property {CreatorConfig[]} creators - an array of creators. @@ -56,13 +63,14 @@ var ext_bottom_line = function ($, logger, is_in_view_port, load_config, getEnti * @type {CreatorConfig} * @property {string} [id] - a unique id for the creator. optional, for * debuggin purposes. - * @property {string} is_applicable - This has to be valid javascript! A - * function which accepts one parameter, an entity in html - * representation, and returns a truth value. - * @property {string} create - This has to be valid javascript! A function - * which accepts one parameter, an entity in html representation, and - * returns a HTMLElement which will be shown in the bottom line - * container. + * @property {function|string} is_applicable - If this is a string this has + * to be valid javascript! An asynchronous function which accepts one + * parameter, an entity in html representation, and which returns true + * iff this creator is applicable for the given entity. + * @property {string} create - This has to be valid javascript! An + * asynchronous function which accepts one parameter, an entity in html + * representation. It returns a HTMLElement or text node which will be + * shown in the bottom line container iff the creator is applicable. */ /** @@ -373,33 +381,11 @@ var ext_bottom_line = function ($, logger, is_in_view_port, load_config, getEnti true); }; - /** - * @type {Config} - * - * @property {string} version - * @property {string} fallback - * @property {Creator[]} creators - */ - - /** - * @type {Creator} - * - * @property {string} id - * @property {string|function} is_applicable - a function with one - * parameter (entity) which returns true iff this creator is applicable - * for the given entity. Note: This property can as well be a - * javascript string which evaluates to a function. - * - * @property {string|function} create - a function with one parameter - * (entity) which creates a preview for the given entity after - * is_applicable returned true. Note: This property can as well be a - * javascript string which evaluates to a function. - */ /** * Configure the creators. * - * @param {Config} config + * @param {BottomLineConfig} config */ var configure = async function (config) { logger.debug("configure", config); @@ -432,7 +418,7 @@ var ext_bottom_line = function ($, logger, is_in_view_port, load_config, getEnti * I.e. configure the list of creators and setup the scroll listener which * triggers the root_preview_handler. * - * @property {Config} [config] - an optional config. Per default, the + * @property {BottomLineConfig} [config] - an optional config. Per default, the * configuration is fetched from the server. */ const init = async function (config) {