mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
More scrict rules
This commit is contained in:
parent
71b6407d61
commit
fb2e492ce8
30 changed files with 126 additions and 89 deletions
|
|
@ -210,7 +210,11 @@ module.exports = {
|
|||
// 'no-lonely-if': 2,
|
||||
// 'no-mixed-operators': 2,
|
||||
'no-mixed-spaces-and-tabs': 2,
|
||||
'no-multiple-empty-lines': 2,
|
||||
'no-multiple-empty-lines': [2, {
|
||||
"max": 1,
|
||||
"maxEOF": 1,
|
||||
"maxBOF": 1
|
||||
}],
|
||||
// 'no-negated-condition': 2,
|
||||
// 'no-nested-ternary': 2,
|
||||
'no-new-object': 2,
|
||||
|
|
|
|||
|
|
@ -414,6 +414,46 @@ export const ContactPropertyType = {
|
|||
'Custom': 250
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
export const Magics = {
|
||||
'EventWhichMouseMiddle': 3,
|
||||
'ifvisibleIdle10s': 10,
|
||||
|
||||
'BitLength2048': 2048,
|
||||
'BitLength1024': 1024,
|
||||
|
||||
'Size50px': 50,
|
||||
'Size20px': 20,
|
||||
'Size1px': 1,
|
||||
|
||||
'Time1m': 60000,
|
||||
'Time30s': 30000,
|
||||
'Time7s': 7000,
|
||||
'Time5s': 5000,
|
||||
'Time3s': 3000,
|
||||
'Time1s': 1000,
|
||||
'Time500ms': 500,
|
||||
'Time350ms': 350,
|
||||
'Time250ms': 250,
|
||||
'Time200ms': 200,
|
||||
'Time100ms': 100,
|
||||
'Time50ms': 50,
|
||||
'Time20ms': 20
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
export const Ports = {
|
||||
'Imap': 143,
|
||||
'ImapSsl': 993,
|
||||
'Smtp': 25,
|
||||
'SmtpSsl': 465,
|
||||
'SmtpStartTls': 587
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import {isUnd} from 'Common/Utils';
|
|||
import {componentExportHelper} from 'Component/Abstract';
|
||||
import {AbstractInput} from 'Component/AbstractInput';
|
||||
|
||||
const DEFAULT_ROWS = 5;
|
||||
|
||||
class TextAreaComponent extends AbstractInput
|
||||
{
|
||||
/**
|
||||
|
|
@ -13,7 +15,7 @@ class TextAreaComponent extends AbstractInput
|
|||
|
||||
super(params);
|
||||
|
||||
this.rows = params.rows || 5;
|
||||
this.rows = params.rows || DEFAULT_ROWS;
|
||||
this.spellcheck = isUnd(params.spellcheck) ? false : !!params.spellcheck;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,7 +439,6 @@ Knoin.prototype.startScreens = function(aScreensClasses)
|
|||
|
||||
}, this);
|
||||
|
||||
|
||||
_.each(this.oScreens, function(oScreen) {
|
||||
if (oScreen && !oScreen.__started && oScreen.__start)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -592,7 +592,6 @@ MessageModel.prototype.findAttachmentByContentLocation = function(sContentLocati
|
|||
return oResult || null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -585,7 +585,6 @@ RemoteUserAjax.prototype.saveMessage = function(fCallback, sIdentityID, sMessage
|
|||
}, Consts.SAVE_MESSAGE_AJAX_TIMEOUT);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {string} sMessageFolder
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ function GeneralUserSettings()
|
|||
return Utils.convertLangName(this.language());
|
||||
}, this);
|
||||
|
||||
this.languageTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': 100});
|
||||
this.languageTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': Enums.Magics.Time100ms});
|
||||
|
||||
this.mppTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.editorDefaultTypeTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
|
@ -121,7 +121,7 @@ GeneralUserSettings.prototype.onBuild = function()
|
|||
self.languageTrigger(iSaveSettingsStep);
|
||||
_.delay(function() {
|
||||
self.languageTrigger(Enums.SaveSettingsStep.Idle);
|
||||
}, 1000);
|
||||
}, Enums.Magics.Time1s);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ GeneralUserSettings.prototype.onBuild = function()
|
|||
Remote.saveSettings(null, {
|
||||
'DesktopNotifications': bValue ? '1' : '0'
|
||||
});
|
||||
}, 3000);
|
||||
}, Enums.Magics.Time3s);
|
||||
});
|
||||
|
||||
self.enableSoundNotification.subscribe(function(bValue) {
|
||||
|
|
@ -171,7 +171,7 @@ GeneralUserSettings.prototype.onBuild = function()
|
|||
Remote.saveSettings(null, {
|
||||
'SoundNotification': bValue ? '1' : '0'
|
||||
});
|
||||
}, 3000);
|
||||
}, Enums.Magics.Time3s);
|
||||
});
|
||||
|
||||
self.replySameFolder.subscribe(function(bValue) {
|
||||
|
|
@ -179,7 +179,7 @@ GeneralUserSettings.prototype.onBuild = function()
|
|||
Remote.saveSettings(null, {
|
||||
'ReplySameFolder': bValue ? '1' : '0'
|
||||
});
|
||||
}, 3000);
|
||||
}, Enums.Magics.Time3s);
|
||||
});
|
||||
|
||||
self.useThreads.subscribe(function(bValue) {
|
||||
|
|
@ -206,7 +206,7 @@ GeneralUserSettings.prototype.onBuild = function()
|
|||
});
|
||||
});
|
||||
|
||||
}, 50);
|
||||
}, Enums.Magics.Time50ms);
|
||||
};
|
||||
|
||||
GeneralUserSettings.prototype.onShow = function()
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ function MessageUserStore()
|
|||
return this.messageCurrentLoading();
|
||||
}, this);
|
||||
|
||||
this.messageLoadingThrottle = ko.observable(false).extend({'throttle': 50});
|
||||
this.messageLoadingThrottle = ko.observable(false).extend({'throttle': Enums.Magics.Time50ms});
|
||||
|
||||
this.messageFullScreenMode = ko.observable(false);
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ function MessageUserStore()
|
|||
|
||||
this.onMessageResponse = _.bind(this.onMessageResponse, this);
|
||||
|
||||
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
|
||||
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, Enums.Magics.Time30s);
|
||||
}
|
||||
|
||||
MessageUserStore.prototype.computers = function()
|
||||
|
|
@ -174,7 +174,7 @@ MessageUserStore.prototype.subscribers = function()
|
|||
oItem.newForAnimation(false);
|
||||
}
|
||||
});
|
||||
}, 500));
|
||||
}, Enums.Magics.Time500ms));
|
||||
|
||||
this.message.subscribe(function(oMessage) {
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ MessageUserStore.prototype.purgeMessageBodyCache = function()
|
|||
{
|
||||
_.delay(function() {
|
||||
oMessagesDom.find('.rl-cache-purge').remove();
|
||||
}, 300);
|
||||
}, Enums.Magics.Time350ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -393,7 +393,7 @@ MessageUserStore.prototype.removeMessagesFromList = function(
|
|||
_.each(aMessages, function(item) {
|
||||
self.messageList.remove(item);
|
||||
});
|
||||
}, 400);
|
||||
}, Enums.Magics.Time350ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ NotificationUserStore.prototype.displayDesktopNotification = function(sImageSrc,
|
|||
oLocalNotifications.close();
|
||||
}
|
||||
};
|
||||
}(oNotification)), 7000);
|
||||
}(oNotification)), Enums.Magics.Time7s);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ SettingsUserStore.prototype.populate = function()
|
|||
{
|
||||
self.iAutoLogoutTimer = window.setTimeout(function() {
|
||||
Events.pub('rl.auto-logout');
|
||||
}, self.autoLogout() * 1000 * 60);
|
||||
}, self.autoLogout() * Enums.Magics.Time1m);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ LoginAdminView.prototype.onShow = function()
|
|||
|
||||
_.delay(_.bind(function() {
|
||||
this.loginFocus(true);
|
||||
}, this), 100);
|
||||
}, this), Enums.Magics.Time100ms);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ var
|
|||
_ = require('_'),
|
||||
|
||||
Globals = require('Common/Globals'),
|
||||
Enums = require('Common/Enums'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView');
|
||||
|
|
@ -61,7 +62,7 @@ MenuSettingsAdminView.prototype.onBuild = function(oDom)
|
|||
}
|
||||
}
|
||||
|
||||
}, 200));
|
||||
}, Enums.Magics.Time200ms));
|
||||
};
|
||||
|
||||
module.exports = MenuSettingsAdminView;
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ function ComposePopupView()
|
|||
_.delay(function() {
|
||||
kn.showScreenPopup(require('View/Popup/Contacts'),
|
||||
[true, self.sLastFocusedField]);
|
||||
}, 200);
|
||||
}, Enums.Magics.Time200ms);
|
||||
}
|
||||
|
||||
}, function() {
|
||||
|
|
@ -586,7 +586,7 @@ function ComposePopupView()
|
|||
this.bDisabeCloseOnEsc = true;
|
||||
this.sDefaultKeyScope = Enums.KeyState.Compose;
|
||||
|
||||
this.tryToClosePopup = _.debounce(_.bind(this.tryToClosePopup, this), 200);
|
||||
this.tryToClosePopup = _.debounce(_.bind(this.tryToClosePopup, this), Enums.Magics.Time200ms);
|
||||
|
||||
this.emailsSource = _.bind(this.emailsSource, this);
|
||||
this.autosaveFunction = _.bind(this.autosaveFunction, this);
|
||||
|
|
@ -613,7 +613,7 @@ ComposePopupView.prototype.autosaveFunction = function()
|
|||
ComposePopupView.prototype.autosaveStart = function()
|
||||
{
|
||||
window.clearTimeout(this.iTimer);
|
||||
this.iTimer = window.setTimeout(this.autosaveFunction, 1000 * 60 * 1);
|
||||
this.iTimer = window.setTimeout(this.autosaveFunction, Enums.Magics.Time1m);
|
||||
};
|
||||
|
||||
ComposePopupView.prototype.autosaveStop = function()
|
||||
|
|
@ -1361,7 +1361,7 @@ ComposePopupView.prototype.setFocusInPopup = function()
|
|||
}
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}, Enums.Magics.Time100ms);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1451,7 +1451,7 @@ ComposePopupView.prototype.onBuild = function()
|
|||
});
|
||||
|
||||
Events.sub('window.resize.real', this.resizerTrigger);
|
||||
Events.sub('window.resize.real', _.debounce(this.resizerTrigger, 50));
|
||||
Events.sub('window.resize.real', _.debounce(this.resizerTrigger, Enums.Magics.Time50ms));
|
||||
|
||||
if (this.dropboxEnabled() && this.dropboxApiKey() && !window.Dropbox)
|
||||
{
|
||||
|
|
@ -1478,7 +1478,7 @@ ComposePopupView.prototype.onBuild = function()
|
|||
{
|
||||
self.oEditor.resize();
|
||||
}
|
||||
}, 5000);
|
||||
}, Enums.Magics.Time5s);
|
||||
};
|
||||
|
||||
ComposePopupView.prototype.driveCallback = function(sAccessToken, oData)
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ function ComposeOpenPgpPopupView()
|
|||
|
||||
self.submitRequest(false);
|
||||
|
||||
}, 10);
|
||||
}, Enums.Magics.Time20ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ function ContactsPopupView()
|
|||
_.delay(function() {
|
||||
kn.showScreenPopup(require('View/Popup/Compose'),
|
||||
[Enums.ComposeType.Empty, null, aToEmails, aCcEmails, aBccEmails]);
|
||||
}, 200);
|
||||
}, Enums.Magics.Time200ms);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -338,7 +338,7 @@ function ContactsPopupView()
|
|||
|
||||
_.delay(function() {
|
||||
self.viewSaveTrigger(bRes ? Enums.SaveSettingsStep.TrueResult : Enums.SaveSettingsStep.FalseResult);
|
||||
}, 300);
|
||||
}, Enums.Magics.Time350ms);
|
||||
|
||||
if (bRes)
|
||||
{
|
||||
|
|
@ -346,7 +346,7 @@ function ContactsPopupView()
|
|||
|
||||
_.delay(function() {
|
||||
self.viewSaveTrigger(Enums.SaveSettingsStep.Idle);
|
||||
}, 1000);
|
||||
}, Enums.Magics.Time1s);
|
||||
}
|
||||
|
||||
}, sRequestUid, this.viewID(), aProperties);
|
||||
|
|
@ -549,13 +549,11 @@ ContactsPopupView.prototype.removeCheckedOrSelectedContactsFromList = function()
|
|||
}
|
||||
|
||||
_.delay(function() {
|
||||
|
||||
_.each(aContacts, function(oContact) {
|
||||
oKoContacts.remove(oContact);
|
||||
Utils.delegateRunOnDestroy(oContact);
|
||||
});
|
||||
|
||||
}, 500);
|
||||
}, Enums.Magics.Time500ms);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -578,7 +576,7 @@ ContactsPopupView.prototype.deleteSelectedContacts = function()
|
|||
*/
|
||||
ContactsPopupView.prototype.deleteResponse = function(sResult, oData)
|
||||
{
|
||||
if (500 < (Enums.StorageResultType.Success === sResult && oData && oData.Time ? Utils.pInt(oData.Time) : 0))
|
||||
if (Enums.Magics.Time500ms < (Enums.StorageResultType.Success === sResult && oData && oData.Time ? Utils.pInt(oData.Time) : 0))
|
||||
{
|
||||
this.reloadContactList(this.bDropPageAfterDelete);
|
||||
}
|
||||
|
|
@ -587,7 +585,7 @@ ContactsPopupView.prototype.deleteResponse = function(sResult, oData)
|
|||
var self = this;
|
||||
_.delay(function() {
|
||||
self.reloadContactList(self.bDropPageAfterDelete);
|
||||
}, 500);
|
||||
}, Enums.Magics.Time500ms);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -248,19 +248,18 @@ function DomainPopupView()
|
|||
if (this.enableSmartPorts())
|
||||
{
|
||||
var iPort = Utils.pInt(this.imapPort());
|
||||
sValue = Utils.pString(sValue);
|
||||
switch (sValue)
|
||||
switch (Utils.pString(sValue))
|
||||
{
|
||||
case '0':
|
||||
if (993 === iPort)
|
||||
if (Enums.Ports.ImapSsl === iPort)
|
||||
{
|
||||
this.imapPort('143');
|
||||
this.imapPort(Utils.pString(Enums.Ports.Imap));
|
||||
}
|
||||
break;
|
||||
case '1':
|
||||
if (143 === iPort)
|
||||
if (Enums.Ports.Imap === iPort)
|
||||
{
|
||||
this.imapPort('993');
|
||||
this.imapPort(Utils.pString(Enums.Ports.ImapSsl));
|
||||
}
|
||||
break;
|
||||
// no default
|
||||
|
|
@ -272,25 +271,24 @@ function DomainPopupView()
|
|||
if (this.enableSmartPorts())
|
||||
{
|
||||
var iPort = Utils.pInt(this.smtpPort());
|
||||
sValue = Utils.pString(sValue);
|
||||
switch (sValue)
|
||||
switch (Utils.pString(sValue))
|
||||
{
|
||||
case '0':
|
||||
if (465 === iPort || 587 === iPort)
|
||||
if (Enums.Ports.SmtpSsl === iPort || Enums.Ports.SmtpStartTls === iPort)
|
||||
{
|
||||
this.smtpPort('25');
|
||||
this.smtpPort(Utils.pString(Enums.Ports.Smtp));
|
||||
}
|
||||
break;
|
||||
case '1':
|
||||
if (25 === iPort || 587 === iPort)
|
||||
if (Enums.Ports.Smtp === iPort || Enums.Ports.SmtpStartTls === iPort)
|
||||
{
|
||||
this.smtpPort('465');
|
||||
this.smtpPort(Utils.pString(Enums.Ports.SmtpSsl));
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
if (25 === iPort || 465 === iPort)
|
||||
if (Enums.Ports.Smtp === iPort || Enums.Ports.SmtpSsl === iPort)
|
||||
{
|
||||
this.smtpPort('587');
|
||||
this.smtpPort(Utils.pString(Enums.Ports.SmtpStartTls));
|
||||
}
|
||||
break;
|
||||
// no default
|
||||
|
|
@ -398,7 +396,6 @@ DomainPopupView.prototype.onHide = function()
|
|||
this.sieveSettings(false);
|
||||
};
|
||||
|
||||
|
||||
DomainPopupView.prototype.onShow = function(oDomain)
|
||||
{
|
||||
this.saving(false);
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ FilterPopupView.prototype.populateOptions = function()
|
|||
]);
|
||||
};
|
||||
|
||||
|
||||
FilterPopupView.prototype.removeCondition = function(oConditionToDelete)
|
||||
{
|
||||
if (this.filter())
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function FolderSystemPopupView()
|
|||
'NullFolder': 'NullFolder'
|
||||
});
|
||||
|
||||
}, 1000);
|
||||
}, Enums.Magics.Time1s);
|
||||
|
||||
fCallback = function() {
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ KeyboardShortcutsHelpPopupView.prototype.onBuild = function(oDom)
|
|||
|
||||
return true;
|
||||
|
||||
}, 100));
|
||||
}, Enums.Magics.Time100ms));
|
||||
};
|
||||
|
||||
module.exports = KeyboardShortcutsHelpPopupView;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ function MessageOpenPgpPopupView()
|
|||
this.cancelCommand();
|
||||
this.resultCallback(oPrivateKey);
|
||||
|
||||
}, this), 100);
|
||||
}, this), Enums.Magics.Time100ms);
|
||||
|
||||
}, function() {
|
||||
return !this.submitRequest();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ var
|
|||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
PgpStore = require('Stores/User/Pgp'),
|
||||
|
|
@ -24,7 +25,7 @@ function NewOpenPgpKeyPopupView()
|
|||
|
||||
this.name = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
this.keyBitLength = ko.observable(2048);
|
||||
this.keyBitLength = ko.observable(Enums.Magics.BitLength2048);
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ function NewOpenPgpKeyPopupView()
|
|||
self.submitRequest(false);
|
||||
}
|
||||
|
||||
}, 100);
|
||||
}, Enums.Magics.Time100ms);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
|
@ -108,7 +109,7 @@ NewOpenPgpKeyPopupView.prototype.clearPopup = function()
|
|||
|
||||
this.email('');
|
||||
this.email.error(false);
|
||||
this.keyBitLength(2048);
|
||||
this.keyBitLength(Enums.Magics.BitLength2048);
|
||||
};
|
||||
|
||||
NewOpenPgpKeyPopupView.prototype.onShow = function()
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function PluginPopupView()
|
|||
this.bDisabeCloseOnEsc = true;
|
||||
this.sDefaultKeyScope = Enums.KeyState.All;
|
||||
|
||||
this.tryToClosePopup = _.debounce(_.bind(this.tryToClosePopup, this), 200);
|
||||
this.tryToClosePopup = _.debounce(_.bind(this.tryToClosePopup, this), Enums.Magics.Time200ms);
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,10 +91,9 @@ function TwoFactorConfigurationPopupView()
|
|||
|
||||
this.viewTwoFactorStatus = ko.computed(function() {
|
||||
Translator.trigger();
|
||||
return Translator.i18n(
|
||||
this.twoFactorStatus() ?
|
||||
'POPUPS_TWO_FACTOR_CFG/TWO_FACTOR_SECRET_CONFIGURED_DESC' :
|
||||
'POPUPS_TWO_FACTOR_CFG/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC'
|
||||
return Translator.i18n(this.twoFactorStatus() ?
|
||||
'POPUPS_TWO_FACTOR_CFG/TWO_FACTOR_SECRET_CONFIGURED_DESC' :
|
||||
'POPUPS_TWO_FACTOR_CFG/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC'
|
||||
);
|
||||
}, this);
|
||||
|
||||
|
|
@ -111,7 +110,6 @@ function TwoFactorConfigurationPopupView()
|
|||
kn.extendAsViewModel(['View/Popup/TwoFactorConfiguration', 'TwoFactorConfigurationPopupView'], TwoFactorConfigurationPopupView);
|
||||
_.extend(TwoFactorConfigurationPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
|
||||
TwoFactorConfigurationPopupView.prototype.showSecret = function()
|
||||
{
|
||||
this.secreting(true);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ AbstractSystemDropDownUserView.prototype.accountClick = function(oAccount, oEven
|
|||
|
||||
_.delay(function() {
|
||||
AccountStore.accounts.loading(false);
|
||||
}, 1000);
|
||||
}, Enums.Magics.Time1s);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ function LoginUserView()
|
|||
|
||||
_.delay(function() {
|
||||
self.additionalCode.focused(true);
|
||||
}, 100);
|
||||
}, Enums.Magics.Time100ms);
|
||||
}
|
||||
else if (oData.Admin)
|
||||
{
|
||||
|
|
@ -476,7 +476,7 @@ LoginUserView.prototype.onBuild = function()
|
|||
|
||||
});
|
||||
|
||||
}, 50);
|
||||
}, Enums.Magics.Time50ms);
|
||||
|
||||
Utils.triggerAutocompleteInputChange(true);
|
||||
};
|
||||
|
|
@ -500,7 +500,7 @@ LoginUserView.prototype.selectLanguageOnTab = function(bShift)
|
|||
var self = this;
|
||||
_.delay(function() {
|
||||
self.emailFocus(true);
|
||||
}, 5);
|
||||
}, Enums.Magics.Time50ms);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ FolderListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
|
||||
var
|
||||
iIndex = -1,
|
||||
iKeyCode = handler && 'up' === handler.shortcut ? 38 : 40,
|
||||
iKeyCode = handler && 'up' === handler.shortcut ? Enums.EventKeyCode.Up : Enums.EventKeyCode.Down,
|
||||
$items = $('.b-folders .e-item .e-link:not(.hidden):visible', oDom);
|
||||
|
||||
if (event && $items.length)
|
||||
|
|
@ -154,11 +154,11 @@ FolderListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
$items.eq(iIndex).removeClass('focused');
|
||||
}
|
||||
|
||||
if (38 === iKeyCode && 0 < iIndex)
|
||||
if (Enums.EventKeyCode.Up === iKeyCode && 0 < iIndex)
|
||||
{
|
||||
iIndex -= 1;
|
||||
}
|
||||
else if (40 === iKeyCode && iIndex < $items.length - 1)
|
||||
else if (Enums.EventKeyCode.Down === iKeyCode && iIndex < $items.length - 1)
|
||||
{
|
||||
iIndex += 1;
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ FolderListMailBoxUserView.prototype.messagesDropOver = function(oFolder)
|
|||
oFolder.collapsed(false);
|
||||
require('App/User').default.setExpandedFolder(oFolder.fullNameHash, true);
|
||||
Utils.windowResize();
|
||||
}, 500);
|
||||
}, Enums.Magics.Time500ms);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ MessageListMailBoxUserView.prototype.goToUpUpOrDownDown = function(bUp)
|
|||
self.gotoPage(bUp ? oPrev : oNext);
|
||||
}
|
||||
|
||||
}, 350);
|
||||
}, Enums.Magics.Time350ms);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
|
@ -461,7 +461,7 @@ MessageListMailBoxUserView.prototype.searchEnterAction = function()
|
|||
MessageListMailBoxUserView.prototype.printableMessageCountForDeletion = function()
|
||||
{
|
||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
|
||||
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : ''; // eslint-disable-line no-magic-numbers
|
||||
};
|
||||
|
||||
MessageListMailBoxUserView.prototype.cancelSearch = function()
|
||||
|
|
@ -772,7 +772,7 @@ MessageListMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
|
||||
if (!Globals.bMobileDevice && ifvisible && Settings.capa(Enums.Capa.Prefetch))
|
||||
{
|
||||
ifvisible.setIdleDuration(10);
|
||||
ifvisible.setIdleDuration(Enums.Magics.ifvisibleIdle10s);
|
||||
|
||||
ifvisible.idle(function() {
|
||||
self.prefetchNextTick();
|
||||
|
|
@ -980,7 +980,7 @@ MessageListMailBoxUserView.prototype.prefetchNextTick = function()
|
|||
{
|
||||
self.prefetchNextTick();
|
||||
}
|
||||
}, 1000);
|
||||
}, Enums.Magics.Time1s);
|
||||
|
||||
}, oMessage.folderFullNameRaw, oMessage.uid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ MessageViewMailBoxUserView.prototype.checkHeaderHeight = function()
|
|||
if (this.oHeaderDom)
|
||||
{
|
||||
this.viewBodyTopValue(this.message() ? this.oHeaderDom.height() +
|
||||
20 /* padding-(top/bottom): 20px */ + 1 /* borded-bottom: 1px */ : 0);
|
||||
Enums.Magics.Size20px /* padding-(top/bottom): 20px */ + Enums.Magics.Size1px /* borded-bottom: 1px */ : 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -661,13 +661,13 @@ MessageViewMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
|
||||
Events.sub('window.resize', _.throttle(function() {
|
||||
_.delay(fCheckHeaderHeight, 1);
|
||||
_.delay(fCheckHeaderHeight, 200);
|
||||
_.delay(fCheckHeaderHeight, 500);
|
||||
}, 50));
|
||||
_.delay(fCheckHeaderHeight, Enums.Magics.Time200ms);
|
||||
_.delay(fCheckHeaderHeight, Enums.Magics.Time500ms);
|
||||
}, Enums.Magics.Time50ms));
|
||||
|
||||
this.showFullInfo.subscribe(function(value) {
|
||||
Utils.windowResize();
|
||||
Utils.windowResize(250);
|
||||
Utils.windowResize(Enums.Magics.Time200ms);
|
||||
Local.set(Enums.ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0');
|
||||
});
|
||||
|
||||
|
|
@ -695,7 +695,7 @@ MessageViewMailBoxUserView.prototype.onBuild = function(oDom)
|
|||
oDom
|
||||
.on('click', 'a', function(oEvent) {
|
||||
// setup maito protocol
|
||||
return !(!!oEvent && 3 !== oEvent.which && Utils.mailToHelper(
|
||||
return !(!!oEvent && Enums.Magics.EventWhichMouseMiddle !== oEvent.which && Utils.mailToHelper(
|
||||
$(this).attr('href'), Settings.capa(Enums.Capa.Composer) ? require('View/Popup/Compose') : null
|
||||
));
|
||||
})
|
||||
|
|
@ -1033,11 +1033,11 @@ MessageViewMailBoxUserView.prototype.scrollMessageToTop = function()
|
|||
{
|
||||
if (this.oMessageScrollerDom)
|
||||
{
|
||||
if (50 < this.oMessageScrollerDom.scrollTop())
|
||||
if (Enums.Size50px < this.oMessageScrollerDom.scrollTop())
|
||||
{
|
||||
this.oMessageScrollerDom
|
||||
.scrollTop(50)
|
||||
.animate({'scrollTop': 0}, 200);
|
||||
.scrollTop(Enums.Size50px)
|
||||
.animate({'scrollTop': 0}, Enums.Time200ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1192,7 +1192,7 @@ MessageViewMailBoxUserView.prototype.showImages = function(oMessage)
|
|||
MessageViewMailBoxUserView.prototype.printableCheckedMessageCount = function()
|
||||
{
|
||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
|
||||
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : ''; // eslint-disable-line no-magic-numbers
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
import window from 'window';
|
||||
|
||||
import {Promise} from 'es6-promise-polyfill/promise.js';
|
||||
import {jassl} from 'jassl';
|
||||
import {progressJs} from '../vendors/progress.js/src/progress.js';
|
||||
import {jassl} from 'jassl';
|
||||
|
||||
window.jassl = jassl;
|
||||
window.Promise = window.Promise || Promise;
|
||||
window.progressJs = window.progressJs || progressJs();
|
||||
window.jassl = jassl;
|
||||
|
||||
window.progressJs.onbeforeend(() => {
|
||||
const _$ = window.$;
|
||||
|
|
@ -16,7 +16,7 @@ window.progressJs.onbeforeend(() => {
|
|||
_$('.progressjs-container').hide();
|
||||
window.setTimeout(() => {
|
||||
_$('.progressjs-container').remove();
|
||||
}, 200);
|
||||
}, 200); // eslint-disable-line no-magic-numbers
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,6 @@
|
|||
"pikaday": "^1.4.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"rimraf": "*",
|
||||
"webpack": "2.1.0-beta.13"
|
||||
"webpack": "^2.1.0-beta.15"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue