NovaOS Development Documentation

Namespace

tk

Summary

NovaOS's basic UI Toolkit

.

NovaOS's basic UI Toolkit

Methods

static

a(ele1, ele2) → {void}

Appends one element to another

Parameters

  • ele1 HTMLElement

    The parent element

  • ele2 HTMLElement

    The child element

Returns

  • void

Source

static

c(type, ele, classn) → {HTMLElement}

Create an element with a specific type, class, and parent element.

Parameters

  • type String

    HTML Tag Name

  • ele HTMLElement

    Parent element

  • classn Array

    Array of classes to apply to the element

Returns

  • HTMLElement

    The created element

Source

static

cb(classn, name, func, ele) → {HTMLElement}

Creates a button element

Parameters

  • classn String

    A class to add to the element

  • name String

    Text Content for the element

  • func function

    Function to run on button click

  • ele HTMLElement

    Parent element for button

Returns

  • HTMLElement

    The created button

Source

static

css(href) → {void}

Creates a CSS Import

Parameters

  • href String

    Link to import css from

Returns

  • void

Source

static

g(element) → {HTMLElement}

Gets and returns an element by ID

Parameters

  • element String

    The element ID

Returns

  • HTMLElement

    The element

Source

static

img(src, classn, div) → {HTMLElement}

Creates an image element with a specific source, class, and parent

Parameters

  • src String

    The source of the image.

  • classn String

    The class of the image.

  • div HTMLElement

    The parent

Returns

  • HTMLElement

    The created image element.

Source

static

mbw(title, wid, hei, full, min, quit, id, iconopt) → {Object}

Creates a window

Parameters

  • title String

    The title of the window

  • wid Number

    The width of the window

  • hei Number

    The height of the window

  • full Boolean

    Whether the window can be maximized

  • min Boolean

    Whether the window can be minimized

  • quit Boolean

    Whether the window can be closed

  • id String

    The ID of the window

  • icon String <optional>
    './assets/img/systemIcons/noicon.svg'

    The icon of the window

Returns

  • Object

    The created window

Source

static

mkel(element, classes, innerHtml, parent) → {HTMLElement}

Creates an element with a specific type, class, and parent

Parameters

  • element String

    The HTML element tagname

  • classes Array

    Array of classes to add

  • innerHtml String

    HTML Content

  • parent HTMLElement

    Parent element

Returns

  • HTMLElement

    The created element

Source

static

p(contents, classn, div) → {HTMLElement}

Creates a paragraph element with a specific class and parent element.

Parameters

  • contents String

    The text content of the paragraph.

  • classn String

    The class of the paragraph.

  • div HTMLElement

    The parent element.

Returns

  • HTMLElement

    The created paragraph element.

Source

static

t(ele, text)

Sets the innerText of an element

Parameters

  • ele HTMLElement

    The element

  • text String

    The text to set

Source