243cbd8123
Not yet using the new APIs, but ready to. Still to do: - Send sync messages on trust decisions - Respond to received trust decision sync messages - Show trust decisions in the conversation history - In that rare situation where a sent message ends up with a key error make it easy to retry the send. FREEBIE
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/*
|
|
* vim: ts=4:sw=4:expandtab
|
|
*/
|
|
(function () {
|
|
'use strict';
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
Whisper.ConfirmationDialogView = Whisper.View.extend({
|
|
className: 'confirmation-dialog modal',
|
|
templateName: 'confirmation-dialog',
|
|
initialize: function(options) {
|
|
this.message = options.message;
|
|
|
|
this.resolve = options.resolve;
|
|
this.okText = options.okText || i18n('ok');
|
|
|
|
this.reject = options.reject;
|
|
this.cancelText = options.cancelText || i18n('cancel');
|
|
|
|
this.render();
|
|
},
|
|
events: {
|
|
'click .ok': 'ok',
|
|
'click .cancel': 'cancel',
|
|
},
|
|
render_attributes: function() {
|
|
return {
|
|
message: this.message,
|
|
cancel: this.cancelText,
|
|
ok: this.okText
|
|
};
|
|
},
|
|
ok: function() {
|
|
this.remove();
|
|
this.resolve();
|
|
},
|
|
cancel: function() {
|
|
this.remove();
|
|
this.reject();
|
|
}
|
|
});
|
|
})();
|