|
|
@ -8,6 +8,11 @@ |
|
|
|
/** |
|
|
|
* The class provides overreaching options for building the website. |
|
|
|
*/ |
|
|
|
/** |
|
|
|
* The class provides overreaching options for building the website. |
|
|
|
* @property {Array<string>} #functionNames |
|
|
|
* |
|
|
|
*/ |
|
|
|
class PageBuilder { |
|
|
|
#cssClasses; |
|
|
|
#functions; |
|
|
@ -27,6 +32,14 @@ class PageBuilder { |
|
|
|
* 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. |
|
|
|
/** |
|
|
|
* 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 {function} fun |
|
|
|
*/ |
|
|
@ -65,7 +78,14 @@ class PageBuilder { |
|
|
|
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) { |
|
|
|
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) |
|
|
|
*/ |
|
|
|
inDev(relaunchSeconds = 20) { |
|
|
|