mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Code refactoring (es5 -> es2015)
This commit is contained in:
parent
fb2e492ce8
commit
38a1041a73
42 changed files with 3081 additions and 3690 deletions
|
|
@ -1,69 +0,0 @@
|
|||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
AbstractModel = require('Knoin/AbstractModel');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} sID
|
||||
* @param {string} sName
|
||||
* @param {string} sBody
|
||||
*/
|
||||
function TemplateModel(sID, sName, sBody)
|
||||
{
|
||||
AbstractModel.call(this, 'TemplateModel');
|
||||
|
||||
this.id = sID;
|
||||
this.name = sName;
|
||||
this.body = sBody;
|
||||
this.populated = true;
|
||||
|
||||
this.deleteAccess = ko.observable(false);
|
||||
}
|
||||
|
||||
_.extend(TemplateModel.prototype, AbstractModel.prototype);
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TemplateModel.prototype.id = '';
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TemplateModel.prototype.name = '';
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
TemplateModel.prototype.body = '';
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
TemplateModel.prototype.populated = true;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
TemplateModel.prototype.parse = function(oItem)
|
||||
{
|
||||
var bResult = false;
|
||||
if (oItem && 'Object/Template' === oItem['@Object'])
|
||||
{
|
||||
this.id = Utils.pString(oItem.ID);
|
||||
this.name = Utils.pString(oItem.Name);
|
||||
this.body = Utils.pString(oItem.Body);
|
||||
this.populated = !!oItem.Populated;
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
};
|
||||
|
||||
module.exports = TemplateModel;
|
||||
Loading…
Add table
Add a link
Reference in a new issue