Memento JavaScript UI

From Memento Database Wiki
Revision as of 23:19, 3 April 2023 by Admin (talk | contribs) (Created page with "== Overview == The '''ui()''' method is a JavaScript API provided by Memento Database that grants access to a framework of methods and objects for creating user interfaces (UIs) within Memento widgets. With this method, developers can create various UI elements such as text labels, buttons, images, layers, and checkboxes. === Example Usage === <source lang="javascript"> ui().text('Hello, world!'); </source> In this example, the '''ui()''' method is called to create a n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

The ui() method is a JavaScript API provided by Memento Database that grants access to a framework of methods and objects for creating user interfaces (UIs) within Memento widgets. With this method, developers can create various UI elements such as text labels, buttons, images, layers, and checkboxes.

Example Usage

ui().text('Hello, world!');

In this example, the ui() method is called to create a new UI object, which is then used to create a text label with the text "Hello, world!".

Notes

A script must return one UI object. If you want to display multiple UI objects, you can use a layout object, which can hold multiple objects. Example usage of a layout object:

ui().layout([
ui().text('This is a text label'),
ui().button('Click me!'),
ui().image('https://example.com/myimage.png')
]);

In this example, the layout object is created by calling the layout() method on a UI object and passing in multiple UI objects as arguments. The layout object contains a text label, a button, and an image, which are grouped together within a single view.