Tue, Mar 19, 2024, 2:52 AM +00:00
This commit is contained in:
		
							parent
							
								
									c2ec20c931
								
							
						
					
					
						commit
						5a340347f9
					
				
					 1 changed files with 25 additions and 2 deletions
				
			
		|  | @ -3,8 +3,16 @@ Control the interface! | ||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| export default class interface { | export default class interface { | ||||||
|     function define(element_type, element_content, element_id = ``, element_class = ``) { |     static define(element_type, element_content, element_id = ``, element_class = ``) { | ||||||
|         /* Defines a new element. */ |         /* Defines a new element. | ||||||
|  | 
 | ||||||
|  |         Parameters: | ||||||
|  |             element_type: the type of the element to be inserted | ||||||
|  |             element_content: the HTML content of that element | ||||||
|  |             element_id: the element ID | ||||||
|  |             element_class: the class of the element to be inserted | ||||||
|  |         Returns: the created element | ||||||
|  |         */ | ||||||
| 
 | 
 | ||||||
|         let element_new = document.createElement(element_type); |         let element_new = document.createElement(element_type); | ||||||
|         element_new.innerHTML = element_content; |         element_new.innerHTML = element_content; | ||||||
|  | @ -25,4 +33,19 @@ export default class interface { | ||||||
| 
 | 
 | ||||||
|         return (element_new); |         return (element_new); | ||||||
|     }; |     }; | ||||||
|  | 
 | ||||||
|  |     static add(element_parent, element_type, element_content, element_id = ``, element_class = ``) { | ||||||
|  |         /* Adds or injects an element. | ||||||
|  | 
 | ||||||
|  |         Parameters: | ||||||
|  |             element_parent: The parent element | ||||||
|  |             element_type: the element type | ||||||
|  |             element_content: the content of the element | ||||||
|  |             element_id: the element id | ||||||
|  |             element_class: the element class name | ||||||
|  |         Returns: the inserted element | ||||||
|  |         */ | ||||||
|  | 
 | ||||||
|  |          | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue