Get started
Accounts
Apps
Users
Relationships
Dialogs (Messages)
Tracks (MuseBase)
Photos
Posts
Comments
Safety
Other
Yurba CDN (cdn.yurba.one)
Yurba Desktop API
Yurba Component Language
alert: Object properties, Object functions
// create a small alert
app.alert({
title: "Hello world!", // give a title
content: "Thats my alert window", // give a description (content)
})
We have created a small modal window that only has a title, description, and a "Close" button by default. For now, this modal window can only be used for warnings or displaying additional information, so let's create a more functional window that will be displayed once and prompt you to open a link when you click on the button:
// create a small alert
app.alert({
title: "Hello world!", // give a title
content: "Thats my alert window", // give a description (content)
buttons: [
{
text: "Visit website", // give button name
signal: "visit_website", // give button ID (function name)
type: "submit" // give a type
}
],
once: true, // show only once
name: "myModal" // Without this, "once" will not work. It is recommended to use a unique name and not to use randomizers
}, {
visit_website: () => { app.openUrl("https://yurba.one") }
})
As you can see, we first created a button in the "buttons" array, gave it a "signal" that literally became the name of the function (and at the same time a unique identifier) that we call when pressed