mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
eslint (additional rules)
This commit is contained in:
parent
77a1d3f3df
commit
8e8a041032
150 changed files with 21911 additions and 23106 deletions
|
|
@ -1,89 +1,80 @@
|
|||
|
||||
(function () {
|
||||
var
|
||||
_ = require('_'),
|
||||
|
||||
'use strict';
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
MessageSimpleModel = require('Model/MessageSimple');
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function MessageFullModel()
|
||||
{
|
||||
MessageSimpleModel.call(this, 'MessageFullModel');
|
||||
}
|
||||
|
||||
// MessageHelper = require('Helper/Message').default,
|
||||
_.extend(MessageFullModel.prototype, MessageSimpleModel.prototype);
|
||||
|
||||
MessageSimpleModel = require('Model/MessageSimple')
|
||||
;
|
||||
MessageFullModel.prototype.priority = 0;
|
||||
MessageFullModel.prototype.hash = '';
|
||||
MessageFullModel.prototype.requestHash = '';
|
||||
MessageFullModel.prototype.proxy = false;
|
||||
MessageFullModel.prototype.hasAttachments = false;
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
function MessageFullModel()
|
||||
MessageFullModel.prototype.clear = function()
|
||||
{
|
||||
MessageSimpleModel.prototype.clear.call(this);
|
||||
|
||||
this.priority = 0;
|
||||
this.hash = '';
|
||||
this.requestHash = '';
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.hasAttachments = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {AjaxJsonMessage} oJson
|
||||
* @returns {boolean}
|
||||
*/
|
||||
MessageFullModel.prototype.initByJson = function(oJson)
|
||||
{
|
||||
var bResult = false;
|
||||
|
||||
if (oJson && 'Object/Message' === oJson['@Object'])
|
||||
{
|
||||
MessageSimpleModel.call(this, 'MessageFullModel');
|
||||
if (MessageSimpleModel.prototype.initByJson.call(this, oJson))
|
||||
{
|
||||
this.priority = Utils.pInt(oJson.Priority);
|
||||
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
|
||||
this.priority : Enums.MessagePriority.Normal;
|
||||
|
||||
this.hash = Utils.pString(oJson.Hash);
|
||||
this.requestHash = Utils.pString(oJson.RequestHash);
|
||||
|
||||
this.proxy = !!oJson.ExternalProxy;
|
||||
|
||||
this.hasAttachments = !!oJson.HasAttachments;
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
_.extend(MessageFullModel.prototype, MessageSimpleModel.prototype);
|
||||
return bResult;
|
||||
};
|
||||
|
||||
MessageFullModel.prototype.priority = 0;
|
||||
MessageFullModel.prototype.hash = '';
|
||||
MessageFullModel.prototype.requestHash = '';
|
||||
MessageFullModel.prototype.proxy = false;
|
||||
MessageFullModel.prototype.hasAttachments = false;
|
||||
/**
|
||||
* @static
|
||||
* @param {AjaxJsonMessage} oJson
|
||||
* @returns {?MessageFullModel}
|
||||
*/
|
||||
MessageFullModel.newInstanceFromJson = function(oJson)
|
||||
{
|
||||
var oItem = oJson ? new MessageFullModel() : null;
|
||||
return oItem && oItem.initByJson(oJson) ? oItem : null;
|
||||
};
|
||||
|
||||
MessageFullModel.prototype.clear = function ()
|
||||
{
|
||||
MessageSimpleModel.prototype.clear.call(this);
|
||||
|
||||
this.priority = 0;
|
||||
this.hash = '';
|
||||
this.requestHash = '';
|
||||
|
||||
this.proxy = false;
|
||||
|
||||
this.hasAttachments = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {AjaxJsonMessage} oJson
|
||||
* @return {boolean}
|
||||
*/
|
||||
MessageFullModel.prototype.initByJson = function (oJson)
|
||||
{
|
||||
var bResult = false;
|
||||
|
||||
if (oJson && 'Object/Message' === oJson['@Object'])
|
||||
{
|
||||
if (MessageSimpleModel.prototype.initByJson.call(this, oJson))
|
||||
{
|
||||
this.priority = Utils.pInt(oJson.Priority);
|
||||
this.priority = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
|
||||
this.priority : Enums.MessagePriority.Normal;
|
||||
|
||||
this.hash = Utils.pString(oJson.Hash);
|
||||
this.requestHash = Utils.pString(oJson.RequestHash);
|
||||
|
||||
this.proxy = !!oJson.ExternalProxy;
|
||||
|
||||
this.hasAttachments = !!oJson.HasAttachments;
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
};
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @param {AjaxJsonMessage} oJson
|
||||
* @return {?MessageFullModel}
|
||||
*/
|
||||
MessageFullModel.newInstanceFromJson = function (oJson)
|
||||
{
|
||||
var oItem = oJson ? new MessageFullModel() : null;
|
||||
return oItem && oItem.initByJson(oJson) ? oItem : null;
|
||||
};
|
||||
|
||||
module.exports = MessageFullModel;
|
||||
|
||||
}());
|
||||
module.exports = MessageFullModel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue