➜ A cross and costomizable Dialogs system:
It's a customizable warning box (similar to alert/confirm/prompt).
It's a branch of outbox popup but more strict and rigid... in fact, it no has direct writable in html and, if you try to delete it, the system remake from zero it in one second.
Obviously it is not a native alert, therefore it has limits (for example it cannot physically block the page at 100%) but it is a very useful additional function to create an immediate pop in an app or during the execution of any of your additional scripts.
Standard dialog elements:
Click on element for test:
This is the demo script below this page:
window.addEventListener('load',()=>{
ui.warning({
type:'alert',
content:'This is a custom warning! Hello dev! This page is loaded!'
},
result => {
console.log(result);
//continue/do...
})
},false)
document.getElementById('alert').addEventListener('click',()=>{
ui.warning(null,result => {
console.log('the result is: ',result);
//continue/do...
})
},true);
document.getElementById('confirm').addEventListener('click',()=>{
ui.warning({
type:'confirm',
content:'This is a simple hello world with other params...',
accept:'yes',
decline:'no'
},
result => {
console.log('the result is: ',result);
//continue/do...
})
},true);
document.getElementById('prompt').addEventListener('click',()=>{
ui.warning({
type:'prompt',
content:'This is a simple hello world...',
placeholder:'write your test here',
accept:'TEST NOW',
decline:'EXIT'
}, result => {
if(!result)
{
console.log('the result is: ',result);
}
else
{
//can i print a result in neasted pop? yes!
ui.warning({
type:'alert',
content:'you wrote this:'+result
},()=>null);
}
})
},true);