diff --git a/gui/scripts/interface.JS b/gui/scripts/interface.JS index 5917821..919c435 100644 --- a/gui/scripts/interface.JS +++ b/gui/scripts/interface.JS @@ -3,8 +3,16 @@ Control the interface! */ export default class interface { - function define(element_type, element_content, element_id = ``, element_class = ``) { - /* Defines a new element. */ + static define(element_type, element_content, element_id = ``, element_class = ``) { + /* 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); element_new.innerHTML = element_content; @@ -25,4 +33,19 @@ export default class interface { 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 + */ + + + } }