mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
jshint -> eslint
This commit is contained in:
parent
40b3f929e9
commit
77a1d3f3df
100 changed files with 716 additions and 811 deletions
|
|
@ -49,4 +49,4 @@
|
|||
|
||||
module.exports = AccountModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -550,4 +550,4 @@
|
|||
|
||||
module.exports = AttachmentModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -127,4 +127,4 @@
|
|||
|
||||
module.exports = ComposeAttachmentModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -73,16 +73,16 @@
|
|||
var bResult = false;
|
||||
if (oItem && 'Object/Contact' === oItem['@Object'])
|
||||
{
|
||||
this.idContact = Utils.pInt(oItem['IdContact']);
|
||||
this.display = Utils.pString(oItem['Display']);
|
||||
this.readOnly = !!oItem['ReadOnly'];
|
||||
this.idContact = Utils.pInt(oItem.IdContact);
|
||||
this.display = Utils.pString(oItem.Display);
|
||||
this.readOnly = !!oItem.ReadOnly;
|
||||
|
||||
if (Utils.isNonEmptyArray(oItem['Properties']))
|
||||
if (Utils.isNonEmptyArray(oItem.Properties))
|
||||
{
|
||||
_.each(oItem['Properties'], function (oProperty) {
|
||||
if (oProperty && oProperty['Type'] && Utils.isNormal(oProperty['Value']) && Utils.isNormal(oProperty['TypeStr']))
|
||||
_.each(oItem.Properties, function (oProperty) {
|
||||
if (oProperty && oProperty.Type && Utils.isNormal(oProperty.Value) && Utils.isNormal(oProperty.TypeStr))
|
||||
{
|
||||
this.properties.push([Utils.pInt(oProperty['Type']), Utils.pString(oProperty['Value']), Utils.pString(oProperty['TypeStr'])]);
|
||||
this.properties.push([Utils.pInt(oProperty.Type), Utils.pString(oProperty.Value), Utils.pString(oProperty.TypeStr)]);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
|
@ -137,4 +137,4 @@
|
|||
|
||||
module.exports = ContactModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
this.placeholder = ko.observable(sPlaceholder || '');
|
||||
|
||||
this.placeholderValue = ko.computed(function () {
|
||||
var sPlaceholder = this.placeholder();
|
||||
return sPlaceholder ? Translator.i18n(sPlaceholder) : '';
|
||||
var value = this.placeholder();
|
||||
return value ? Translator.i18n(value) : '';
|
||||
}, this);
|
||||
|
||||
this.largeValue = ko.computed(function () {
|
||||
|
|
@ -49,4 +49,4 @@
|
|||
|
||||
module.exports = ContactPropertyModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -218,8 +218,12 @@
|
|||
{
|
||||
if (bWrapWithLink)
|
||||
{
|
||||
sResult = Utils.encodeHtml('"' + this.name + '" <') +
|
||||
'<a href="mailto:' + Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') + '" target="_blank" tabindex="-1">' + Utils.encodeHtml(sResult) + '</a>' + Utils.encodeHtml('>');
|
||||
sResult = Utils.encodeHtml('"' + this.name + '" <') + '<a href="mailto:' +
|
||||
Utils.encodeHtml('"' + this.name + '" <' + this.email + '>') +
|
||||
'" target="_blank" tabindex="-1">' +
|
||||
Utils.encodeHtml(sResult) +
|
||||
'</a>' +
|
||||
Utils.encodeHtml('>');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -268,9 +272,9 @@
|
|||
|
||||
substr_replace = function (str, replace, start, length) {
|
||||
if (start < 0) {
|
||||
start = start + str.length;
|
||||
start += str.length;
|
||||
}
|
||||
length = length !== undefined ? length : str.length;
|
||||
length = typeof length !== 'undefined' ? length : str.length;
|
||||
if (length < 0) {
|
||||
length = length + str.length - start;
|
||||
}
|
||||
|
|
@ -399,4 +403,4 @@
|
|||
|
||||
module.exports = EmailModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@
|
|||
{
|
||||
case Enums.FiltersAction.MoveTo:
|
||||
sResult = Translator.i18n('SETTINGS_FILTERS/SUBNAME_MOVE_TO', {
|
||||
'FOLDER': fGetRealFolderName(sActionValue)
|
||||
FOLDER: fGetRealFolderName(sActionValue)
|
||||
});
|
||||
break;
|
||||
case Enums.FiltersAction.Forward:
|
||||
sResult = Translator.i18n('SETTINGS_FILTERS/SUBNAME_FORWARD_TO', {
|
||||
'EMAIL': sActionValue
|
||||
EMAIL: sActionValue
|
||||
});
|
||||
break;
|
||||
case Enums.FiltersAction.Vacation:
|
||||
|
|
@ -211,23 +211,23 @@
|
|||
FilterModel.prototype.toJson = function ()
|
||||
{
|
||||
return {
|
||||
'ID': this.id,
|
||||
'Enabled': this.enabled() ? '1' : '0',
|
||||
'Name': this.name(),
|
||||
'ConditionsType': this.conditionsType(),
|
||||
'Conditions': _.map(this.conditions(), function (oItem) {
|
||||
ID: this.id,
|
||||
Enabled: this.enabled() ? '1' : '0',
|
||||
Name: this.name(),
|
||||
ConditionsType: this.conditionsType(),
|
||||
Conditions: _.map(this.conditions(), function (oItem) {
|
||||
return oItem.toJson();
|
||||
}),
|
||||
|
||||
'ActionValue': this.actionValue(),
|
||||
'ActionValueSecond': this.actionValueSecond(),
|
||||
'ActionValueThird': this.actionValueThird(),
|
||||
'ActionValueFourth': this.actionValueFourth(),
|
||||
'ActionType': this.actionType(),
|
||||
ActionValue: this.actionValue(),
|
||||
ActionValueSecond: this.actionValueSecond(),
|
||||
ActionValueThird: this.actionValueThird(),
|
||||
ActionValueFourth: this.actionValueFourth(),
|
||||
ActionType: this.actionType(),
|
||||
|
||||
'Stop': this.actionNoStop() ? '0' : '1',
|
||||
'Keep': this.actionKeep() ? '1' : '0',
|
||||
'MarkAsRead': this.actionMarkAsRead() ? '1' : '0'
|
||||
Stop: this.actionNoStop() ? '0' : '1',
|
||||
Keep: this.actionKeep() ? '1' : '0',
|
||||
MarkAsRead: this.actionMarkAsRead() ? '1' : '0'
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -252,33 +252,33 @@
|
|||
var bResult = false;
|
||||
if (oItem && 'Object/Filter' === oItem['@Object'])
|
||||
{
|
||||
this.id = Utils.pString(oItem['ID']);
|
||||
this.name(Utils.pString(oItem['Name']));
|
||||
this.enabled(!!oItem['Enabled']);
|
||||
this.id = Utils.pString(oItem.ID);
|
||||
this.name(Utils.pString(oItem.Name));
|
||||
this.enabled(!!oItem.Enabled);
|
||||
|
||||
this.conditionsType(Utils.pString(oItem['ConditionsType']));
|
||||
this.conditionsType(Utils.pString(oItem.ConditionsType));
|
||||
|
||||
this.conditions([]);
|
||||
|
||||
if (Utils.isNonEmptyArray(oItem['Conditions']))
|
||||
if (Utils.isNonEmptyArray(oItem.Conditions))
|
||||
{
|
||||
this.conditions(_.compact(_.map(oItem['Conditions'], function (aData) {
|
||||
this.conditions(_.compact(_.map(oItem.Conditions, function (aData) {
|
||||
var oFilterCondition = new FilterConditionModel();
|
||||
return oFilterCondition && oFilterCondition.parse(aData) ?
|
||||
oFilterCondition : null;
|
||||
})));
|
||||
}
|
||||
|
||||
this.actionType(Utils.pString(oItem['ActionType']));
|
||||
this.actionType(Utils.pString(oItem.ActionType));
|
||||
|
||||
this.actionValue(Utils.pString(oItem['ActionValue']));
|
||||
this.actionValueSecond(Utils.pString(oItem['ActionValueSecond']));
|
||||
this.actionValueThird(Utils.pString(oItem['ActionValueThird']));
|
||||
this.actionValueFourth(Utils.pString(oItem['ActionValueFourth']));
|
||||
this.actionValue(Utils.pString(oItem.ActionValue));
|
||||
this.actionValueSecond(Utils.pString(oItem.ActionValueSecond));
|
||||
this.actionValueThird(Utils.pString(oItem.ActionValueThird));
|
||||
this.actionValueFourth(Utils.pString(oItem.ActionValueFourth));
|
||||
|
||||
this.actionNoStop(!oItem['Stop']);
|
||||
this.actionKeep(!!oItem['Keep']);
|
||||
this.actionMarkAsRead(!!oItem['MarkAsRead']);
|
||||
this.actionNoStop(!oItem.Stop);
|
||||
this.actionKeep(!!oItem.Keep);
|
||||
this.actionMarkAsRead(!!oItem.MarkAsRead);
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
|
@ -322,4 +322,4 @@
|
|||
|
||||
module.exports = FilterModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -77,12 +77,12 @@
|
|||
|
||||
FilterConditionModel.prototype.parse = function (oItem)
|
||||
{
|
||||
if (oItem && oItem['Field'] && oItem['Type'])
|
||||
if (oItem && oItem.Field && oItem.Type)
|
||||
{
|
||||
this.field(Utils.pString(oItem['Field']));
|
||||
this.type(Utils.pString(oItem['Type']));
|
||||
this.value(Utils.pString(oItem['Value']));
|
||||
this.valueSecond(Utils.pString(oItem['ValueSecond']));
|
||||
this.field(Utils.pString(oItem.Field));
|
||||
this.type(Utils.pString(oItem.Type));
|
||||
this.value(Utils.pString(oItem.Value));
|
||||
this.valueSecond(Utils.pString(oItem.ValueSecond));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -93,10 +93,10 @@
|
|||
FilterConditionModel.prototype.toJson = function ()
|
||||
{
|
||||
return {
|
||||
'Field': this.field(),
|
||||
'Type': this.type(),
|
||||
'Value': this.value(),
|
||||
'ValueSecond': this.valueSecond()
|
||||
Field: this.field(),
|
||||
Type: this.type(),
|
||||
Value: this.value(),
|
||||
ValueSecond: this.valueSecond()
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -114,4 +114,4 @@
|
|||
|
||||
module.exports = FilterConditionModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -376,4 +376,4 @@
|
|||
|
||||
module.exports = FolderModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -49,4 +49,4 @@
|
|||
|
||||
module.exports = IdentityModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
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 = Utils.inArray(this.priority, [Enums.MessagePriority.High, Enums.MessagePriority.Low]) ?
|
||||
this.priority : Enums.MessagePriority.Normal;
|
||||
|
||||
this.hash = Utils.pString(oJson.Hash);
|
||||
|
|
@ -86,4 +86,4 @@
|
|||
|
||||
module.exports = MessageFullModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -171,4 +171,4 @@
|
|||
|
||||
module.exports = MessageSimpleModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -108,3 +108,4 @@
|
|||
module.exports = OpenPgpKeyModel;
|
||||
|
||||
}());
|
||||
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@
|
|||
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'];
|
||||
this.id = Utils.pString(oItem.ID);
|
||||
this.name = Utils.pString(oItem.Name);
|
||||
this.body = Utils.pString(oItem.Body);
|
||||
this.populated = !!oItem.Populated;
|
||||
|
||||
bResult = true;
|
||||
}
|
||||
|
|
@ -74,4 +74,4 @@
|
|||
|
||||
module.exports = TemplateModel;
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue