mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
CommonJS (research)
This commit is contained in:
parent
2fa2cd191e
commit
56607de87c
91 changed files with 20220 additions and 12933 deletions
|
|
@ -1,30 +1,43 @@
|
|||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
|
||||
/**
|
||||
* @param {number=} iType = Enums.ContactPropertyType.Unknown
|
||||
* @param {string=} sTypeStr = ''
|
||||
* @param {string=} sValue = ''
|
||||
* @param {boolean=} bFocused = false
|
||||
* @param {string=} sPlaceholder = ''
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
|
||||
{
|
||||
this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType);
|
||||
this.typeStr = ko.observable(Utils.isUnd(sTypeStr) ? '' : sTypeStr);
|
||||
this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused);
|
||||
this.value = ko.observable(Utils.pString(sValue));
|
||||
(function (module) {
|
||||
|
||||
this.placeholder = ko.observable(sPlaceholder || '');
|
||||
'use strict';
|
||||
|
||||
this.placeholderValue = ko.computed(function () {
|
||||
var sPlaceholder = this.placeholder();
|
||||
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
|
||||
}, this);
|
||||
var
|
||||
ko = require('../External/ko.js'),
|
||||
Enums = require('../Common/Enums.js'),
|
||||
Utils = require('../Common/Utils.js')
|
||||
;
|
||||
|
||||
this.largeValue = ko.computed(function () {
|
||||
return Enums.ContactPropertyType.Note === this.type();
|
||||
}, this);
|
||||
/**
|
||||
* @param {number=} iType = Enums.ContactPropertyType.Unknown
|
||||
* @param {string=} sTypeStr = ''
|
||||
* @param {string=} sValue = ''
|
||||
* @param {boolean=} bFocused = false
|
||||
* @param {string=} sPlaceholder = ''
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
|
||||
{
|
||||
this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType);
|
||||
this.typeStr = ko.observable(Utils.isUnd(sTypeStr) ? '' : sTypeStr);
|
||||
this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused);
|
||||
this.value = ko.observable(Utils.pString(sValue));
|
||||
|
||||
}
|
||||
this.placeholder = ko.observable(sPlaceholder || '');
|
||||
|
||||
this.placeholderValue = ko.computed(function () {
|
||||
var sPlaceholder = this.placeholder();
|
||||
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
|
||||
}, this);
|
||||
|
||||
this.largeValue = ko.computed(function () {
|
||||
return Enums.ContactPropertyType.Note === this.type();
|
||||
}, this);
|
||||
}
|
||||
|
||||
module.exports = ContactPropertyModel;
|
||||
|
||||
}(module));
|
||||
Loading…
Add table
Add a link
Reference in a new issue