NovaOS's basic UI Toolkit
Methods
a(ele1, ele2) → {void}
Appends one element to another
Parameters
-
ele1
HTMLElementThe parent element
-
ele2
HTMLElementThe child element
Returns
-
void
Source
c(type, ele, classn) → {HTMLElement}
Create an element with a specific type, class, and parent element.
Parameters
-
type
StringHTML Tag Name
-
ele
HTMLElementParent element
-
classn
ArrayArray of classes to apply to the element
Returns
-
HTMLElementThe created element
Source
cb(classn, name, func, ele) → {HTMLElement}
Creates a button element
Parameters
-
classn
StringA class to add to the element
-
name
StringText Content for the element
-
func
functionFunction to run on button click
-
ele
HTMLElementParent element for button
Returns
-
HTMLElementThe created button
Source
css(href) → {void}
Creates a CSS Import
Parameters
-
href
StringLink to import css from
Returns
-
void
Source
g(element) → {HTMLElement}
Gets and returns an element by ID
Parameters
-
element
StringThe element ID
Returns
-
HTMLElementThe element
Source
img(src, classn, div) → {HTMLElement}
Creates an image element with a specific source, class, and parent
Parameters
-
src
StringThe source of the image.
-
classn
StringThe class of the image.
-
div
HTMLElementThe parent
Returns
-
HTMLElementThe created image element.
Source
mbw(title, wid, hei, full, min, quit, id, iconopt) → {Object}
Creates a window
Parameters
-
title
StringThe title of the window
-
wid
NumberThe width of the window
-
hei
NumberThe height of the window
-
full
BooleanWhether the window can be maximized
-
min
BooleanWhether the window can be minimized
-
quit
BooleanWhether the window can be closed
-
id
StringThe ID of the window
-
icon
String<optional>
'./assets/img/systemIcons/noicon.svg'The icon of the window
Returns
-
ObjectThe created window
Source
mkel(element, classes, innerHtml, parent) → {HTMLElement}
Creates an element with a specific type, class, and parent
Parameters
-
element
StringThe HTML element tagname
-
classes
ArrayArray of classes to add
-
innerHtml
StringHTML Content
-
parent
HTMLElementParent element
Returns
-
HTMLElementThe created element
Source
p(contents, classn, div) → {HTMLElement}
Creates a paragraph element with a specific class and parent element.
Parameters
-
contents
StringThe text content of the paragraph.
-
classn
StringThe class of the paragraph.
-
div
HTMLElementThe parent element.
Returns
-
HTMLElementThe created paragraph element.
Source
t(ele, text)
Sets the innerText of an element
Parameters
-
ele
HTMLElementThe element
-
text
StringThe text to set