|  | @ -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  | 
			
		
	
		
		
			
				
					|  |  |      */ |  |  |      */ | 
			
		
	
	
		
		
			
				
					|  | @ -36,7 +49,7 @@ class PageBuilder { | 
			
		
	
		
		
			
				
					|  |  |          * @param {string} text  |  |  |          * @param {string} text  | 
			
		
	
		
		
			
				
					|  |  |          * @returns {string} |  |  |          * @returns {string} | 
			
		
	
		
		
			
				
					|  |  |          */ |  |  |          */ | 
			
		
	
		
		
			
				
					
					|  |  |         function shrinkEmptyStrings(text){ |  |  |         function shrinkEmptyStrings(text) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             for (let i = 1; i < 10; i++) { |  |  |             for (let i = 1; i < 10; i++) { | 
			
		
	
		
		
			
				
					|  |  |                 text = text.replaceAll("          ".slice(i), ' '); |  |  |                 text = text.replaceAll("          ".slice(i), ' '); | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
	
		
		
			
				
					|  | @ -51,13 +64,13 @@ class PageBuilder { | 
			
		
	
		
		
			
				
					|  |  |             ); |  |  |             ); | 
			
		
	
		
		
			
				
					|  |  |             let isFuncWritten = clearedFuncText.startsWith('function'); |  |  |             let isFuncWritten = clearedFuncText.startsWith('function'); | 
			
		
	
		
		
			
				
					|  |  |             let funcHasName = fun.name && fun.name.trim() !== ''; |  |  |             let funcHasName = fun.name && fun.name.trim() !== ''; | 
			
		
	
		
		
			
				
					
					|  |  |             if(isFuncWritten){ |  |  |             if (isFuncWritten) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                 let isNameInFuncText = clearedFuncText.startsWith(`function ${name}`); |  |  |                 let isNameInFuncText = clearedFuncText.startsWith(`function ${name}`); | 
			
		
	
		
		
			
				
					|  |  |                 this.#functions.innerText += (funcHasName && isNameInFuncText |  |  |                 this.#functions.innerText += (funcHasName && isNameInFuncText | 
			
		
	
		
		
			
				
					|  |  |                     ? clearedFuncText |  |  |                     ? clearedFuncText | 
			
		
	
		
		
			
				
					
					|  |  |                     : clearedFuncText.replace('function ', 'function '+name) |  |  |                     : clearedFuncText.replace('function ', 'function ' + name) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 )+'; '; |  |  |                 ) + '; '; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             }else{ |  |  |             } else { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                 this.#functions.innerText += `const ${name} = ${clearedFuncText}; ` |  |  |                 this.#functions.innerText += `const ${name} = ${clearedFuncText}; ` | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |             this.#functionNames.push(name); |  |  |             this.#functionNames.push(name); | 
			
		
	
	
		
		
			
				
					|  | @ -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) { | 
			
		
	
	
		
		
			
				
					|  | 
 |