DIalog
var dialog = util.alert('aaa'); DEMO
// dialog.pressButton(0); // OK
util.alert('aaa', cb); DEMO
function cb() {
log('Dialog closed');
}
var dialog = util.confirm('Ready?', cbYes, cbNo); DEMO
// dialog.pressButton(0); // Y
// dialog.pressButton(1); // N
util.dialog.info('aaa', demo.okDialogCb); OK Dialog
util.dialog.info('Title', 'content', demo.okDialogCb); OK Dialog2
util.dialog.info('aaa\nbbbbbbbb', demo.okDialogCb); OK MultiLine
demo.dialog = util.dialog.open(html, opt); DEMO
var style = {
background: 'rgba(0,0,0,0.3)'
};
util.modal.setStyle(style);
var html = '';
html += 'aaa\n\n';
html += '<button onclick="demo.openDialog2();">Open OK Dialog</button>';
html += ' ';
html += '<button onclick="util.dialog.close();">Close</button>';
var opt = {
closeAnywhere: true,
};
util.dialog.open(html, opt);
util.modal.setStyle(null);
Multi Dialog
var opt = {
focus: 'no',
data: 'ABC',
style: {
body: {
'width': '200px',
'height': '100px'
},
title: {
'font-size': '24px'
},
content: {
'color': '#00f'
},
message: {
'text-align': 'left'
},
button: {
'width': '100px',
'height': '50px',
'color': '#00a',
'background': '#ddd',
'font-size': '28px'
}
}
};
util.dialog.info('Title', 'abcdefg\nxyz1234567890?', opt);
Info Dialog Style
var opt = {
data: 'abc1'
};
util.dialog.confirm('abcdefg?', demo.confirmDialogCbYes, opt);
YesNo Dialog
var opt = {
data: 'abc1'
};
util.dialog.confirm('abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
YesNo Dialog YesNo
util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes);
YesNo Title
util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo);
YesNo Title YesNoCb
var opt = {
focus: 'no',
data: 'xyz'
};
util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
YesNo Title YesNoCb focus
var opt = {
focus: 'no',
data: 'xyz'
};
util.dialog.confirm('Title', 'abcdefg\nzyx12345678901234567890?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
YesNo MultiLine
var opt = {
focus: 'no',
data: 'ABC',
style: {
body: {
'width': '200px',
'height': '100px'
},
title: {
'font-size': '24px'
},
content: {
'color': '#00f'
},
message: {
'text-align': 'left'
},
button: {
'color': '#00a',
'background': '#ddd'
}
}
};
util.dialog.confirm('Title', 'abcdefg\nxyz1234567890?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
YesNo Style
var opt = {
data: 'abc1'
};
util.dialog.text('abcd\nefg?', demo.textDialogCbYes, opt);
Text YesNo Dialog
Callback:
demo.textDialogCbYes = function(text, data) {
log('Yes: text=' + text + ' : data=' + data)
};
demo.textDialogCbNo = function(text, data) {
log('No : text=' + text + ' : data=' + data)
};
util.dialog.text('Title', 'abcdefg?', demo.textDialogCbYes);
Text YesNo Title
util.dialog.text('Title', 'abcdefg?', demo.textDialogCbYes, demo.textDialogCbNo);
Text YesNo Title YesNoCb
var opt = {
focus: 'no',
data: 'xyz'
};
util.dialog.text('Title', 'abcdefg?', demo.textDialogCbYes, demo.textDialogCbNo, opt);
Text YesNo Title YesNoCb focus
var opt = {
focus: 'no',
data: 'ABC',
style: {
body: {
'width': '600px',
'height': '400px'
},
title: {
'font-size': '24px'
},
content: {
'color': '#00f'
},
message: {
'text-align': 'left'
},
button: {
'color': '#00a',
'background': '#ddd'
},
textbox: {
'width': '150px',
'color': '#f00'
}
}
};
util.dialog.text('Title', 'abcdefg\nxyz1234567890?', demo.textDialogCbYes, demo.textDialogCbNo, opt);
Text YesNo Style
var opt = {
secure: true,
data: 'xyz'
};
util.dialog.text('abcdefg\nxyz1234567890?', demo.textDialogCbYes, demo.textDialogCbNo, opt);
Text YesNo Secure
Callback:
demo.textDialogCbYes = function(text, data) {
log('Yes: text=' + text + ' : data=' + data)
};
demo.textDialogCbNo = function(text, data) {
log('No : text=' + text + ' : data=' + data)
};
var opt = {
type: 'textarea',
value: 'aaa\nbbb',
style: {
textbox: {
width: '20em',
height: '5em'
}
},
data: 'abc1'
};
util.dialog.text('Please input some text:', demo.textDialogCbYes, demo.textDialogCbNo, opt);
TextArea YesNo
Callback:
demo.textDialogCbYes = function(text, data) {
log('Yes: text=' + text + ' : data=' + data)
};
demo.textDialogCbNo = function(text, data) {
log('No : text=' + text + ' : data=' + data)
};