2014-03-13 06:29:33 +08:00
|
|
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
|
|
|
|
2014-08-21 23:08:34 +08:00
|
|
|
(function (module) {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var
|
|
|
|
ko = require('../../External/ko.js'),
|
|
|
|
Utils = require('../../Common/Utils.js'),
|
|
|
|
kn = require('../../Knoin/Knoin.js'),
|
|
|
|
KnoinAbstractViewModel = require('../../Knoin/KnoinAbstractViewModel.js')
|
|
|
|
;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @constructor
|
|
|
|
* @extends KnoinAbstractViewModel
|
|
|
|
*/
|
|
|
|
function PopupsViewOpenPgpKeyViewModel()
|
2014-03-13 06:29:33 +08:00
|
|
|
{
|
2014-08-21 23:08:34 +08:00
|
|
|
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsViewOpenPgpKey');
|
|
|
|
|
|
|
|
this.key = ko.observable('');
|
|
|
|
this.keyDom = ko.observable(null);
|
|
|
|
|
|
|
|
kn.constructorEnd(this);
|
2014-03-13 06:29:33 +08:00
|
|
|
}
|
|
|
|
|
2014-08-21 23:08:34 +08:00
|
|
|
kn.extendAsViewModel('PopupsViewOpenPgpKeyViewModel', PopupsViewOpenPgpKeyViewModel);
|
2014-03-13 06:29:33 +08:00
|
|
|
|
2014-08-21 23:08:34 +08:00
|
|
|
PopupsViewOpenPgpKeyViewModel.prototype.clearPopup = function ()
|
2014-03-13 06:29:33 +08:00
|
|
|
{
|
2014-08-21 23:08:34 +08:00
|
|
|
this.key('');
|
|
|
|
};
|
|
|
|
|
|
|
|
PopupsViewOpenPgpKeyViewModel.prototype.selectKey = function ()
|
|
|
|
{
|
|
|
|
var oEl = this.keyDom();
|
|
|
|
if (oEl)
|
|
|
|
{
|
|
|
|
Utils.selectElement(oEl);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
|
|
|
|
{
|
|
|
|
this.clearPopup();
|
|
|
|
|
|
|
|
if (oOpenPgpKey)
|
|
|
|
{
|
|
|
|
this.key(oOpenPgpKey.armor);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = new PopupsViewOpenPgpKeyViewModel();
|
|
|
|
|
|
|
|
}(module));
|