DIalog

var dialog = util.alert('aaa'); 
// dialog.pressButton(0); // OK

util.alert('aaa', cb); 

function cb() {
  log('Dialog closed');
}

var dialog = util.confirm('Ready?', cbYes, cbNo); 
// dialog.pressButton(0); // Y
// dialog.pressButton(1); // N
util.dialog.info('aaa', demo.okDialogCb);
util.dialog.info('Title', 'content', demo.okDialogCb);
util.dialog.info('aaa\nbbbbbbbb', demo.okDialogCb);


demo.dialog = util.dialog.open(html, opt);
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);
  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);
  var opt = {
    data: 'abc1'
  };
  util.dialog.confirm('abcdefg?', demo.confirmDialogCbYes, opt);
  var opt = {
    data: 'abc1'
  };
  util.dialog.confirm('abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
  util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes);
  util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo);
  var opt = {
    focus: 'no',
    data: 'xyz'
  };
  util.dialog.confirm('Title', 'abcdefg?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);

  var opt = {
    focus: 'no',
    data: 'xyz'
  };
  util.dialog.confirm('Title', 'abcdefg\nzyx12345678901234567890?', demo.confirmDialogCbYes, demo.confirmDialogCbNo, opt);
  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);
  var opt = {
    data: 'abc1'
  };
  util.dialog.text('abcd\nefg?', demo.textDialogCbYes, opt);
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);
  util.dialog.text('Title', 'abcdefg?', demo.textDialogCbYes, demo.textDialogCbNo);
  var opt = {
    focus: 'no',
    data: 'xyz'
  };
  util.dialog.text('Title', 'abcdefg?', demo.textDialogCbYes, demo.textDialogCbNo, opt);
  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);
  var opt = {
    secure: true,
    data: 'xyz'
  };
  util.dialog.text('abcdefg\nxyz1234567890?', demo.textDialogCbYes, demo.textDialogCbNo, opt);
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);
Callback:

demo.textDialogCbYes = function(text, data) {
  log('Yes: text=' + text + ' : data=' + data)
};
demo.textDialogCbNo = function(text, data) {
  log('No : text=' + text + ' : data=' + data)
};