Dialogues - LivelyKernel/lively.next GitHub Wiki
Working with Confirmation-Dialogues,...
lively.next
provides a number of ready to use dialogues via lively.components/prompts.js
.
They can be used via promises as examplified here:
"Change Window Title",
async () => {
let newTitle = await w.prompt("Enter New Name", {input: this.title});
if (newTitle) this.title = newTitle;
}
Available Dialogues
Examplecode for all of these can be found in lively.components/prompts.js
.
Inform
A prompt that displays text. Provides the possibility to confirm with a single button.
Confirm
A prompt that displays text. Can be either accepted or rejected via two distinct buttons.
MultipleChoice
User can choose from a pre-defined list of options and cofirm or cancel the prompt via two distinct buttons.
TextPrompt
Allows the user to enter some text and confirm or cancel the dialogue.
EditPrompt
Like a TextPrompt
, but with an editorpane instead of a simple text-box.
PasswordPrompt
Like the TextPrompt
, but stars-out the input
ListPrompt
A black, semi-transparent overlay appears which holds different list-items. One can be selected. Allows for confirmation and cancellation.
EditListPrompt
Like a ListPrompt
but allows the user to add/remove items from the displayed list.