JavaScript string compare '' is always a ToBoolean

See https://www.ecma-international.org/ecma-262/5.1/#sec-9.2
This commit is contained in:
djmaze 2020-07-28 17:20:14 +02:00
parent 82bed1ed80
commit 2ba34532c2
57 changed files with 213 additions and 218 deletions

View file

@ -61,23 +61,23 @@ Things might work in Edge 15-18, Firefox 47-62 and Chrome 54-68 due to one polyf
|js/* |1.14.0 |native | |js/* |1.14.0 |native |
|----------- |--------: |--------: | |----------- |--------: |--------: |
|admin.js |2.130.942 |1.359.501 | |admin.js |2.130.942 |1.356.246 |
|app.js |4.184.455 |3.121.743 | |app.js |4.184.455 |3.117.728 |
|boot.js | 671.522 | 109.651 | |boot.js | 671.522 | 109.651 |
|libs.js | 647.614 | 508.324 | |libs.js | 647.614 | 508.324 |
|polyfills.js | 325.834 | 0 | |polyfills.js | 325.834 | 0 |
|TOTAL js |7.960.367 |5.097.142 | |TOTAL js |7.960.367 |5.091.949 |
|js/min/* |1.14.0 |native | |js/min/* |1.14.0 |native |
|----------- |--------: |--------: | |--------------- |--------: |--------: |
|admin.js | 252.147 | 177.094 | |admin.min.js | 252.147 | 176.702 |
|app.js | 511.202 | 409.173 | |app.min.js | 511.202 | 408.359 |
|boot.js | 66.007 | 13.380 | |boot.min.js | 66.007 | 13.380 |
|libs.js | 572.545 | 465.247 | |libs.min.js | 572.545 | 465.247 |
|polyfills.js | 32.452 | 0 | |polyfills.min.js | 32.452 | 0 |
|TOTAL js/min |1.434.353 |1.064.753 | |TOTAL js/min |1.434.353 |1.063.688 |
369.600 bytes is not much, but it feels faster. 370.665 bytes is not much, but it feels faster.
### PHP73 branch ### PHP73 branch

View file

@ -581,9 +581,7 @@ class AppUser extends AbstractApp {
if (StorageResultType.Success === sResult && oData.Result) { if (StorageResultType.Success === sResult && oData.Result) {
const counts = {}, const counts = {},
sAccountEmail = AccountStore.email(); sAccountEmail = AccountStore.email();
let parentEmail = Settings.settingsGet('ParentEmail'); let parentEmail = Settings.settingsGet('ParentEmail') || sAccountEmail;
parentEmail = '' === parentEmail ? sAccountEmail : parentEmail;
if (isArray(oData.Result.Accounts)) { if (isArray(oData.Result.Accounts)) {
AccountStore.accounts().forEach(oAccount => { AccountStore.accounts().forEach(oAccount => {
@ -667,7 +665,7 @@ class AppUser extends AbstractApp {
* @param {Array=} list = [] * @param {Array=} list = []
*/ */
folderInformation(folder, list) { folderInformation(folder, list) {
if ('' !== trim(folder)) { if (trim(folder)) {
Remote.folderInformation( Remote.folderInformation(
(result, data) => { (result, data) => {
if (StorageResultType.Success === result) { if (StorageResultType.Success === result) {
@ -727,7 +725,7 @@ class AppUser extends AbstractApp {
); );
const hash = getFolderHash(data.Result.Folder); const hash = getFolderHash(data.Result.Folder);
if (data.Result.Hash !== hash || '' === hash || unreadCountChange) { if (!hash || unreadCountChange || data.Result.Hash !== hash) {
if (folderFromCache.fullNameRaw === FolderStore.currentFolderFullNameRaw()) { if (folderFromCache.fullNameRaw === FolderStore.currentFolderFullNameRaw()) {
this.reloadMessageList(); this.reloadMessageList();
} else if (getFolderInboxName() === folderFromCache.fullNameRaw) { } else if (getFolderInboxName() === folderFromCache.fullNameRaw) {
@ -782,7 +780,7 @@ class AppUser extends AbstractApp {
clearMessageFlagsFromCacheByFolder(folder.fullNameRaw); clearMessageFlagsFromCacheByFolder(folder.fullNameRaw);
} }
if (item.Hash !== hash || '' === hash) { if (!hash || item.Hash !== hash) {
if (folder.fullNameRaw === FolderStore.currentFolderFullNameRaw()) { if (folder.fullNameRaw === FolderStore.currentFolderFullNameRaw()) {
this.reloadMessageList(); this.reloadMessageList();
} }
@ -823,7 +821,7 @@ class AppUser extends AbstractApp {
rootUids = messages.map(oMessage => oMessage && oMessage.uid ? oMessage.uid : null) rootUids = messages.map(oMessage => oMessage && oMessage.uid ? oMessage.uid : null)
.filter((value, index, self) => !!value && self.indexOf(value) == index); .filter((value, index, self) => !!value && self.indexOf(value) == index);
if ('' !== sFolderFullNameRaw && rootUids.length) { if (sFolderFullNameRaw && rootUids.length) {
switch (iSetAction) { switch (iSetAction) {
case MessageSetAction.SetSeen: case MessageSetAction.SetSeen:
rootUids.forEach(sSubUid => { rootUids.forEach(sSubUid => {
@ -1083,7 +1081,7 @@ class AppUser extends AbstractApp {
this.bootend(); this.bootend();
if (value) { if (value) {
if ('' !== startupUrl) { if (startupUrl) {
routeOff(); routeOff();
setHash(root(startupUrl), true); setHash(root(startupUrl), true);
routeOn(); routeOn();

View file

@ -19,9 +19,9 @@ class Audio {
this.supported = !bMobileDevice && !bSafari && !!this.player && !!this.player.play; this.supported = !bMobileDevice && !bSafari && !!this.player && !!this.player.play;
if (this.supported && this.player && this.player.canPlayType) { if (this.supported && this.player && this.player.canPlayType) {
this.supportedMp3 = '' !== this.player.canPlayType('audio/mpeg;').replace(/no/, ''); this.supportedMp3 = !!this.player.canPlayType('audio/mpeg;').replace(/no/, '');
this.supportedWav = '' !== this.player.canPlayType('audio/wav; codecs="1"').replace(/no/, ''); this.supportedWav = !!this.player.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
this.supportedOgg = '' !== this.player.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, ''); this.supportedOgg = !!this.player.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
this.supportedNotification = this.supported && this.supportedMp3; this.supportedNotification = this.supported && this.supportedMp3;
} }
@ -81,7 +81,7 @@ class Audio {
name = trim(name.substr(0, name.length - 4)); name = trim(name.substr(0, name.length - 4));
} }
return '' === name ? 'audio' : name; return name || 'audio';
} }
playMp3(url, name) { playMp3(url, name) {

View file

@ -89,7 +89,7 @@ export function clearNewMessageCache() {
* @returns {string} * @returns {string}
*/ */
export function getFolderInboxName() { export function getFolderInboxName() {
return '' === inboxFolderName ? 'INBOX' : inboxFolderName; return inboxFolderName || 'INBOX';
} }
/** /**
@ -97,7 +97,7 @@ export function getFolderInboxName() {
* @returns {string} * @returns {string}
*/ */
export function getFolderFullNameRaw(folderHash) { export function getFolderFullNameRaw(folderHash) {
return '' !== folderHash && FOLDERS_NAME_CACHE[folderHash] ? FOLDERS_NAME_CACHE[folderHash] : ''; return folderHash && FOLDERS_NAME_CACHE[folderHash] ? FOLDERS_NAME_CACHE[folderHash] : '';
} }
/** /**
@ -106,7 +106,7 @@ export function getFolderFullNameRaw(folderHash) {
*/ */
export function setFolderFullNameRaw(folderHash, folderFullNameRaw) { export function setFolderFullNameRaw(folderHash, folderFullNameRaw) {
FOLDERS_NAME_CACHE[folderHash] = folderFullNameRaw; FOLDERS_NAME_CACHE[folderHash] = folderFullNameRaw;
if ('INBOX' === folderFullNameRaw || '' === inboxFolderName) { if (!inboxFolderName || 'INBOX' === folderFullNameRaw) {
inboxFolderName = folderFullNameRaw; inboxFolderName = folderFullNameRaw;
} }
} }
@ -116,7 +116,7 @@ export function setFolderFullNameRaw(folderHash, folderFullNameRaw) {
* @returns {string} * @returns {string}
*/ */
export function getFolderHash(folderFullNameRaw) { export function getFolderHash(folderFullNameRaw) {
return '' !== folderFullNameRaw && FOLDERS_HASH_CACHE[folderFullNameRaw] ? FOLDERS_HASH_CACHE[folderFullNameRaw] : ''; return folderFullNameRaw && FOLDERS_HASH_CACHE[folderFullNameRaw] ? FOLDERS_HASH_CACHE[folderFullNameRaw] : '';
} }
/** /**
@ -124,7 +124,7 @@ export function getFolderHash(folderFullNameRaw) {
* @param {string} folderHash * @param {string} folderHash
*/ */
export function setFolderHash(folderFullNameRaw, folderHash) { export function setFolderHash(folderFullNameRaw, folderHash) {
if ('' !== folderFullNameRaw) { if (folderFullNameRaw) {
FOLDERS_HASH_CACHE[folderFullNameRaw] = folderHash; FOLDERS_HASH_CACHE[folderFullNameRaw] = folderHash;
} }
} }
@ -134,7 +134,7 @@ export function setFolderHash(folderFullNameRaw, folderHash) {
* @returns {string} * @returns {string}
*/ */
export function getFolderUidNext(folderFullNameRaw) { export function getFolderUidNext(folderFullNameRaw) {
return '' !== folderFullNameRaw && FOLDERS_UID_NEXT_CACHE[folderFullNameRaw] return folderFullNameRaw && FOLDERS_UID_NEXT_CACHE[folderFullNameRaw]
? FOLDERS_UID_NEXT_CACHE[folderFullNameRaw] ? FOLDERS_UID_NEXT_CACHE[folderFullNameRaw]
: ''; : '';
} }
@ -152,7 +152,7 @@ export function setFolderUidNext(folderFullNameRaw, uidNext) {
* @returns {?FolderModel} * @returns {?FolderModel}
*/ */
export function getFolderFromCacheList(folderFullNameRaw) { export function getFolderFromCacheList(folderFullNameRaw) {
return '' !== folderFullNameRaw && FOLDERS_CACHE[folderFullNameRaw] ? FOLDERS_CACHE[folderFullNameRaw] : null; return folderFullNameRaw && FOLDERS_CACHE[folderFullNameRaw] ? FOLDERS_CACHE[folderFullNameRaw] : null;
} }
/** /**

View file

@ -371,7 +371,7 @@ export function mailBox(folder, page = 1, search = '', threadUid = '') {
let result = HASH_PREFIX + 'mailbox/'; let result = HASH_PREFIX + 'mailbox/';
if ('' !== folder) { if (folder) {
const resultThreadUid = pInt(threadUid); const resultThreadUid = pInt(threadUid);
result += window.encodeURI(folder) + (0 < resultThreadUid ? '~' + resultThreadUid : ''); result += window.encodeURI(folder) + (0 < resultThreadUid ? '~' + resultThreadUid : '');
} }
@ -381,7 +381,7 @@ export function mailBox(folder, page = 1, search = '', threadUid = '') {
result += '/p' + page; result += '/p' + page;
} }
if ('' !== search) { if (search) {
result = result.replace(/[/]+$/, ''); result = result.replace(/[/]+$/, '');
result += '/' + window.encodeURI(search); result += '/' + window.encodeURI(search);
} }

View file

@ -561,7 +561,7 @@ class Selector {
const uid = this.getItemUid(item); const uid = this.getItemUid(item);
if (event && event.shiftKey) { if (event && event.shiftKey) {
if ('' !== uid && '' !== this.sLastUid && uid !== this.sLastUid) { if (uid && this.sLastUid && uid !== this.sLastUid) {
list = this.list(); list = this.list();
checked = item.checked(); checked = item.checked();
@ -585,7 +585,7 @@ class Selector {
} }
} }
this.sLastUid = '' === uid ? '' : uid; this.sLastUid = uid || '';
} }
/** /**
@ -598,7 +598,7 @@ class Selector {
if (event) { if (event) {
if (event.shiftKey && !(event.ctrlKey || event.metaKey) && !event.altKey) { if (event.shiftKey && !(event.ctrlKey || event.metaKey) && !event.altKey) {
click = false; click = false;
if ('' === this.sLastUid) { if (!this.sLastUid) {
this.sLastUid = this.getItemUid(item); this.sLastUid = this.getItemUid(item);
} }

View file

@ -68,7 +68,7 @@ export function isPosNumeric(value, includeZero = true) {
* @returns {number} * @returns {number}
*/ */
export function pInt(value, defaultValur = 0) { export function pInt(value, defaultValur = 0) {
const result = isNormal(value) && '' !== value ? window.parseInt(value, 10) : defaultValur; const result = isNormal(value) && value ? window.parseInt(value, 10) : defaultValur;
return window.isNaN(result) ? defaultValur : result; return window.isNaN(result) ? defaultValur : result;
} }
@ -309,7 +309,7 @@ export function replySubjectAdd(prefix, subject) {
const parts = [], const parts = [],
prefixIsRe = !fwd; prefixIsRe = !fwd;
if ('' !== subject) { if (subject) {
subject.split(':').forEach(part => { subject.split(':').forEach(part => {
const trimmedPart = trim(part); const trimmedPart = trim(part);
if (!drop && (/^(RE|FWD)$/i.test(trimmedPart) || /^(RE|FWD)[[(][\d]+[\])]$/i.test(trimmedPart))) { if (!drop && (/^(RE|FWD)$/i.test(trimmedPart) || /^(RE|FWD)[[(][\d]+[\])]$/i.test(trimmedPart))) {
@ -814,7 +814,7 @@ export function plainToHtml(plain, findEmailAndLinksInText = false) {
aNextText.push('~~~blockquote~~~'); aNextText.push('~~~blockquote~~~');
aNextText.push(sLine.substr(1)); aNextText.push(sLine.substr(1));
} else if (!bStart && bIn) { } else if (!bStart && bIn) {
if ('' !== sLine) { if (sLine) {
bIn = false; bIn = false;
aNextText.push('~~~/blockquote~~~'); aNextText.push('~~~/blockquote~~~');
aNextText.push(sLine); aNextText.push(sLine);
@ -1191,9 +1191,9 @@ export function computedPagenatorHelper(koCurrentPage, koPageCount) {
fAdd = (index, push = true, customName = '') => { fAdd = (index, push = true, customName = '') => {
const data = { const data = {
current: index === currentPage, current: index === currentPage,
name: '' === customName ? index.toString() : customName.toString(), name: customName ? customName.toString() : index.toString(),
custom: '' !== customName, custom: !!customName,
title: '' === customName ? '' : index.toString(), title: customName ? index.toString() : '',
value: index.toString() value: index.toString()
}; };

20
dev/External/ko.js vendored
View file

@ -160,12 +160,12 @@ ko.bindingHandlers.tooltip = {
} }
}); });
if ('' === sValue) { if (sValue) {
element.__opentip.activate();
} else {
element.__opentip.hide(); element.__opentip.hide();
element.__opentip.deactivate(); element.__opentip.deactivate();
element.__opentip.setContent(''); element.__opentip.setContent('');
} else {
element.__opentip.activate();
} }
if (isI18N) { if (isI18N) {
@ -245,11 +245,7 @@ ko.bindingHandlers.tooltipErrorTip = {
openTips = element.__opentip; openTips = element.__opentip;
if (openTips) { if (openTips) {
if ('' === value) { if (value) {
openTips.hide();
openTips.deactivate();
openTips.setContent('');
} else {
setTimeout(() => { setTimeout(() => {
if ($el.is(':visible')) { if ($el.is(':visible')) {
openTips.setContent(value); openTips.setContent(value);
@ -261,6 +257,10 @@ ko.bindingHandlers.tooltipErrorTip = {
openTips.setContent(''); openTips.setContent('');
} }
}, Magics.Time100ms); }, Magics.Time100ms);
} else {
openTips.hide();
openTips.deactivate();
openTips.setContent('');
} }
} }
} }
@ -1087,7 +1087,7 @@ ko.observable.fn.validateEmail = function() {
this.hasError = ko.observable(false); this.hasError = ko.observable(false);
this.subscribe((value) => { this.subscribe((value) => {
this.hasError('' !== value && !/^[^@\s]+@[^@\s]+$/.test(value)); this.hasError(value && !/^[^@\s]+@[^@\s]+$/.test(value));
}); });
this.valueHasMutated(); this.valueHasMutated();
@ -1098,7 +1098,7 @@ ko.observable.fn.validateSimpleEmail = function() {
this.hasError = ko.observable(false); this.hasError = ko.observable(false);
this.subscribe((value) => { this.subscribe((value) => {
this.hasError('' !== value && !/^.+@.+$/.test(value)); this.hasError(value && !/^.+@.+$/.test(value));
}); });
this.valueHasMutated(); this.valueHasMutated();

View file

@ -24,7 +24,7 @@ export function emailArrayToStringClear(emails) {
const result = []; const result = [];
if (isNonEmptyArray(emails)) { if (isNonEmptyArray(emails)) {
emails.forEach(email => { emails.forEach(email => {
if (email && email.email && '' !== email.name) { if (email && email.email && email.name) {
result.push(email.email); result.push(email.email);
} }
}); });

View file

@ -95,7 +95,7 @@ export function routeOn() {
* @returns {?Object} * @returns {?Object}
*/ */
export function screen(screenName) { export function screen(screenName) {
return '' !== screenName && !isUnd(SCREENS[screenName]) ? SCREENS[screenName] : null; return screenName && !isUnd(SCREENS[screenName]) ? SCREENS[screenName] : null;
} }
/** /**
@ -288,11 +288,11 @@ export function screenOnRoute(screenName, subPart) {
isSameScreen = false, isSameScreen = false,
cross = null; cross = null;
if ('' === pString(screenName)) { if (!pString(screenName)) {
screenName = defaultScreenName; screenName = defaultScreenName;
} }
if ('' !== screenName) { if (screenName) {
vmScreen = screen(screenName); vmScreen = screen(screenName);
if (!vmScreen) { if (!vmScreen) {
vmScreen = screen(defaultScreenName); vmScreen = screen(defaultScreenName);
@ -404,8 +404,8 @@ export function startScreens(screensClasses) {
const vmScreen = new CScreen(), const vmScreen = new CScreen(),
screenName = vmScreen ? vmScreen.screenName() : ''; screenName = vmScreen ? vmScreen.screenName() : '';
if (vmScreen && '' !== screenName) { if (vmScreen && screenName) {
if ('' === defaultScreenName) { if (!defaultScreenName) {
defaultScreenName = screenName; defaultScreenName = screenName;
} }

View file

@ -361,7 +361,7 @@ class AttachmentModel extends AbstractModel {
*/ */
linkThumbnailPreviewStyle() { linkThumbnailPreviewStyle() {
const link = this.linkThumbnail(); const link = this.linkThumbnail();
return '' === link ? '' : 'background:url(' + link + ')'; return link ? 'background:url(' + link + ')' : '';
} }
/** /**

View file

@ -46,8 +46,7 @@ class ComposeAttachmentModel extends AbstractModel {
}); });
this.title = ko.computed(() => { this.title = ko.computed(() => {
const error = this.error(); return this.error() || this.fileName();
return '' !== error ? error : this.fileName();
}); });
this.friendlySize = ko.computed(() => { this.friendlySize = ko.computed(() => {

View file

@ -35,14 +35,14 @@ class ContactModel extends AbstractModel {
name = trim(property[1] + ' ' + name); name = trim(property[1] + ' ' + name);
} else if (ContactPropertyType.LastName === property[0]) { } else if (ContactPropertyType.LastName === property[0]) {
name = trim(name + ' ' + property[1]); name = trim(name + ' ' + property[1]);
} else if ('' === email && ContactPropertyType.Email === property[0]) { } else if (!email && ContactPropertyType.Email === property[0]) {
email = property[1]; email = property[1];
} }
} }
}); });
} }
return '' === email ? null : [email, name]; return email ? [email, name] : null;
} }
/** /**

View file

@ -47,7 +47,7 @@ class EmailModel {
* @returns {boolean} * @returns {boolean}
*/ */
validate() { validate() {
return '' !== this.name || '' !== this.email; return this.name || this.email;
} }
/** /**
@ -87,7 +87,7 @@ class EmailModel {
this.dkimStatus = trim(json.DkimStatus || ''); this.dkimStatus = trim(json.DkimStatus || '');
this.dkimValue = trim(json.DkimValue || ''); this.dkimValue = trim(json.DkimValue || '');
result = '' !== this.email; result = !!this.email;
this.clearDuplicateName(); this.clearDuplicateName();
} }
@ -102,8 +102,8 @@ class EmailModel {
*/ */
toLine(friendlyView, wrapWithLink = false, useEncodeHtml = false) { toLine(friendlyView, wrapWithLink = false, useEncodeHtml = false) {
let result = ''; let result = '';
if ('' !== this.email) { if (this.email) {
if (friendlyView && '' !== this.name) { if (friendlyView && this.name) {
result = wrapWithLink result = wrapWithLink
? '<a href="mailto:' + ? '<a href="mailto:' +
encodeHtml(this.email) + encodeHtml(this.email) +
@ -119,7 +119,7 @@ class EmailModel {
// '" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '</a>' : (useEncodeHtml ? encodeHtml(this.name) : this.name); // '" target="_blank" tabindex="-1">' + encodeHtml(this.name) + '</a>' : (useEncodeHtml ? encodeHtml(this.name) : this.name);
} else { } else {
result = this.email; result = this.email;
if ('' !== this.name) { if (this.name) {
if (wrapWithLink) { if (wrapWithLink) {
result = result =
encodeHtml('"' + this.name + '" <') + encodeHtml('"' + this.name + '" <') +
@ -197,7 +197,7 @@ class EmailModel {
*/ */
parse(emailAddress) { parse(emailAddress) {
emailAddress = trim(emailAddress); emailAddress = trim(emailAddress);
if ('' === emailAddress) { if (!emailAddress) {
return false; return false;
} }

View file

@ -118,13 +118,13 @@ class FilterModel extends AbstractModel {
this.regDisposables( this.regDisposables(
this.name.subscribe((sValue) => { this.name.subscribe((sValue) => {
this.name.error('' === sValue); this.name.error(!sValue);
}) })
); );
this.regDisposables( this.regDisposables(
this.actionValue.subscribe((sValue) => { this.actionValue.subscribe((sValue) => {
this.actionValue.error('' === sValue); this.actionValue.error(!sValue);
}) })
); );
@ -139,7 +139,7 @@ class FilterModel extends AbstractModel {
} }
verify() { verify() {
if ('' === this.name()) { if (!this.name()) {
this.name.error(true); this.name.error(true);
return false; return false;
} }
@ -150,7 +150,7 @@ class FilterModel extends AbstractModel {
} }
} }
if ('' === this.actionValue()) { if (!this.actionValue()) {
if ([ if ([
FiltersAction.MoveTo, FiltersAction.MoveTo,
FiltersAction.Forward, FiltersAction.Forward,
@ -170,7 +170,7 @@ class FilterModel extends AbstractModel {
if ( if (
FiltersAction.Vacation === this.actionType() && FiltersAction.Vacation === this.actionType() &&
'' !== this.actionValueFourth() && this.actionValueFourth() &&
!this.actionValueFourth().includes('@') !this.actionValueFourth().includes('@')
) { ) {
this.actionValueFourth.error(true); this.actionValueFourth.error(true);

View file

@ -43,12 +43,12 @@ class FilterConditionModel extends AbstractModel {
} }
verify() { verify() {
if ('' === this.value()) { if (!this.value()) {
this.value.error(true); this.value.error(true);
return false; return false;
} }
if (FilterConditionField.Header === this.field() && '' === this.valueSecond()) { if (FilterConditionField.Header === this.field() && !this.valueSecond()) {
this.valueSecond.error(true); this.valueSecond.error(true);
return false; return false;
} }

View file

@ -210,7 +210,7 @@ class FolderModel extends AbstractModel {
} }
} }
if (('' !== suffix && '(' + name + ')' === suffix) || '(inbox)' === suffix.toLowerCase()) { if ((suffix && '(' + name + ')' === suffix) || '(inbox)' === suffix.toLowerCase()) {
suffix = ''; suffix = '';
} }
@ -224,7 +224,7 @@ class FolderModel extends AbstractModel {
} }
}); });
this.hasUnreadMessages = ko.computed(() => 0 < this.messageCountUnread() && '' !== this.printableUnreadCount()); this.hasUnreadMessages = ko.computed(() => 0 < this.messageCountUnread() && this.printableUnreadCount());
this.hasSubScribedUnreadMessagesSubfolders = ko.computed( this.hasSubScribedUnreadMessagesSubfolders = ko.computed(
() => () =>

View file

@ -21,7 +21,7 @@ class IdentityModel extends AbstractModel {
this.signatureInsertBefore = ko.observable(false); this.signatureInsertBefore = ko.observable(false);
this.deleteAccess = ko.observable(false); this.deleteAccess = ko.observable(false);
this.canBeDeleted = ko.computed(() => '' !== this.id()); this.canBeDeleted = ko.computed(() => !!this.id());
} }
/** /**
@ -31,7 +31,7 @@ class IdentityModel extends AbstractModel {
const name = this.name(), const name = this.name(),
email = this.email(); email = this.email();
return '' !== name ? name + ' (' + email + ')' : email; return name ? name + ' (' + email + ')' : email;
} }
} }

View file

@ -353,7 +353,7 @@ class MessageModel extends AbstractModel {
attachment = AttachmentModel.newInstanceFromJson(json['@Collection'][index]); attachment = AttachmentModel.newInstanceFromJson(json['@Collection'][index]);
if (attachment) { if (attachment) {
if ( if (
'' !== attachment.cidWithOutTags && attachment.cidWithOutTags &&
this.foundedCIDs.includes(attachment.cidWithOutTags) this.foundedCIDs.includes(attachment.cidWithOutTags)
) { ) {
attachment.isLinked = true; attachment.isLinked = true;
@ -475,7 +475,7 @@ class MessageModel extends AbstractModel {
'important': this.isImportant(), 'important': this.isImportant(),
'withAttachments': this.hasAttachments(), 'withAttachments': this.hasAttachments(),
'new': this.newForAnimation(), 'new': this.newForAnimation(),
'emptySubject': '' === this.subject(), 'emptySubject': !this.subject(),
// 'hasChildrenMessage': 1 < this.threadsLen(), // 'hasChildrenMessage': 1 < this.threadsLen(),
'hasUnseenSubMessage': this.hasUnseenSubMessage(), 'hasUnseenSubMessage': this.hasUnseenSubMessage(),
'hasFlaggedSubMessage': this.hasFlaggedSubMessage() 'hasFlaggedSubMessage': this.hasFlaggedSubMessage()
@ -783,7 +783,7 @@ class MessageModel extends AbstractModel {
$('[' + attr + ']', this.body).each(function() { $('[' + attr + ']', this.body).each(function() {
const $this = $(this); // eslint-disable-line no-invalid-this const $this = $(this); // eslint-disable-line no-invalid-this
let style = trim($this.attr('style')); let style = trim($this.attr('style'));
style = '' === style ? '' : ';' === style.substr(-1) ? style + ' ' : style + '; '; style = style ? (';' === style.substr(-1) ? style + ' ' : style + '; ') : '';
$this.attr('style', style + $this.attr(attr)); $this.attr('style', style + $this.attr(attr));
}); });
@ -840,9 +840,9 @@ class MessageModel extends AbstractModel {
if (attachment && attachment.linkPreview) { if (attachment && attachment.linkPreview) {
name = $this.attr('data-x-style-cid-name'); name = $this.attr('data-x-style-cid-name');
if ('' !== name) { if (name) {
style = trim($this.attr('style')); style = trim($this.attr('style'));
style = '' === style ? '' : ';' === style.substr(-1) ? style + ' ' : style + '; '; style = style ? (';' === style.substr(-1) ? style + ' ' : style + '; ') : '';
$this.attr('style', style + name + ": url('" + attachment.linkPreview() + "')"); $this.attr('style', style + name + ": url('" + attachment.linkPreview() + "')");
} }
} }

View file

@ -29,7 +29,7 @@ class PromisesUserPopulator extends AbstractBasicPromises {
* @returns {string} * @returns {string}
*/ */
normalizeFolder(sFolderFullNameRaw) { normalizeFolder(sFolderFullNameRaw) {
return '' === sFolderFullNameRaw || return !sFolderFullNameRaw ||
UNUSED_OPTION_VALUE === sFolderFullNameRaw || UNUSED_OPTION_VALUE === sFolderFullNameRaw ||
null !== Cache.getFolderFromCacheList(sFolderFullNameRaw) null !== Cache.getFolderFromCacheList(sFolderFullNameRaw)
? sFolderFullNameRaw ? sFolderFullNameRaw
@ -144,14 +144,13 @@ class PromisesUserPopulator extends AbstractBasicPromises {
if ( if (
oData.SystemFolders && oData.SystemFolders &&
'' === !('' +
'' +
Settings.settingsGet('SentFolder') + Settings.settingsGet('SentFolder') +
Settings.settingsGet('DraftFolder') + Settings.settingsGet('DraftFolder') +
Settings.settingsGet('SpamFolder') + Settings.settingsGet('SpamFolder') +
Settings.settingsGet('TrashFolder') + Settings.settingsGet('TrashFolder') +
Settings.settingsGet('ArchiveFolder') + Settings.settingsGet('ArchiveFolder') +
Settings.settingsGet('NullFolder') Settings.settingsGet('NullFolder'))
) { ) {
Settings.settingsSet('SentFolder', oData.SystemFolders[ServerFolderType.SENT] || null); Settings.settingsSet('SentFolder', oData.SystemFolders[ServerFolderType.SENT] || null);
Settings.settingsSet('DraftFolder', oData.SystemFolders[ServerFolderType.DRAFTS] || null); Settings.settingsSet('DraftFolder', oData.SystemFolders[ServerFolderType.DRAFTS] || null);

View file

@ -134,7 +134,7 @@ if (err) {
*/ */
ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) { ajaxRequest(fResultCallback, params, iTimeOut = 20000, sGetAdd = '', abortActions = []) {
params = params || {}; params = params || {};
const isPost = '' === sGetAdd, const isPost = !sGetAdd,
start = new window.Date().getTime(), start = new window.Date().getTime(),
action = params.Action || ''; action = params.Action || '';

View file

@ -313,12 +313,12 @@ class RemoteUserAjax extends AbstractAjaxRemote {
useThreads = AppStore.threadsAllowed() && SettingsStore.useThreads(), useThreads = AppStore.threadsAllowed() && SettingsStore.useThreads(),
inboxUidNext = getFolderInboxName() === sFolderFullNameRaw ? getFolderUidNext(sFolderFullNameRaw) : ''; inboxUidNext = getFolderInboxName() === sFolderFullNameRaw ? getFolderUidNext(sFolderFullNameRaw) : '';
if ('' !== folderHash && ('' === sSearch || !sSearch.includes('is:'))) { if (folderHash && (!sSearch || !sSearch.includes('is:'))) {
return this.defaultRequest( return this.defaultRequest(
fCallback, fCallback,
'MessageList', 'MessageList',
{}, {},
'' === sSearch ? DEFAULT_AJAX_TIMEOUT : SEARCH_AJAX_TIMEOUT, sSearch ? SEARCH_AJAX_TIMEOUT : DEFAULT_AJAX_TIMEOUT,
'MessageList/' + 'MessageList/' +
subQueryPrefix() + subQueryPrefix() +
'/' + '/' +
@ -351,7 +351,7 @@ class RemoteUserAjax extends AbstractAjaxRemote {
UseThreads: useThreads ? '1' : '0', UseThreads: useThreads ? '1' : '0',
ThreadUid: useThreads ? sThreadUid : '' ThreadUid: useThreads ? sThreadUid : ''
}, },
'' === sSearch ? DEFAULT_AJAX_TIMEOUT : SEARCH_AJAX_TIMEOUT, sSearch ? SEARCH_AJAX_TIMEOUT : DEFAULT_AJAX_TIMEOUT,
'', '',
bSilent ? [] : ['MessageList'] bSilent ? [] : ['MessageList']
); );

View file

@ -48,10 +48,10 @@ class MailBoxUserScreen extends AbstractScreen {
} }
getApp().setWindowTitle( getApp().setWindowTitle(
('' === email (email
? '' ? '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - '
: '' + (0 < foldersInboxUnreadCount ? '(' + foldersInboxUnreadCount + ') ' : ' ') + email + ' - ') + : ''
i18n('TITLES/MAILBOX') ) + i18n('TITLES/MAILBOX')
); );
} }
@ -152,7 +152,7 @@ class MailBoxUserScreen extends AbstractScreen {
vals[1] = 0 >= vals[1] ? 1 : vals[1]; vals[1] = 0 >= vals[1] ? 1 : vals[1];
vals[2] = pString(vals[2]); vals[2] = pString(vals[2]);
if ('' === request) { if (!request) {
vals[0] = inboxFolderName; vals[0] = inboxFolderName;
vals[1] = 1; vals[1] = 1;
} }
@ -163,7 +163,7 @@ class MailBoxUserScreen extends AbstractScreen {
vals[0] = pString(vals[0]); vals[0] = pString(vals[0]);
vals[1] = pString(vals[1]); vals[1] = pString(vals[1]);
if ('' === request) { if (!request) {
vals[0] = inboxFolderName; vals[0] = inboxFolderName;
} }

View file

@ -120,7 +120,7 @@ class SettingsUserScreen extends AbstractSettingsScreen {
setSettingsTitle() { setSettingsTitle() {
const sEmail = AccountStore.email(); const sEmail = AccountStore.email();
getApp().setWindowTitle(('' === sEmail ? '' : sEmail + ' - ') + this.sSettingsTitle); getApp().setWindowTitle((sEmail ? sEmail + ' - ' : '') + this.sSettingsTitle);
} }
} }

View file

@ -102,7 +102,7 @@ class ContactsAdminSettings {
this.onTestContactsResponse = this.onTestContactsResponse.bind(this); this.onTestContactsResponse = this.onTestContactsResponse.bind(this);
} }
@command((self) => '' !== self.pdoDsn() && '' !== self.pdoUser()) @command((self) => self.pdoDsn() && self.pdoUser())
testContactsCommand() { testContactsCommand() {
this.testContactsSuccess(false); this.testContactsSuccess(false);
this.testContactsError(false); this.testContactsError(false);

View file

@ -18,13 +18,13 @@ class PackagesAdminSettings {
this.packagesMainUpdatable = PackageStore.packagesMainUpdatable; this.packagesMainUpdatable = PackageStore.packagesMainUpdatable;
this.packagesCurrent = ko.computed(() => this.packagesCurrent = ko.computed(() =>
this.packages().filter(item => item && '' !== item.installed && !item.compare) this.packages().filter(item => item && item.installed && !item.compare)
); );
this.packagesAvailableForUpdate = ko.computed(() => this.packagesAvailableForUpdate = ko.computed(() =>
this.packages().filter(item => item && '' !== item.installed && !!item.compare) this.packages().filter(item => item && item.installed && !!item.compare)
); );
this.packagesAvailableForInstallation = ko.computed(() => this.packagesAvailableForInstallation = ko.computed(() =>
this.packages().filter(item => item && '' === item.installed) this.packages().filter(item => item && !item.installed)
); );
this.visibility = ko.computed(() => (PackageStore.packages.loading() ? 'visible' : 'hidden')); this.visibility = ko.computed(() => (PackageStore.packages.loading() ? 'visible' : 'hidden'));

View file

@ -78,7 +78,7 @@ class PluginsAdminSettings {
onPluginDisableRequest(result, data) { onPluginDisableRequest(result, data) {
if (StorageResultType.Success === result && data) { if (StorageResultType.Success === result && data) {
if (!data.Result && data.ErrorCode) { if (!data.Result && data.ErrorCode) {
if (Notification.UnsupportedPluginPackage === data.ErrorCode && data.ErrorMessage && '' !== data.ErrorMessage) { if (Notification.UnsupportedPluginPackage === data.ErrorCode && data.ErrorMessage && data.ErrorMessage) {
PluginStore.plugins.error(data.ErrorMessage); PluginStore.plugins.error(data.ErrorMessage);
} else { } else {
PluginStore.plugins.error(getNotification(data.ErrorCode)); PluginStore.plugins.error(getNotification(data.ErrorCode));

View file

@ -76,9 +76,9 @@ class SecurityAdminSettings {
this.onNewAdminPasswordResponse = this.onNewAdminPasswordResponse.bind(this); this.onNewAdminPasswordResponse = this.onNewAdminPasswordResponse.bind(this);
} }
@command((self) => '' !== trim(self.adminLogin()) && '' !== self.adminPassword()) @command((self) => trim(self.adminLogin()) && self.adminPassword())
saveNewAdminPasswordCommand() { saveNewAdminPasswordCommand() {
if ('' === trim(this.adminLogin())) { if (!trim(this.adminLogin())) {
this.adminLoginError(true); this.adminLoginError(true);
return false; return false;
} }

View file

@ -61,7 +61,7 @@ class FiltersUserSettings {
@command((self) => self.haveChanges()) @command((self) => self.haveChanges())
saveChangesCommand() { saveChangesCommand() {
if (!this.filters.saving()) { if (!this.filters.saving()) {
if (this.filterRaw.active() && '' === trim(this.filterRaw())) { if (this.filterRaw.active() && !trim(this.filterRaw())) {
this.filterRaw.error(true); this.filterRaw.error(true);
return false; return false;
} }

View file

@ -44,7 +44,7 @@ class FoldersUserSettings {
folderEditOnEnter(folder) { folderEditOnEnter(folder) {
const nameToEdit = folder ? trim(folder.nameForEdit()) : ''; const nameToEdit = folder ? trim(folder.nameForEdit()) : '';
if ('' !== nameToEdit && folder.name() !== nameToEdit) { if (nameToEdit && folder.name() !== nameToEdit) {
Local.set(ClientSideKeyName.FoldersLashHash, ''); Local.set(ClientSideKeyName.FoldersLashHash, '');
getApp().foldersPromisesActionHelper( getApp().foldersPromisesActionHelper(

View file

@ -55,7 +55,7 @@ class GeneralUserSettings {
this.identityMain = ko.computed(() => { this.identityMain = ko.computed(() => {
const list = this.identities(); const list = this.identities();
return isArray(list) ? list.find(item => item && '' === item.id()) : null; return isArray(list) ? list.find(item => item && !item.id()) : null;
}); });
this.identityMainDesc = ko.computed(() => { this.identityMainDesc = ko.computed(() => {

View file

@ -16,7 +16,7 @@ class TemplatesUserSettings {
this.processText = ko.computed(() => this.processText = ko.computed(() =>
TemplateStore.templates.loading() ? i18n('SETTINGS_TEMPLETS/LOADING_PROCESS') : '' TemplateStore.templates.loading() ? i18n('SETTINGS_TEMPLETS/LOADING_PROCESS') : ''
); );
this.visibility = ko.computed(() => ('' === this.processText() ? 'hidden' : 'visible')); this.visibility = ko.computed(() => this.processText() ? 'visible' : 'hidden');
this.templateForDeletion = ko.observable(null).deleteAccessHelper(); this.templateForDeletion = ko.observable(null).deleteAccessHelper();
} }

View file

@ -42,7 +42,7 @@ class AccountUserStore {
* @returns {boolean} * @returns {boolean}
*/ */
isRootAccount() { isRootAccount() {
return '' === this.parentEmail(); return !this.parentEmail();
} }
} }

View file

@ -42,7 +42,7 @@ class FolderUserStore {
computers() { computers() {
this.draftFolderNotEnabled = ko.computed( this.draftFolderNotEnabled = ko.computed(
() => '' === this.draftFolder() || UNUSED_OPTION_VALUE === this.draftFolder() () => !this.draftFolder() || UNUSED_OPTION_VALUE === this.draftFolder()
); );
this.foldersListWithSingleInboxRootFolder = ko.computed( this.foldersListWithSingleInboxRootFolder = ko.computed(
@ -73,19 +73,19 @@ class FolderUserStore {
archiveFolder = this.archiveFolder(); archiveFolder = this.archiveFolder();
if (isArray(folders) && folders.length) { if (isArray(folders) && folders.length) {
if ('' !== sentFolder && UNUSED_OPTION_VALUE !== sentFolder) { if (sentFolder && UNUSED_OPTION_VALUE !== sentFolder) {
list.push(sentFolder); list.push(sentFolder);
} }
if ('' !== draftFolder && UNUSED_OPTION_VALUE !== draftFolder) { if (draftFolder && UNUSED_OPTION_VALUE !== draftFolder) {
list.push(draftFolder); list.push(draftFolder);
} }
if ('' !== spamFolder && UNUSED_OPTION_VALUE !== spamFolder) { if (spamFolder && UNUSED_OPTION_VALUE !== spamFolder) {
list.push(spamFolder); list.push(spamFolder);
} }
if ('' !== trashFolder && UNUSED_OPTION_VALUE !== trashFolder) { if (trashFolder && UNUSED_OPTION_VALUE !== trashFolder) {
list.push(trashFolder); list.push(trashFolder);
} }
if ('' !== archiveFolder && UNUSED_OPTION_VALUE !== archiveFolder) { if (archiveFolder && UNUSED_OPTION_VALUE !== archiveFolder) {
list.push(archiveFolder); list.push(archiveFolder);
} }
} }

View file

@ -248,7 +248,7 @@ class MessageUserStore {
} }
initUidNextAndNewMessages(folder, uidNext, newMessages) { initUidNextAndNewMessages(folder, uidNext, newMessages) {
if (getFolderInboxName() === folder && isNormal(uidNext) && '' !== uidNext) { if (getFolderInboxName() === folder && isNormal(uidNext) && uidNext) {
if (isArray(newMessages) && newMessages.length) { if (isArray(newMessages) && newMessages.length) {
newMessages.forEach(item => { newMessages.forEach(item => {
addNewMessageCache(folder, item.Uid); addNewMessageCache(folder, item.Uid);
@ -305,7 +305,7 @@ class MessageUserStore {
const trashFolder = FolderStore.trashFolder(), const trashFolder = FolderStore.trashFolder(),
spamFolder = FolderStore.spamFolder(), spamFolder = FolderStore.spamFolder(),
fromFolder = getFolderFromCacheList(fromFolderFullNameRaw), fromFolder = getFolderFromCacheList(fromFolderFullNameRaw),
toFolder = '' === toFolderFullNameRaw ? null : getFolderFromCacheList(toFolderFullNameRaw || ''), toFolder = toFolderFullNameRaw ? getFolderFromCacheList(toFolderFullNameRaw) : null,
currentFolderFullNameRaw = FolderStore.currentFolderFullNameRaw(), currentFolderFullNameRaw = FolderStore.currentFolderFullNameRaw(),
messages = messages =
currentFolderFullNameRaw === fromFolderFullNameRaw currentFolderFullNameRaw === fromFolderFullNameRaw
@ -368,15 +368,15 @@ class MessageUserStore {
} }
} }
if ('' !== fromFolderFullNameRaw) { if (fromFolderFullNameRaw) {
setFolderHash(fromFolderFullNameRaw, ''); setFolderHash(fromFolderFullNameRaw, '');
} }
if ('' !== toFolderFullNameRaw) { if (toFolderFullNameRaw) {
setFolderHash(toFolderFullNameRaw, ''); setFolderHash(toFolderFullNameRaw, '');
} }
if ('' !== this.messageListThreadUid()) { if (this.messageListThreadUid()) {
messageList = this.messageList(); messageList = this.messageList();
if ( if (
@ -448,7 +448,7 @@ class MessageUserStore {
h = getRealHeight($this); h = getRealHeight($this);
} }
if ('' !== trim($this.text()) && (0 === h || 100 < h)) { if (trim($this.text()) && (0 === h || 100 < h)) {
$this.addClass('rl-bq-switcher hidden-bq'); $this.addClass('rl-bq-switcher hidden-bq');
$('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>') $('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>')
.insertBefore($this) .insertBefore($this)
@ -525,10 +525,10 @@ class MessageUserStore {
const textBody = messagesDom.find('#' + id); const textBody = messagesDom.find('#' + id);
if (!textBody || !textBody[0]) { if (!textBody || !textBody[0]) {
let isHtml = false; let isHtml = false;
if (isNormal(data.Result.Html) && '' !== data.Result.Html) { if (isNormal(data.Result.Html) && data.Result.Html) {
isHtml = true; isHtml = true;
resultHtml = data.Result.Html.toString(); resultHtml = data.Result.Html.toString();
} else if (isNormal(data.Result.Plain) && '' !== data.Result.Plain) { } else if (isNormal(data.Result.Plain) && data.Result.Plain) {
isHtml = false; isHtml = false;
resultHtml = plainToHtml(data.Result.Plain.toString(), false); resultHtml = plainToHtml(data.Result.Plain.toString(), false);

View file

@ -65,8 +65,8 @@ class LoginAdminView extends AbstractViewNext {
this.loginError(false); this.loginError(false);
this.passwordError(false); this.passwordError(false);
this.loginError('' === trim(this.login())); this.loginError(!trim(this.login()));
this.passwordError('' === trim(this.password())); this.passwordError(!trim(this.password()));
if (this.loginError() || this.passwordError()) { if (this.loginError() || this.passwordError()) {
return false; return false;

View file

@ -44,8 +44,8 @@ class AccountPopupView extends AbstractViewNext {
@command((self) => !self.submitRequest()) @command((self) => !self.submitRequest())
addAccountCommand() { addAccountCommand() {
this.emailError('' === trim(this.email())); this.emailError(!trim(this.email()));
this.passwordError('' === trim(this.password())); this.passwordError(!trim(this.password()));
if (this.emailError() || this.passwordError()) { if (this.emailError() || this.passwordError()) {
return false; return false;

View file

@ -47,7 +47,7 @@ class ActivatePopupView extends AbstractViewNext {
} }
@command( @command(
(self) => !self.activateProcess() && '' !== self.domain() && '' !== self.key() && !self.activationSuccessed() (self) => !self.activateProcess() && self.domain() && self.key() && !self.activationSuccessed()
) )
activateCommand() { activateCommand() {
this.activateProcess(true); this.activateProcess(true);
@ -110,7 +110,7 @@ class ActivatePopupView extends AbstractViewNext {
validateSubscriptionKey() { validateSubscriptionKey() {
const value = this.key(); const value = this.key();
return ( return (
'' === value || !value ||
RAINLOOP_TRIAL_KEY === value || RAINLOOP_TRIAL_KEY === value ||
!!/^RL[\d]+-[A-Z0-9-]+Z$/.test(trim(value).replace(/[^A-Z0-9-]/gi, '')) !!/^RL[\d]+-[A-Z0-9-]+Z$/.test(trim(value).replace(/[^A-Z0-9-]/gi, ''))
); );

View file

@ -39,7 +39,7 @@ class AddOpenPgpKeyPopupView extends AbstractViewNext {
keyTrimmed = keyTrimmed.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n'); keyTrimmed = keyTrimmed.replace(/[\r]+/g, '').replace(/[\n]{2,}/g, '\n\n');
} }
this.key.error('' === keyTrimmed); this.key.error(!keyTrimmed);
this.key.errorMessage(''); this.key.errorMessage('');
if (!openpgpKeyring || this.key.error()) { if (!openpgpKeyring || this.key.error()) {

View file

@ -46,7 +46,7 @@ class AdvancedSearchPopupView extends AbstractViewNext {
@command() @command()
searchCommand() { searchCommand() {
const search = this.buildSearchString(); const search = this.buildSearchString();
if ('' !== search) { if (search) {
MessageStore.mainMessageListSearch(search); MessageStore.mainMessageListSearch(search);
} }
@ -87,15 +87,15 @@ class AdvancedSearchPopupView extends AbstractViewNext {
isPart = [], isPart = [],
hasPart = []; hasPart = [];
if (from_ && '' !== from_) { if (from_) {
result.push('from:' + this.buildSearchStringValue(from_)); result.push('from:' + this.buildSearchStringValue(from_));
} }
if (to && '' !== to) { if (to) {
result.push('to:' + this.buildSearchStringValue(to)); result.push('to:' + this.buildSearchStringValue(to));
} }
if (subject && '' !== subject) { if (subject) {
result.push('subject:' + this.buildSearchStringValue(subject)); result.push('subject:' + this.buildSearchStringValue(subject));
} }
@ -123,7 +123,7 @@ class AdvancedSearchPopupView extends AbstractViewNext {
result.push('date:' + searchSubtractFormatDateHelper(this.selectedDateValue()) + '/'); result.push('date:' + searchSubtractFormatDateHelper(this.selectedDateValue()) + '/');
} }
if (text && '' !== text) { if (text) {
result.push('text:' + this.buildSearchStringValue(text)); result.push('text:' + this.buildSearchStringValue(text));
} }

View file

@ -227,12 +227,12 @@ class ComposePopupView extends AbstractViewNext {
this.attachmentsInProcess = ko.computed(() => this.attachments().filter(item => item && !item.complete())); this.attachmentsInProcess = ko.computed(() => this.attachments().filter(item => item && !item.complete()));
this.attachmentsInReady = ko.computed(() => this.attachments().filter(item => item && item.complete())); this.attachmentsInReady = ko.computed(() => this.attachments().filter(item => item && item.complete()));
this.attachmentsInError = ko.computed(() => this.attachments().filter(item => item && '' !== item.error())); this.attachmentsInError = ko.computed(() => this.attachments().filter(item => item && item.error()));
this.attachmentsCount = ko.computed(() => this.attachments().length); this.attachmentsCount = ko.computed(() => this.attachments().length);
this.attachmentsInErrorCount = ko.computed(() => this.attachmentsInError().length); this.attachmentsInErrorCount = ko.computed(() => this.attachmentsInError().length);
this.attachmentsInProcessCount = ko.computed(() => this.attachmentsInProcess().length); this.attachmentsInProcessCount = ko.computed(() => this.attachmentsInProcess().length);
this.isDraftFolderMessage = ko.computed(() => '' !== this.draftFolder() && '' !== this.draftUid()); this.isDraftFolderMessage = ko.computed(() => this.draftFolder() && this.draftUid());
this.attachmentsPlace = ko.observable(false); this.attachmentsPlace = ko.observable(false);
@ -360,7 +360,7 @@ class ComposePopupView extends AbstractViewNext {
this.attachmentsPlace(true); this.attachmentsPlace(true);
} }
if ('' === sTo && '' === sCc && '' === sBcc) { if (!sTo && !sCc && !sBcc) {
this.emptyToError(true); this.emptyToError(true);
} }
@ -380,7 +380,7 @@ class ComposePopupView extends AbstractViewNext {
sSentFolder = UNUSED_OPTION_VALUE; sSentFolder = UNUSED_OPTION_VALUE;
} }
if ('' === sSentFolder) { if (!sSentFolder) {
showScreenPopup(require('View/Popup/FolderSystem'), [SetSystemFoldersNotification.Sent]); showScreenPopup(require('View/Popup/FolderSystem'), [SetSystemFoldersNotification.Sent]);
} else { } else {
this.sendError(false); this.sendError(false);
@ -564,7 +564,7 @@ class ComposePopupView extends AbstractViewNext {
reloadDraftFolder() { reloadDraftFolder() {
const draftFolder = FolderStore.draftFolder(); const draftFolder = FolderStore.draftFolder();
if ('' !== draftFolder && UNUSED_OPTION_VALUE !== draftFolder) { if (draftFolder && UNUSED_OPTION_VALUE !== draftFolder) {
setFolderHash(draftFolder, ''); setFolderHash(draftFolder, '');
if (FolderStore.currentFolderFullNameRaw() === draftFolder) { if (FolderStore.currentFolderFullNameRaw() === draftFolder) {
getApp().reloadMessageList(true); getApp().reloadMessageList(true);
@ -736,7 +736,7 @@ class ComposePopupView extends AbstractViewNext {
signature = signature.replace(/[\r]/g, ''); signature = signature.replace(/[\r]/g, '');
fromLine = this.oLastMessage ? this.emailArrayToStringLineHelper(this.oLastMessage.from, true) : ''; fromLine = this.oLastMessage ? this.emailArrayToStringLineHelper(this.oLastMessage.from, true) : '';
if ('' !== fromLine) { if (fromLine) {
signature = signature.replace(/{{FROM-FULL}}/g, fromLine); signature = signature.replace(/{{FROM-FULL}}/g, fromLine);
if (!fromLine.includes(' ') && 0 < fromLine.indexOf('@')) { if (!fromLine.includes(' ') && 0 < fromLine.indexOf('@')) {
@ -793,7 +793,7 @@ class ComposePopupView extends AbstractViewNext {
let isHtml = false, let isHtml = false,
signature = identity.signature(); signature = identity.signature();
if ('' !== signature) { if (signature) {
if (':HTML:' === signature.substr(0, 6)) { if (':HTML:' === signature.substr(0, 6)) {
isHtml = true; isHtml = true;
signature = signature.substr(6); signature = signature.substr(6);
@ -837,7 +837,7 @@ class ComposePopupView extends AbstractViewNext {
this.addEmailsTo(this.cc, aCcEmails); this.addEmailsTo(this.cc, aCcEmails);
this.addEmailsTo(this.bcc, aBccEmails); this.addEmailsTo(this.bcc, aBccEmails);
if (isNormal(sCustomSubject) && '' !== sCustomSubject && '' === this.subject()) { if (isNormal(sCustomSubject) && sCustomSubject && !this.subject()) {
this.subject(sCustomSubject); this.subject(sCustomSubject);
} }
} }
@ -862,7 +862,7 @@ class ComposePopupView extends AbstractViewNext {
values = emails.map(item => item ? item.toLine(false) : null) values = emails.map(item => item ? item.toLine(false) : null)
.filter((value, index, self) => !!value && self.indexOf(value) == index); .filter((value, index, self) => !!value && self.indexOf(value) == index);
fKoValue(value + ('' === value ? '' : ', ') + trim(values.join(', '))); fKoValue(value + (value ? ', ' : '') + trim(values.join(', ')));
} }
} }
@ -939,7 +939,7 @@ class ComposePopupView extends AbstractViewNext {
this.bcc(this.emailArrayToStringLineHelper(aBccEmails)); this.bcc(this.emailArrayToStringLineHelper(aBccEmails));
} }
if ('' !== lineComposeType && message) { if (lineComposeType && message) {
sDate = momentorFormat(message.dateTimeStampInUTC(), 'FULL'); sDate = momentorFormat(message.dateTimeStampInUTC(), 'FULL');
sSubject = message.subject(); sSubject = message.subject();
aDraftInfo = message.aDraftInfo; aDraftInfo = message.aDraftInfo;
@ -1171,7 +1171,7 @@ class ComposePopupView extends AbstractViewNext {
setFocusInPopup() { setFocusInPopup() {
if (!bMobileDevice) { if (!bMobileDevice) {
setTimeout(() => { setTimeout(() => {
if ('' === this.to()) { if (!this.to()) {
this.to.focused(true); this.to.focused(true);
} else if (this.oEditor) { } else if (this.oEditor) {
if (!this.to.focused()) { if (!this.to.focused()) {
@ -1379,7 +1379,7 @@ class ComposePopupView extends AbstractViewNext {
} }
if (attachment) { if (attachment) {
if ('' !== error && error.length) { if (error && error.length) {
attachment attachment
.waiting(false) .waiting(false)
.uploading(false) .uploading(false)
@ -1413,7 +1413,7 @@ class ComposePopupView extends AbstractViewNext {
prepearAttachmentsForSendOrSave() { prepearAttachmentsForSendOrSave() {
const result = {}; const result = {};
this.attachmentsInReady().forEach(item => { this.attachmentsInReady().forEach(item => {
if (item && '' !== item.tempName() && item.enabled()) { if (item && item.tempName() && item.enabled()) {
result[item.tempName()] = [item.fileName(), item.isInline ? '1' : '0', item.CID, item.contentLocation]; result[item.tempName()] = [item.fileName(), item.isInline ? '1' : '0', item.CID, item.contentLocation];
} }
}); });
@ -1552,7 +1552,7 @@ class ComposePopupView extends AbstractViewNext {
!this.replyTo().length && !this.replyTo().length &&
!this.subject().length && !this.subject().length &&
withoutAttachment && withoutAttachment &&
(!this.oEditor || '' === this.oEditor.getData()) (!this.oEditor || !this.oEditor.getData())
); );
} }
@ -1606,7 +1606,7 @@ class ComposePopupView extends AbstractViewNext {
* @returns {Array} * @returns {Array}
*/ */
getAttachmentsDownloadsForUpload() { getAttachmentsDownloadsForUpload() {
return this.attachments().filter(item => item && '' === item.tempName()).map( return this.attachments().filter(item => item && !item.tempName()).map(
item => item.id item => item.id
); );
} }

View file

@ -345,15 +345,15 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
this.resultCallback = fCallback; this.resultCallback = fCallback;
if ('' !== sTo) { if (sTo) {
rec.push(sTo); rec.push(sTo);
} }
if ('' !== sCc) { if (sCc) {
rec.push(sCc); rec.push(sCc);
} }
if ('' !== sBcc) { if (sBcc) {
rec.push(sBcc); rec.push(sBcc);
} }
@ -361,7 +361,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext {
rec = rec.map(value => { rec = rec.map(value => {
email.clear(); email.clear();
email.parse(trim(value)); email.parse(trim(value));
return '' === email.email ? false : email.email; return email.email || false;
}).filter(value => !!value); }).filter(value => !!value);
if (identity && identity.email()) { if (identity && identity.email()) {

View file

@ -116,7 +116,7 @@ class ContactsPopupView extends AbstractViewNext {
this.viewHasNonEmptyRequiredProperties = ko.computed(() => { this.viewHasNonEmptyRequiredProperties = ko.computed(() => {
const names = this.viewPropertiesNames(), const names = this.viewPropertiesNames(),
emails = this.viewPropertiesEmails(), emails = this.viewPropertiesEmails(),
fFilter = (property) => '' !== trim(property.value()); fFilter = (property) => !!trim(property.value());
return !!(names.find(fFilter) || emails.find(fFilter)); return !!(names.find(fFilter) || emails.find(fFilter));
}); });
@ -126,12 +126,12 @@ class ContactsPopupView extends AbstractViewNext {
); );
this.viewPropertiesEmailsNonEmpty = ko.computed(() => this.viewPropertiesEmailsNonEmpty = ko.computed(() =>
this.viewPropertiesNames().filter(property => '' !== trim(property.value())) this.viewPropertiesNames().filter(property => !!trim(property.value()))
); );
const propertyFocused = (property) => { const propertyFocused = (property) => {
const focused = property.focused(); const focused = property.focused();
return '' === trim(property.value()) && !focused; return !trim(property.value()) && !focused;
}; };
this.viewPropertiesEmailsEmptyAndOnFocused = ko.computed(() => this.viewPropertiesEmailsEmptyAndOnFocused = ko.computed(() =>
@ -303,7 +303,7 @@ class ContactsPopupView extends AbstractViewNext {
properties = []; properties = [];
this.viewProperties().forEach(oItem => { this.viewProperties().forEach(oItem => {
if (oItem.type() && oItem.type() !== ContactPropertyType.FullName && '' !== trim(oItem.value())) { if (oItem.type() && oItem.type() !== ContactPropertyType.FullName && trim(oItem.value())) {
properties.push([oItem.type(), oItem.value(), oItem.typeStr()]); properties.push([oItem.type(), oItem.value(), oItem.typeStr()]);
} }
}); });
@ -320,7 +320,7 @@ class ContactsPopupView extends AbstractViewNext {
oData.Result.RequestUid === requestUid && oData.Result.RequestUid === requestUid &&
0 < pInt(oData.Result.ResultID) 0 < pInt(oData.Result.ResultID)
) { ) {
if ('' === this.viewID()) { if (!this.viewID()) {
this.viewID(pInt(oData.Result.ResultID)); this.viewID(pInt(oData.Result.ResultID));
} }
@ -610,7 +610,7 @@ class ContactsPopupView extends AbstractViewNext {
this.contacts(list); this.contacts(list);
this.contacts.loading(false); this.contacts.loading(false);
this.viewClearSearch('' !== this.search()); this.viewClearSearch(!!this.search());
}, },
offset, offset,
CONTACTS_PER_PAGE, CONTACTS_PER_PAGE,

View file

@ -97,10 +97,9 @@ class DomainPopupView extends AbstractViewNext {
result += ' ← ' + aliasName; result += ' ← ' + aliasName;
} }
} else { } else {
result = result = name
'' === name ? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { 'NAME': name })
? i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN') : i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN');
: i18n('POPUPS_DOMAIN/TITLE_ADD_DOMAIN_WITH_NAME', { 'NAME': name });
} }
return result; return result;
@ -117,11 +116,11 @@ class DomainPopupView extends AbstractViewNext {
useSieve = this.useSieve(); useSieve = this.useSieve();
return ( return (
'' !== this.name() && this.name() &&
'' !== this.imapServer() && this.imapServer() &&
'' !== this.imapPort() && this.imapPort() &&
(allowSieve && useSieve ? '' !== this.sieveServer() && '' !== this.sievePort() : true) && (allowSieve && useSieve ? this.sieveServer() && this.sievePort() : true) &&
(('' !== this.smtpServer() && '' !== this.smtpPort()) || usePhpMail) ((this.smtpServer() && this.smtpPort()) || usePhpMail)
); );
}); });
@ -134,19 +133,19 @@ class DomainPopupView extends AbstractViewNext {
// smart form improvements // smart form improvements
this.imapServerFocus.subscribe((value) => { this.imapServerFocus.subscribe((value) => {
if (value && '' !== this.name() && '' === this.imapServer()) { if (value && this.name() && !this.imapServer()) {
this.imapServer(this.name().replace(/[.]?[*][.]?/g, '')); this.imapServer(this.name().replace(/[.]?[*][.]?/g, ''));
} }
}); });
this.sieveServerFocus.subscribe((value) => { this.sieveServerFocus.subscribe((value) => {
if (value && '' !== this.imapServer() && '' === this.sieveServer()) { if (value && this.imapServer() && !this.sieveServer()) {
this.sieveServer(this.imapServer()); this.sieveServer(this.imapServer());
} }
}); });
this.smtpServerFocus.subscribe((value) => { this.smtpServerFocus.subscribe((value) => {
if (value && '' !== this.imapServer() && '' === this.smtpServer()) { if (value && this.imapServer() && !this.smtpServer()) {
this.smtpServer(this.imapServer().replace(/imap/gi, 'smtp')); this.smtpServer(this.imapServer().replace(/imap/gi, 'smtp'));
} }
}); });
@ -381,7 +380,7 @@ class DomainPopupView extends AbstractViewNext {
} }
onShowWithDelay() { onShowWithDelay() {
if ('' === this.name() && !bMobileDevice) { if (!this.name() && !bMobileDevice) {
this.name.focused(true); this.name.focused(true);
} }
} }

View file

@ -35,7 +35,7 @@ class DomainAliasPopupView extends AbstractViewNext {
this.domains().map(item => ({ optValue: item.name, optText: item.name })) this.domains().map(item => ({ optValue: item.name, optText: item.name }))
); );
this.canBeSaved = ko.computed(() => !this.saving() && '' !== this.name() && '' !== this.alias()); this.canBeSaved = ko.computed(() => !this.saving() && this.name() && this.alias());
this.onDomainAliasCreateOrSaveResponse = this.onDomainAliasCreateOrSaveResponse.bind(this); this.onDomainAliasCreateOrSaveResponse = this.onDomainAliasCreateOrSaveResponse.bind(this);
} }
@ -65,7 +65,7 @@ class DomainAliasPopupView extends AbstractViewNext {
} }
onShowWithDelay() { onShowWithDelay() {
if ('' === this.name() && !bMobileDevice) { if (!this.name() && !bMobileDevice) {
this.name.focused(true); this.name.focused(true);
} }
} }

View file

@ -36,7 +36,7 @@ class FolderCreateView extends AbstractViewNext {
top.push(['', '']); top.push(['', '']);
let fDisableCallback = null; let fDisableCallback = null;
if ('' !== FolderStore.namespace) { if (FolderStore.namespace) {
fDisableCallback = (item) => FolderStore.namespace !== item.fullNameRaw.substr(0, FolderStore.namespace.length); fDisableCallback = (item) => FolderStore.namespace !== item.fullNameRaw.substr(0, FolderStore.namespace.length);
} }
@ -49,7 +49,7 @@ class FolderCreateView extends AbstractViewNext {
@command((self) => self.simpleFolderNameValidation(self.folderName())) @command((self) => self.simpleFolderNameValidation(self.folderName()))
createFolderCommand() { createFolderCommand() {
let parentFolderName = this.selectedParentValue(); let parentFolderName = this.selectedParentValue();
if ('' === parentFolderName && 1 < FolderStore.namespace.length) { if (!parentFolderName && 1 < FolderStore.namespace.length) {
parentFolderName = FolderStore.namespace.substr(0, FolderStore.namespace.length - 1); parentFolderName = FolderStore.namespace.substr(0, FolderStore.namespace.length - 1);
} }

View file

@ -62,7 +62,7 @@ class IdentityPopupView extends AbstractViewNext {
} }
if (!this.email.hasError()) { if (!this.email.hasError()) {
this.email.hasError('' === trim(this.email())); this.email.hasError(!trim(this.email()));
} }
if (this.email.hasError()) { if (this.email.hasError()) {
@ -151,7 +151,7 @@ class IdentityPopupView extends AbstractViewNext {
this.signature(identity.signature()); this.signature(identity.signature());
this.signatureInsertBefore(identity.signatureInsertBefore()); this.signatureInsertBefore(identity.signatureInsertBefore());
this.owner('' === this.id); this.owner(!this.id);
} else { } else {
this.id = fakeMd5(); this.id = fakeMd5();
} }

View file

@ -39,13 +39,13 @@ class NewOpenPgpKeyPopupView extends AbstractViewNext {
const userId = {}, const userId = {},
openpgpKeyring = PgpStore.openpgpKeyring; openpgpKeyring = PgpStore.openpgpKeyring;
this.email.error('' === trim(this.email())); this.email.error(!trim(this.email()));
if (!openpgpKeyring || this.email.error()) { if (!openpgpKeyring || this.email.error()) {
return false; return false;
} }
userId.email = this.email(); userId.email = this.email();
if ('' !== this.name()) { if (this.name()) {
userId.name = this.name(); userId.name = this.name();
} }

View file

@ -28,7 +28,7 @@ class PluginPopupView extends AbstractViewNext {
this.configures = ko.observableArray([]); this.configures = ko.observableArray([]);
this.hasReadme = ko.computed(() => '' !== this.readme()); this.hasReadme = ko.computed(() => !!this.readme());
this.hasConfiguration = ko.computed(() => 0 < this.configures().length); this.hasConfiguration = ko.computed(() => 0 < this.configures().length);
this.readmePopoverConf = { this.readmePopoverConf = {

View file

@ -49,8 +49,8 @@ class TemplatePopupView extends AbstractViewNext {
addTemplateCommand() { addTemplateCommand() {
this.populateBodyFromEditor(); this.populateBodyFromEditor();
this.name.error('' === trim(this.name())); this.name.error(!trim(this.name()));
this.body.error('' === trim(this.body()) || ':HTML:' === trim(this.body())); this.body.error(!trim(this.body()) || ':HTML:' === trim(this.body()));
if (this.name.error() || this.body.error()) { if (this.name.error() || this.body.error()) {
return false; return false;

View file

@ -25,7 +25,7 @@ class TwoFactorTestPopupView extends AbstractViewNext {
this.testing = ko.observable(false); this.testing = ko.observable(false);
} }
@command((self) => '' !== self.code() && !self.testing()) @command((self) => self.code() && !self.testing())
testCodeCommand() { testCodeCommand() {
this.testing(true); this.testing(true);
Remote.testTwoFactor((result, data) => { Remote.testTwoFactor((result, data) => {

View file

@ -115,7 +115,7 @@ class LoginUserView extends AbstractViewNext {
this.submitErrorAddidional = ko.observable(''); this.submitErrorAddidional = ko.observable('');
this.submitError.subscribe((value) => { this.submitError.subscribe((value) => {
if ('' === value) { if (!value) {
this.submitErrorAddidional(''); this.submitErrorAddidional('');
} }
}); });
@ -154,12 +154,12 @@ class LoginUserView extends AbstractViewNext {
this.emailError(false); this.emailError(false);
this.passwordError(false); this.passwordError(false);
this.emailError('' === trim(this.email())); this.emailError(!trim(this.email()));
this.passwordError('' === trim(this.password())); this.passwordError(!trim(this.password()));
if (this.additionalCode.visibility()) { if (this.additionalCode.visibility()) {
this.additionalCode.error(false); this.additionalCode.error(false);
this.additionalCode.error('' === trim(this.additionalCode())); this.additionalCode.error(!trim(this.additionalCode()));
} }
if ( if (
@ -195,7 +195,7 @@ class LoginUserView extends AbstractViewNext {
if (0 < pluginResultCode) { if (0 < pluginResultCode) {
this.submitError(getNotification(pluginResultCode)); this.submitError(getNotification(pluginResultCode));
return false; return false;
} else if ('' !== pluginResultMessage) { } else if (pluginResultMessage) {
this.submitError(pluginResultMessage); this.submitError(pluginResultMessage);
return false; return false;
} }
@ -230,7 +230,7 @@ class LoginUserView extends AbstractViewNext {
this.submitError(getNotificationFromResponse(oData)); this.submitError(getNotificationFromResponse(oData));
if ('' === this.submitError()) { if (!this.submitError()) {
this.submitError(getNotification(Notification.UnknownError)); this.submitError(getNotification(Notification.UnknownError));
} else if (oData.ErrorMessageAdditional) { } else if (oData.ErrorMessageAdditional) {
this.submitErrorAddidional(oData.ErrorMessageAdditional); this.submitErrorAddidional(oData.ErrorMessageAdditional);
@ -269,11 +269,11 @@ class LoginUserView extends AbstractViewNext {
} }
onShowWithDelay() { onShowWithDelay() {
if ('' !== this.email() && '' !== this.password()) { if (this.email() && this.password()) {
this.passwordFocus(true); this.passwordFocus(true);
} else if ('' === this.email()) { } else if (!this.email()) {
this.emailFocus(true); this.emailFocus(true);
} else if ('' === this.password()) { } else if (!this.password()) {
this.passwordFocus(true); this.passwordFocus(true);
} else { } else {
this.emailFocus(true); this.emailFocus(true);

View file

@ -245,7 +245,7 @@ class FolderListMailBoxUserView extends AbstractViewNext {
copy = $htmlCL.contains('rl-ctrl-key-pressed'), copy = $htmlCL.contains('rl-ctrl-key-pressed'),
uids = ui.helper.data('rl-uids'); uids = ui.helper.data('rl-uids');
if (isNormal(fromFolderFullNameRaw) && '' !== fromFolderFullNameRaw && isArray(uids)) { if (fromFolderFullNameRaw && isNormal(fromFolderFullNameRaw) && isArray(uids)) {
getApp().moveMessagesToFolder(fromFolderFullNameRaw, uids, toFolder.fullNameRaw, copy); getApp().moveMessagesToFolder(fromFolderFullNameRaw, uids, toFolder.fullNameRaw, copy);
} }
} }

View file

@ -135,7 +135,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
this.messageListSearchDesc = ko.computed(() => { this.messageListSearchDesc = ko.computed(() => {
const value = MessageStore.messageListEndSearch(); const value = MessageStore.messageListEndSearch();
return '' === value ? '' : i18n('MESSAGE_LIST/SEARCH_RESULT_FOR', { 'SEARCH': value }); return value ? i18n('MESSAGE_LIST/SEARCH_RESULT_FOR', { 'SEARCH': value }) : '';
}); });
this.messageListPagenator = ko.computed( this.messageListPagenator = ko.computed(
@ -172,25 +172,25 @@ class MessageListMailBoxUserView extends AbstractViewNext {
this.hasCheckedOrSelectedLines = ko.computed(() => 0 < this.messageListCheckedOrSelected().length); this.hasCheckedOrSelectedLines = ko.computed(() => 0 < this.messageListCheckedOrSelected().length);
this.isSpamFolder = ko.computed( this.isSpamFolder = ko.computed(
() => FolderStore.spamFolder() === this.messageListEndFolder() && '' !== FolderStore.spamFolder() () => FolderStore.spamFolder() === this.messageListEndFolder() && FolderStore.spamFolder()
); );
this.isSpamDisabled = ko.computed(() => UNUSED_OPTION_VALUE === FolderStore.spamFolder()); this.isSpamDisabled = ko.computed(() => UNUSED_OPTION_VALUE === FolderStore.spamFolder());
this.isTrashFolder = ko.computed( this.isTrashFolder = ko.computed(
() => FolderStore.trashFolder() === this.messageListEndFolder() && '' !== FolderStore.trashFolder() () => FolderStore.trashFolder() === this.messageListEndFolder() && FolderStore.trashFolder()
); );
this.isDraftFolder = ko.computed( this.isDraftFolder = ko.computed(
() => FolderStore.draftFolder() === this.messageListEndFolder() && '' !== FolderStore.draftFolder() () => FolderStore.draftFolder() === this.messageListEndFolder() && FolderStore.draftFolder()
); );
this.isSentFolder = ko.computed( this.isSentFolder = ko.computed(
() => FolderStore.sentFolder() === this.messageListEndFolder() && '' !== FolderStore.sentFolder() () => FolderStore.sentFolder() === this.messageListEndFolder() && FolderStore.sentFolder()
); );
this.isArchiveFolder = ko.computed( this.isArchiveFolder = ko.computed(
() => FolderStore.archiveFolder() === this.messageListEndFolder() && '' !== FolderStore.archiveFolder() () => FolderStore.archiveFolder() === this.messageListEndFolder() && FolderStore.archiveFolder()
); );
this.isArchiveDisabled = ko.computed(() => UNUSED_OPTION_VALUE === FolderStore.archiveFolder()); this.isArchiveDisabled = ko.computed(() => UNUSED_OPTION_VALUE === FolderStore.archiveFolder());
@ -538,7 +538,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
* @returns {void} * @returns {void}
*/ */
setActionForAll(sFolderFullNameRaw, iSetAction, sThreadUid = '') { setActionForAll(sFolderFullNameRaw, iSetAction, sThreadUid = '') {
if ('' !== sFolderFullNameRaw) { if (sFolderFullNameRaw) {
let cnt = 0; let cnt = 0;
const uids = []; const uids = [];
@ -728,9 +728,9 @@ class MessageListMailBoxUserView extends AbstractViewNext {
clearListIsVisible() { clearListIsVisible() {
return ( return (
'' === this.messageListSearchDesc() && !this.messageListSearchDesc() &&
'' === this.messageListError() && !this.messageListError() &&
'' === this.messageListEndThreadUid() && !this.messageListEndThreadUid() &&
this.messageList().length && this.messageList().length &&
(this.isSpamFolder() || this.isTrashFolder()) (this.isSpamFolder() || this.isTrashFolder())
); );
@ -910,10 +910,10 @@ class MessageListMailBoxUserView extends AbstractViewNext {
// cancel search // cancel search
key('esc', KeyState.MessageList, () => { key('esc', KeyState.MessageList, () => {
if ('' !== this.messageListSearchDesc()) { if (this.messageListSearchDesc()) {
this.cancelSearch(); this.cancelSearch();
return false; return false;
} else if ('' !== this.messageListEndThreadUid()) { } else if (this.messageListEndThreadUid()) {
this.cancelThreadUid(); this.cancelThreadUid();
return false; return false;
} }

View file

@ -297,7 +297,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
if (pic !== this.viewUserPic() && lastEmail === email) { if (pic !== this.viewUserPic() && lastEmail === email) {
this.viewUserPicVisible(false); this.viewUserPicVisible(false);
this.viewUserPic(DATA_IMAGE_USER_DOT_PIC); this.viewUserPic(DATA_IMAGE_USER_DOT_PIC);
if ('' !== pic) { if (pic) {
this.viewUserPicVisible(true); this.viewUserPicVisible(true);
this.viewUserPic(pic); this.viewUserPic(pic);
} }
@ -386,7 +386,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
if (dom && 1 === dom.length) { if (dom && 1 === dom.length) {
let aC = dom; let aC = dom;
while ('' === result) { while (!result) {
limit -= 1; limit -= 1;
if (0 >= limit) { if (0 >= limit) {
break; break;
@ -456,7 +456,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
// return sLine ? [window.decodeURIComponent(sLine)].map(sItem => { // return sLine ? [window.decodeURIComponent(sLine)].map(sItem => {
// var oEmailModel = new EmailModel(); // var oEmailModel = new EmailModel();
// oEmailModel.parse(sItem); // oEmailModel.parse(sItem);
// return '' !== oEmailModel.email ? oEmailModel : null; // return oEmailModel.email ? oEmailModel : null;
// }).filter(value => !!value) : null; // }).filter(value => !!value) : null;
// } // }
// ; // ;
@ -930,7 +930,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext {
* @returns {void} * @returns {void}
*/ */
readReceipt(oMessage) { readReceipt(oMessage) {
if (oMessage && '' !== oMessage.readReceipt()) { if (oMessage && oMessage.readReceipt()) {
Remote.sendReadReceiptMessage( Remote.sendReadReceiptMessage(
noop, noop,
oMessage.folderFullNameRaw, oMessage.folderFullNameRaw,

View file

@ -1,5 +1,5 @@
(function(CKEDITOR, $, undefined) { (function(CKEDITOR, $) {
'use strict'; 'use strict';
@ -13,10 +13,10 @@
return $.trim(editor.__textUtils.htmlToPlain(html)); return $.trim(editor.__textUtils.htmlToPlain(html));
}; };
isEmptyText = '' === $.trim(text); isEmptyText = !$.trim(text);
if (!isEmptyText && isHtml) if (!isEmptyText && isHtml)
{ {
isEmptyText = '' === clearHtmlLine(text); isEmptyText = !clearHtmlLine(text);
} }
if (editor.__previos_signature && !isEmptyText) if (editor.__previos_signature && !isEmptyText)

2
vendors/jua/jua.js vendored
View file

@ -190,7 +190,7 @@
sFileName = sFileName.substr(1); sFileName = sFileName.substr(1);
} }
if ('' === sType && 0 === iSize) if (!sType && 0 === iSize)
{ {
return null; // Folder return null; // Folder
} }