Browse Source

MINOR,REFA,DOC,INDENT: Autoformatted code, added some doc

master
chris 4 months ago
parent
commit
fc2c6b15c0
  1. 3
      src/arrangement.js
  2. 6
      src/builder.js
  3. 27
      src/context.js

3
src/arrangement.js

@ -15,5 +15,4 @@ const Arrangement = Object.freeze({
SPACE_BETWEEN: "space-between", SPACE_BETWEEN: "space-between",
SPACE_EVENLY: "space-evenly", SPACE_EVENLY: "space-evenly",
SPACE_AROUND: "space-around", SPACE_AROUND: "space-around",
});
})

6
src/builder.js

@ -177,6 +177,12 @@ const builder = {
* @returns {Component} * @returns {Component}
*/ */
tableFooter: function (attr = {}) { return builder.genTag("tfoot", attr) }, tableFooter: function (attr = {}) { return builder.genTag("tfoot", attr) },
/**
*
* @param {Map<string,string>} attr
* @returns {Component}
*/
iframe: function (attr = {}) { return builder.genTag("iframe", attr) },
/** /**
* *

27
src/context.js

@ -8,6 +8,11 @@
/** /**
* The class provides overreaching options for building the website. * The class provides overreaching options for building the website.
*/ */
/**
* The class provides overreaching options for building the website.
* @property {Array<string>} #functionNames
*
*/
class PageBuilder { class PageBuilder {
#cssClasses; #cssClasses;
#functions; #functions;
@ -27,6 +32,14 @@ class PageBuilder {
* Registers a function to be added later in a script tag in the head of the document. * Registers a function to be added later in a script tag in the head of the document.
* @ATTENTION Be careful with intended empty strings (e.g. in variable values), * @ATTENTION Be careful with intended empty strings (e.g. in variable values),
* empty strings within the function code will be shrunk. * empty strings within the function code will be shrunk.
/**
* Registers a function to be added later in a script tag in the head of the document.
* @ATTENTION Be careful with intended empty strings (e.g. in variable values),
* empty strings within the function code will be shrunk.
* @deprecated 'registerFunction' will bew removed.
* 'registerNamedFunction' will be removed.
* Use 'registerPageFunction' it fully supports registration/adding of functions.
* All variations of named, unnamed and reassigned, arrow or brakets notation.
* @param {string} name * @param {string} name
* @param {function} fun * @param {function} fun
*/ */
@ -65,7 +78,14 @@ class PageBuilder {
return this; return this;
} }
/**
* @deprecated 'registerFunction' will bew removed.
* 'registerNamedFunction' will be removed.
* Use 'registerPageFunction' it fully supports registration of functions.
* All variations of named, unnamed and reassigned, arrow or brakets notation.
* @param {Function} namedFunction
* @returns
*/
registerNamedFunction(namedFunction) { registerNamedFunction(namedFunction) {
return this.registerFunction(namedFunction.name, namedFunction) return this.registerFunction(namedFunction.name, namedFunction)
} }
@ -158,6 +178,11 @@ class PageBuilder {
/** /**
* *
/**
* Little helper function.
* If a single page application is in development.
* This method sets an autoreload interval for the page.
* @param {number} relaunchSeconds timeinterval for page to reload (changes) * @param {number} relaunchSeconds timeinterval for page to reload (changes)
*/ */
inDev(relaunchSeconds = 20) { inDev(relaunchSeconds = 20) {

Loading…
Cancel
Save