async function justWait() {
await new Promise(resolve => setTimeout(resolve, 2000));
}
export default {
alerts: {
replace: "[wait1][wait2][wait3]"
},
blocks: {
replace: "[block1][block2]"
},
hints: {
replace: "[hint1][hint2][hint3]"
},
wait1: {
class: "info",
html: '<i class="fas fa-info-circle mr-1"></i> {0}',
text: "Just Wait",
click: justWait
},
wait2: {
class: "info",
html: '{0} <i class="fas fa-info-circle mx-1"></i> {1}',
block: false,
text: ["Not", "Blocking"],
click: justWait
},
wait3: {
class: "info",
text: "My Message",
block: "My own blocking message",
click: justWait
},
block1: {
class: "info",
text: "block",
block: false,
click: async (app) => {
app.block("Test Message for 2 sec");
await justWait();
app.unblock();
}
},
block2: {
class: "danger",
text: "block",
block: false,
click: async (app) => {
app.block("error", "Test Error for 2 sec");
await justWait();
app.unblock();
}
},
hint1: {
class: "success",
text: "hint",
click: async (app) => {
app.hint("success", "Success");
}
},
hint2: {
class: "info",
text: "hint",
click: async (app) => {
app.hint("info", "Info");
}
},
hint3: {
class: "danger",
text: "hint",
click: async (app) => {
app.hint("error", "Error");
}
}
};