mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Synchronize localizations from Transifex
Update package.json dependencies Fix eslint errors webpack 2 -> webpack 3
This commit is contained in:
parent
36dbe0defd
commit
8da988fef2
34 changed files with 888 additions and 757 deletions
|
|
@ -91,15 +91,15 @@ class AbstractApp extends AbstractBoot
|
|||
}
|
||||
}, Magics.Time50ms));
|
||||
|
||||
// DEBUG
|
||||
// Events.sub({
|
||||
// 'window.resize': function() {
|
||||
// window.console.log('window.resize');
|
||||
// },
|
||||
// 'window.resize.real': function() {
|
||||
// window.console.log('window.resize.real');
|
||||
// }
|
||||
// });
|
||||
// DEBUG
|
||||
// Events.sub({
|
||||
// 'window.resize': function() {
|
||||
// window.console.log('window.resize');
|
||||
// },
|
||||
// 'window.resize.real': function() {
|
||||
// window.console.log('window.resize.real');
|
||||
// }
|
||||
// });
|
||||
|
||||
$doc.on('keydown', (event) => {
|
||||
if (event && event.ctrlKey)
|
||||
|
|
@ -172,7 +172,7 @@ class AbstractApp extends AbstractBoot
|
|||
else
|
||||
{
|
||||
this.iframe.attr('src', link);
|
||||
// window.document.location.href = link;
|
||||
// window.document.location.href = link;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -313,7 +313,7 @@ class AbstractApp extends AbstractBoot
|
|||
ko.components.register('Date', require('Component/Date').default);
|
||||
|
||||
ko.components.register('x-script', require('Component/Script').default);
|
||||
// ko.components.register('svg-icon', require('Component/SvgIcon').default);
|
||||
// ko.components.register('svg-icon', require('Component/SvgIcon').default);
|
||||
|
||||
if (Settings.appSettingsGet('materialDesign') && bAnimationSupported)
|
||||
{
|
||||
|
|
@ -322,8 +322,8 @@ class AbstractApp extends AbstractBoot
|
|||
}
|
||||
else
|
||||
{
|
||||
// ko.components.register('Checkbox', require('Component/Classic/Checkbox').default);
|
||||
// ko.components.register('CheckboxSimple', require('Component/Classic/Checkbox').default);
|
||||
// ko.components.register('Checkbox', require('Component/Classic/Checkbox').default);
|
||||
// ko.components.register('CheckboxSimple', require('Component/Classic/Checkbox').default);
|
||||
ko.components.register('Checkbox', require('Component/Checkbox').default);
|
||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||
}
|
||||
|
|
|
|||
109
dev/App/User.js
109
dev/App/User.js
|
|
@ -192,31 +192,37 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
|
||||
MessageStore.messageListLoading(true);
|
||||
Remote.messageList((sResult, oData, bCached) => {
|
||||
Remote.messageList(
|
||||
(sResult, oData, bCached) => {
|
||||
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
if (StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
|
||||
MessageStore.setMessageList(oData, bCached);
|
||||
}
|
||||
else if (StorageResultType.Unload === sResult)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
}
|
||||
else if (StorageResultType.Abort !== sResult)
|
||||
{
|
||||
MessageStore.messageList([]);
|
||||
MessageStore.messageListLoading(false);
|
||||
MessageStore.messageListError(oData && oData.ErrorCode ?
|
||||
getNotification(oData.ErrorCode) : i18n('NOTIFICATIONS/CANT_GET_MESSAGE_LIST')
|
||||
);
|
||||
}
|
||||
MessageStore.setMessageList(oData, bCached);
|
||||
}
|
||||
else if (StorageResultType.Unload === sResult)
|
||||
{
|
||||
MessageStore.messageListError('');
|
||||
MessageStore.messageListLoading(false);
|
||||
}
|
||||
else if (StorageResultType.Abort !== sResult)
|
||||
{
|
||||
MessageStore.messageList([]);
|
||||
MessageStore.messageListLoading(false);
|
||||
MessageStore.messageListError(oData && oData.ErrorCode ?
|
||||
getNotification(oData.ErrorCode) : i18n('NOTIFICATIONS/CANT_GET_MESSAGE_LIST')
|
||||
);
|
||||
}
|
||||
|
||||
}, FolderStore.currentFolderFullNameRaw(), iOffset, SettingsStore.messagesPerPage(),
|
||||
MessageStore.messageListSearch(), MessageStore.messageListThreadUid());
|
||||
},
|
||||
FolderStore.currentFolderFullNameRaw(),
|
||||
iOffset,
|
||||
SettingsStore.messagesPerPage(),
|
||||
MessageStore.messageListSearch(),
|
||||
MessageStore.messageListThreadUid()
|
||||
);
|
||||
}
|
||||
|
||||
recacheInboxMessageList() {
|
||||
|
|
@ -524,32 +530,32 @@ class AppUser extends AbstractApp
|
|||
|
||||
accountsCounts() {
|
||||
return false;
|
||||
// AccountStore.accounts.loading(true);
|
||||
//
|
||||
// Remote.accountsCounts((sResult, oData) => {
|
||||
//
|
||||
// AccountStore.accounts.loading(false);
|
||||
//
|
||||
// if (StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
|
||||
// {
|
||||
// var
|
||||
// sEmail = AccountStore.email(),
|
||||
// aAcounts = AccountStore.accounts()
|
||||
// ;
|
||||
//
|
||||
// _.each(oData.Result['Counts'], (oItem) => {
|
||||
//
|
||||
// var oAccount = _.find(aAcounts, (oAccount) => {
|
||||
// return oAccount && oItem[0] === oAccount.email && sEmail !== oAccount.email;
|
||||
// });
|
||||
//
|
||||
// if (oAccount)
|
||||
// {
|
||||
// oAccount.count(pInt(oItem[1]));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// AccountStore.accounts.loading(true);
|
||||
//
|
||||
// Remote.accountsCounts((sResult, oData) => {
|
||||
//
|
||||
// AccountStore.accounts.loading(false);
|
||||
//
|
||||
// if (StorageResultType.Success === sResult && oData.Result && oData.Result['Counts'])
|
||||
// {
|
||||
// var
|
||||
// sEmail = AccountStore.email(),
|
||||
// aAcounts = AccountStore.accounts()
|
||||
// ;
|
||||
//
|
||||
// _.each(oData.Result['Counts'], (oItem) => {
|
||||
//
|
||||
// var oAccount = _.find(aAcounts, (oAccount) => {
|
||||
// return oAccount && oItem[0] === oAccount.email && sEmail !== oAccount.email;
|
||||
// });
|
||||
//
|
||||
// if (oAccount)
|
||||
// {
|
||||
// oAccount.count(pInt(oItem[1]));
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
accountsAndIdentities(bBoot) {
|
||||
|
|
@ -1299,7 +1305,7 @@ class AppUser extends AbstractApp
|
|||
{
|
||||
this.setWindowTitle(i18n('TITLES/LOADING'));
|
||||
|
||||
// require.ensure([], function() { // require code splitting
|
||||
// require.ensure([], function() { // require code splitting
|
||||
|
||||
this.foldersReload((value) => {
|
||||
|
||||
|
|
@ -1362,7 +1368,7 @@ class AppUser extends AbstractApp
|
|||
startScreens([
|
||||
MailBoxUserScreen,
|
||||
Settings.capa(Capa.Settings) ? SettingsUserScreen : null
|
||||
// false ? AboutUserScreen : null
|
||||
// false ? AboutUserScreen : null
|
||||
]);
|
||||
|
||||
if (allowGoogle || allowFacebook || allowTwitter)
|
||||
|
|
@ -1444,8 +1450,7 @@ class AppUser extends AbstractApp
|
|||
}
|
||||
});
|
||||
|
||||
// }); // require code splitting
|
||||
|
||||
// }); // require code splitting
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
import window from 'window';
|
||||
import progressJs from 'progressJs';
|
||||
import Promise from 'Promise';
|
||||
|
||||
import {jassl} from 'Common/Jassl';
|
||||
import {getHash, setHash, clearHash} from 'Storage/RainLoop';
|
||||
|
|
@ -226,28 +225,30 @@ function runApp()
|
|||
p.setOptions({theme: 'rainloop'});
|
||||
p.start().set(5);
|
||||
|
||||
const
|
||||
libs = jassl(appData.StaticLibJsLink).then(() => {
|
||||
if (window.$)
|
||||
const libs = jassl(appData.StaticLibJsLink).then(() => {
|
||||
if (window.$)
|
||||
{
|
||||
window.$('#rl-check').remove();
|
||||
|
||||
if (appData.IncludeBackground)
|
||||
{
|
||||
window.$('#rl-check').remove();
|
||||
|
||||
if (appData.IncludeBackground)
|
||||
{
|
||||
window.$('#rl-bg').attr('style', 'background-image: none !important;')
|
||||
.backstretch(appData.IncludeBackground.replace('{{USER}}',
|
||||
(window.__rlah ? (window.__rlah() || '0') : '0')), {fade: 100, centeredX: true, centeredY: true})
|
||||
.removeAttr('style');
|
||||
}
|
||||
window.$('#rl-bg')
|
||||
.attr('style', 'background-image: none !important;')
|
||||
.backstretch(
|
||||
appData.IncludeBackground.replace('{{USER}}', (window.__rlah ? (window.__rlah() || '0') : '0')),
|
||||
{fade: 100, centeredX: true, centeredY: true}
|
||||
)
|
||||
.removeAttr('style');
|
||||
}
|
||||
}),
|
||||
common = Promise.all([
|
||||
// jassl('https://code.jquery.com/jquery-migrate-3.0.0.js'),
|
||||
jassl(appData.TemplatesLink),
|
||||
jassl(appData.LangLink)
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
Promise.all([libs, common])
|
||||
const common = window.Promise.all([
|
||||
jassl(appData.TemplatesLink),
|
||||
jassl(appData.LangLink)
|
||||
]);
|
||||
|
||||
window.Promise.all([libs, common])
|
||||
.then(() => {
|
||||
p.set(30);
|
||||
return jassl(useJsNextBundle ? appData.StaticAppJsNextLink : appData.StaticAppJsLink);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
import window from 'window';
|
||||
import Promise from 'Promise';
|
||||
|
||||
// let rainloopCaches = window.caches && window.caches.open ? window.caches : null;
|
||||
|
||||
|
|
@ -11,7 +10,7 @@ import Promise from 'Promise';
|
|||
*/
|
||||
export function jassl(src, async = false) {
|
||||
|
||||
if (!Promise || !Promise.all)
|
||||
if (!window.Promise || !window.Promise.all)
|
||||
{
|
||||
throw new Error('Promises are not available your environment.');
|
||||
}
|
||||
|
|
@ -21,7 +20,7 @@ export function jassl(src, async = false) {
|
|||
throw new Error('src should not be empty.');
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new window.Promise((resolve, reject) => {
|
||||
|
||||
const element = window.document.createElement('script');
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import {pInt, isUnd, isNull, has, microtime, inArray} from 'Common/Utils';
|
|||
import {$html, bAnimationSupported} from 'Common/Globals';
|
||||
import {reload as momentorReload} from 'Common/Momentor';
|
||||
import {langLink} from 'Common/Links';
|
||||
import Promise from 'Promise';
|
||||
|
||||
let I18N_DATA = window.rainloopI18N || {};
|
||||
|
||||
|
|
@ -304,7 +303,7 @@ export function reload(admin, language)
|
|||
|
||||
$html.addClass('rl-changing-language');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new window.Promise((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: langLink(language, admin),
|
||||
dataType: 'script',
|
||||
|
|
@ -319,7 +318,7 @@ export function reload(admin, language)
|
|||
$html
|
||||
.removeClass('rl-changing-language')
|
||||
.removeClass('rl-rtl rl-ltr')
|
||||
// .attr('dir', isRtl ? 'rtl' : 'ltr')
|
||||
// .attr('dir', isRtl ? 'rtl' : 'ltr')
|
||||
.addClass(isRtl ? 'rl-rtl' : 'rl-ltr');
|
||||
|
||||
resolve();
|
||||
|
|
|
|||
|
|
@ -763,27 +763,29 @@ export function htmlToPlain(html)
|
|||
|
||||
text = '';
|
||||
|
||||
const
|
||||
convertBlockquote = (blockquoteText) => {
|
||||
blockquoteText = '> ' + trim(blockquoteText).replace(/\n/gm, '\n> ');
|
||||
return blockquoteText.replace(/(^|\n)([> ]+)/gm,
|
||||
(...args) => (args && 2 < args.length ? args[1] + trim(args[2].replace(/[\s]/g, '')) + ' ' : ''));
|
||||
},
|
||||
convertDivs = (...args) => {
|
||||
if (args && 1 < args.length)
|
||||
{
|
||||
let divText = trim(args[1]);
|
||||
if (0 < divText.length)
|
||||
{
|
||||
divText = divText.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gmi, convertDivs);
|
||||
divText = '\n' + trim(divText) + '\n';
|
||||
}
|
||||
const convertBlockquote = (blockquoteText) => {
|
||||
blockquoteText = '> ' + trim(blockquoteText).replace(/\n/gm, '\n> ');
|
||||
return blockquoteText.replace(/(^|\n)([> ]+)/gm,
|
||||
(...args) => (args && 2 < args.length ? args[1] + trim(args[2].replace(/[\s]/g, '')) + ' ' : ''));
|
||||
};
|
||||
|
||||
return divText;
|
||||
const convertDivs = (...args) => {
|
||||
if (args && 1 < args.length)
|
||||
{
|
||||
let divText = trim(args[1]);
|
||||
if (0 < divText.length)
|
||||
{
|
||||
divText = divText.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gmi, convertDivs);
|
||||
divText = '\n' + trim(divText) + '\n';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
return divText;
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
const
|
||||
convertPre = (...args) => (args && 1 < args.length ? args[1].toString().replace(/[\n]/gm, '<br />').replace(/[\r]/gm, '') : ''),
|
||||
fixAttibuteValue = (...args) => (args && 1 < args.length ? '' + args[1] + _.escape(args[2]) : ''),
|
||||
convertLinks = (...args) => (args && 1 < args.length ? trim(args[1]) : '');
|
||||
|
|
@ -935,7 +937,7 @@ export function plainToHtml(plain, findEmailAndLinksInText = false)
|
|||
plain = aText.join('\n');
|
||||
|
||||
plain = plain
|
||||
// .replace(/~~~\/blockquote~~~\n~~~blockquote~~~/g, '\n')
|
||||
// .replace(/~~~\/blockquote~~~\n~~~blockquote~~~/g, '\n')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/>/g, '>').replace(/</g, '<')
|
||||
.replace(/~~~blockquote~~~[\s]*/g, '<blockquote>')
|
||||
|
|
@ -1037,7 +1039,7 @@ export function folderListOptionsBuilder(aSystem, aList, aDisabled, aHeaderLines
|
|||
for (iIndex = 0, iLen = aList.length; iIndex < iLen; iIndex++)
|
||||
{
|
||||
oItem = aList[iIndex];
|
||||
// if (oItem.subScribed() || !oItem.existen || bBuildUnvisible)
|
||||
// if (oItem.subScribed() || !oItem.existen || bBuildUnvisible)
|
||||
if ((oItem.subScribed() || !oItem.existen || bBuildUnvisible) && (oItem.selectable || oItem.hasSubScribedSubfolders()))
|
||||
{
|
||||
if (fVisibleCallback ? fVisibleCallback(oItem) : true)
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ class ScriptComponent extends AbstractComponent
|
|||
{
|
||||
params.element.text('');
|
||||
params.element.replaceWith(
|
||||
$(script).text(params.component.templateNodes[0] &&
|
||||
params.component.templateNodes[0].nodeValue ?
|
||||
params.component.templateNodes[0].nodeValue : ''));
|
||||
$(script).text(
|
||||
params.component.templateNodes[0] && params.component.templateNodes[0].nodeValue ?
|
||||
params.component.templateNodes[0].nodeValue : ''
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
20
dev/External/ko.js
vendored
20
dev/External/ko.js
vendored
|
|
@ -73,8 +73,8 @@ ko.bindingHandlers.editor = {
|
|||
|
||||
fValue.subscribe(fUpdateEditorValue);
|
||||
|
||||
// ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
|
||||
// });
|
||||
// ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
|
||||
// });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -318,8 +318,8 @@ ko.bindingHandlers.registrateBootstrapDropdown = {
|
|||
require('Common/Utils').detectDropdownVisibility();
|
||||
});
|
||||
|
||||
// ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
|
||||
// });
|
||||
// ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
|
||||
// });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -897,12 +897,12 @@ ko.bindingHandlers.emailsTags = {
|
|||
focusCallback: fFocusCallback,
|
||||
inputDelimiters: [',', ';', '\n'],
|
||||
autoCompleteSource: fAutoCompleteSource,
|
||||
// elementHook: (el, item) => {
|
||||
// if (el && item)
|
||||
// {
|
||||
// el.addClass('pgp');
|
||||
// }
|
||||
// },
|
||||
// elementHook: (el, item) => {
|
||||
// if (el && item)
|
||||
// {
|
||||
// el.addClass('pgp');
|
||||
// }
|
||||
// },
|
||||
parseHook: (input) => _.map(input, (inputValue) => {
|
||||
const value = Utils.trim(inputValue);
|
||||
if ('' !== value)
|
||||
|
|
|
|||
|
|
@ -63,21 +63,15 @@ export const staticFileType = _.memoize((ext, mimeType) => {
|
|||
break;
|
||||
case -1 < inArray(mimeTypeParts[1], [
|
||||
'zip', '7z', 'tar', 'rar', 'gzip', 'bzip', 'bzip2', 'x-zip', 'x-7z', 'x-rar', 'x-tar', 'x-gzip', 'x-bzip', 'x-bzip2', 'x-zip-compressed', 'x-7z-compressed', 'x-rar-compressed'
|
||||
]) || -1 < inArray(ext, [
|
||||
'zip', '7z', 'tar', 'rar', 'gzip', 'bzip', 'bzip2'
|
||||
]):
|
||||
]) || -1 < inArray(ext, ['zip', '7z', 'tar', 'rar', 'gzip', 'bzip', 'bzip2']):
|
||||
result = FileType.Archive;
|
||||
break;
|
||||
case -1 < inArray(mimeTypeParts[1], ['pdf', 'x-pdf']) || -1 < inArray(ext, [
|
||||
'pdf'
|
||||
]):
|
||||
case -1 < inArray(mimeTypeParts[1], ['pdf', 'x-pdf']) || -1 < inArray(ext, ['pdf']):
|
||||
result = FileType.Pdf;
|
||||
break;
|
||||
case -1 < inArray(mimeType, [
|
||||
'application/pgp-signature', 'application/pgp-keys'
|
||||
]) || -1 < inArray(ext, [
|
||||
'asc', 'pem', 'ppk'
|
||||
]):
|
||||
]) || -1 < inArray(ext, ['asc', 'pem', 'ppk']):
|
||||
result = FileType.Certificate;
|
||||
break;
|
||||
case -1 < inArray(mimeType, ['application/pkcs7-signature']) ||
|
||||
|
|
|
|||
|
|
@ -223,35 +223,34 @@ class EmailModel
|
|||
return false;
|
||||
}
|
||||
|
||||
const
|
||||
substr = (str, start, len) => {
|
||||
str = pString(str);
|
||||
let end = str.length;
|
||||
const substr = (str, start, len) => {
|
||||
str = pString(str);
|
||||
let end = str.length;
|
||||
|
||||
if (0 > start)
|
||||
{
|
||||
start += end;
|
||||
}
|
||||
if (0 > start)
|
||||
{
|
||||
start += end;
|
||||
}
|
||||
|
||||
end = 'undefined' === typeof len ? end : (0 > len ? len + end : len + start);
|
||||
end = 'undefined' === typeof len ? end : (0 > len ? len + end : len + start);
|
||||
|
||||
return start >= str.length || 0 > start || start > end ? false : str.slice(start, end);
|
||||
},
|
||||
return start >= str.length || 0 > start || start > end ? false : str.slice(start, end);
|
||||
};
|
||||
|
||||
substrReplace = (str, replace, start, length) => {
|
||||
str = pString(str);
|
||||
if (0 > start)
|
||||
{
|
||||
start += str.length;
|
||||
}
|
||||
const substrReplace = (str, replace, start, length) => {
|
||||
str = pString(str);
|
||||
if (0 > start)
|
||||
{
|
||||
start += str.length;
|
||||
}
|
||||
|
||||
length = 'undefined' !== typeof length ? length : str.length;
|
||||
if (0 > length)
|
||||
{
|
||||
length = length + str.length - start;
|
||||
}
|
||||
return str.slice(0, start) + replace.substr(0, length) + replace.slice(length) + str.slice(start + length);
|
||||
};
|
||||
length = 'undefined' !== typeof length ? length : str.length;
|
||||
if (0 > length)
|
||||
{
|
||||
length = length + str.length - start;
|
||||
}
|
||||
return str.slice(0, start) + replace.substr(0, length) + replace.slice(length) + str.slice(start + length);
|
||||
};
|
||||
|
||||
let
|
||||
$sName = '',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import window from 'window';
|
||||
import $ from '$';
|
||||
import Promise from 'Promise';
|
||||
|
||||
import {ajax} from 'Common/Links';
|
||||
import {microtime, isUnd, isNormal, pString, pInt, inArray} from 'Common/Utils';
|
||||
|
|
@ -44,7 +44,7 @@ class AbstractAjaxPromises extends AbstractBasicPromises
|
|||
|
||||
ajaxRequest(action, isPost, timeOut, params, additionalGetString, fTrigger) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new window.Promise((resolve, reject) => {
|
||||
|
||||
const start = microtime();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
import Promise from 'Promise';
|
||||
import window from 'window';
|
||||
import {isArray} from 'Common/Utils';
|
||||
|
||||
export class AbstractBasicPromises
|
||||
|
|
@ -12,11 +12,11 @@ export class AbstractBasicPromises
|
|||
}
|
||||
|
||||
fastResolve(mData) {
|
||||
return Promise.resolve(mData);
|
||||
return window.Promise.resolve(mData);
|
||||
}
|
||||
|
||||
fastReject(mData) {
|
||||
return Promise.reject(mData);
|
||||
return window.Promise.reject(mData);
|
||||
}
|
||||
|
||||
setTrigger(trigger, value) {
|
||||
|
|
|
|||
|
|
@ -337,8 +337,7 @@ class RemoteUserAjax extends AbstractAjaxRemote
|
|||
UidNext: inboxUidNext,
|
||||
UseThreads: useThreads ? '1' : '0',
|
||||
ThreadUid: useThreads ? sThreadUid : ''
|
||||
}, '' === sSearch ? DEFAULT_AJAX_TIMEOUT : SEARCH_AJAX_TIMEOUT,
|
||||
'', bSilent ? [] : ['MessageList']);
|
||||
}, '' === sSearch ? DEFAULT_AJAX_TIMEOUT : SEARCH_AJAX_TIMEOUT, '', bSilent ? [] : ['MessageList']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -167,9 +167,10 @@ class AbstractSettingsScreen extends AbstractScreen
|
|||
|
||||
routes() {
|
||||
const
|
||||
DefaultViewModel = _.find(VIEW_MODELS.settings,
|
||||
(SettingsViewModel) => SettingsViewModel && SettingsViewModel.__rlSettingsData && SettingsViewModel.__rlSettingsData.IsDefault
|
||||
),
|
||||
DefaultViewModel = _.find(
|
||||
VIEW_MODELS.settings,
|
||||
(SettingsViewModel) => SettingsViewModel && SettingsViewModel.__rlSettingsData && SettingsViewModel.__rlSettingsData.IsDefault
|
||||
),
|
||||
defaultRoute = DefaultViewModel && DefaultViewModel.__rlSettingsData ? DefaultViewModel.__rlSettingsData.Route : 'general',
|
||||
rules = {
|
||||
subname: /^(.*)$/,
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ class AccountUserStore
|
|||
() => _.compact(_.map(this.accounts(), (item) => (item ? item.email : null))));
|
||||
|
||||
this.accountsUnreadCount = ko.computed(() => 0);
|
||||
// this.accountsUnreadCount = ko.computed(() => {
|
||||
// let result = 0;
|
||||
// _.each(this.accounts(), (item) => {
|
||||
// if (item)
|
||||
// {
|
||||
// result += item.count();
|
||||
// }
|
||||
// });
|
||||
// return result;
|
||||
// });
|
||||
// this.accountsUnreadCount = ko.computed(() => {
|
||||
// let result = 0;
|
||||
// _.each(this.accounts(), (item) => {
|
||||
// if (item)
|
||||
// {
|
||||
// result += item.count();
|
||||
// }
|
||||
// });
|
||||
// return result;
|
||||
// });
|
||||
}
|
||||
|
||||
populate() {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ class FolderUserStore
|
|||
{
|
||||
folder.type(FolderType.User);
|
||||
}
|
||||
},
|
||||
};
|
||||
const
|
||||
fSetSystemFolderType = (type) => (value) => {
|
||||
const folder = getFolderFromCacheList(value);
|
||||
if (folder)
|
||||
|
|
|
|||
|
|
@ -22,16 +22,16 @@ class TemplateUserStore
|
|||
this.templatesNames(_.compact(_.map(list, (item) => (item ? item.name : null))));
|
||||
});
|
||||
|
||||
// this.templatesNames.subscribe((aList) => {
|
||||
// if (this.templatesNames.skipFirst)
|
||||
// {
|
||||
// this.templatesNames.skipFirst = false;
|
||||
// }
|
||||
// else if (aList && 1 < aList.length)
|
||||
// {
|
||||
// Remote.templatesSortOrder(null, aList);
|
||||
// }
|
||||
// });
|
||||
// this.templatesNames.subscribe((aList) => {
|
||||
// if (this.templatesNames.skipFirst)
|
||||
// {
|
||||
// this.templatesNames.skipFirst = false;
|
||||
// }
|
||||
// else if (aList && 1 < aList.length)
|
||||
// {
|
||||
// Remote.templatesSortOrder(null, aList);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -776,14 +776,14 @@ class ComposePopupView extends AbstractViewNext
|
|||
{
|
||||
if (!this.oEditor && this.composeEditorArea())
|
||||
{
|
||||
// _.delay(() => {
|
||||
// _.delay(() => {
|
||||
this.oEditor = new HtmlEditor(this.composeEditorArea(), null, () => {
|
||||
fOnInit(this.oEditor);
|
||||
this.resizerTrigger();
|
||||
}, (bHtml) => {
|
||||
this.isHtml(!!bHtml);
|
||||
});
|
||||
// }, 1000);
|
||||
// }, 1000);
|
||||
}
|
||||
else if (this.oEditor)
|
||||
{
|
||||
|
|
@ -996,9 +996,8 @@ class ComposePopupView extends AbstractViewNext
|
|||
oMessageOrArray = oMessageOrArray || null;
|
||||
if (oMessageOrArray && isNormal(oMessageOrArray))
|
||||
{
|
||||
message = isArray(oMessageOrArray) &&
|
||||
1 === oMessageOrArray.length ? oMessageOrArray[0] :
|
||||
(!isArray(oMessageOrArray) ? oMessageOrArray : null);
|
||||
message = isArray(oMessageOrArray) && 1 === oMessageOrArray.length ? oMessageOrArray[0] :
|
||||
(!isArray(oMessageOrArray) ? oMessageOrArray : null);
|
||||
}
|
||||
|
||||
this.oLastMessage = message;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class ContactsPopupView extends AbstractViewNext
|
|||
|
||||
this.viewHash = ko.computed(() => '' + _.map(this.viewProperties(), (oItem) => oItem.value()).join(''));
|
||||
|
||||
// this.saveCommandDebounce = _.debounce(_.bind(this.saveCommand, this), 1000);
|
||||
// this.saveCommandDebounce = _.debounce(_.bind(this.saveCommand, this), 1000);
|
||||
|
||||
this.viewHash.subscribe(() => {
|
||||
if (this.watchHash() && !this.viewReadOnly() && !this.watchDirty())
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ class FilterPopupView extends AbstractViewNext
|
|||
populateOptions() {
|
||||
this.actionTypeOptions([]);
|
||||
|
||||
// this.actionTypeOptions.push({'id': FiltersAction.None,
|
||||
// 'name': i18n('POPUPS_FILTER/SELECT_ACTION_NONE')});
|
||||
// this.actionTypeOptions.push({'id': FiltersAction.None,
|
||||
// 'name': i18n('POPUPS_FILTER/SELECT_ACTION_NONE')});
|
||||
|
||||
const modules = this.modules();
|
||||
if (modules)
|
||||
|
|
|
|||
|
|
@ -48,23 +48,26 @@ class FolderSystemPopupView extends AbstractViewNext
|
|||
|
||||
const
|
||||
fSetSystemFolders = () => {
|
||||
Settings.settingsSet('SentFolder', FolderStore.sentFolder());
|
||||
Settings.settingsSet('DraftFolder', FolderStore.draftFolder());
|
||||
Settings.settingsSet('SpamFolder', FolderStore.spamFolder());
|
||||
Settings.settingsSet('TrashFolder', FolderStore.trashFolder());
|
||||
Settings.settingsSet('ArchiveFolder', FolderStore.archiveFolder());
|
||||
},
|
||||
fSaveSystemFolders = _.debounce(() => {
|
||||
fSetSystemFolders();
|
||||
Remote.saveSystemFolders(noop, {
|
||||
SentFolder: FolderStore.sentFolder(),
|
||||
DraftFolder: FolderStore.draftFolder(),
|
||||
SpamFolder: FolderStore.spamFolder(),
|
||||
TrashFolder: FolderStore.trashFolder(),
|
||||
ArchiveFolder: FolderStore.archiveFolder(),
|
||||
NullFolder: 'NullFolder'
|
||||
});
|
||||
}, Magics.Time1s),
|
||||
Settings.settingsSet('SentFolder', FolderStore.sentFolder());
|
||||
Settings.settingsSet('DraftFolder', FolderStore.draftFolder());
|
||||
Settings.settingsSet('SpamFolder', FolderStore.spamFolder());
|
||||
Settings.settingsSet('TrashFolder', FolderStore.trashFolder());
|
||||
Settings.settingsSet('ArchiveFolder', FolderStore.archiveFolder());
|
||||
},
|
||||
fSaveSystemFolders = _.debounce(
|
||||
() => {
|
||||
fSetSystemFolders();
|
||||
Remote.saveSystemFolders(noop, {
|
||||
SentFolder: FolderStore.sentFolder(),
|
||||
DraftFolder: FolderStore.draftFolder(),
|
||||
SpamFolder: FolderStore.spamFolder(),
|
||||
TrashFolder: FolderStore.trashFolder(),
|
||||
ArchiveFolder: FolderStore.archiveFolder(),
|
||||
NullFolder: 'NullFolder'
|
||||
});
|
||||
},
|
||||
Magics.Time1s
|
||||
),
|
||||
fCallback = () => {
|
||||
fSetSystemFolders();
|
||||
fSaveSystemFolders();
|
||||
|
|
|
|||
|
|
@ -264,63 +264,68 @@ class LoginUserView extends AbstractViewNext
|
|||
const
|
||||
fLoginRequest = (sLoginPassword) => {
|
||||
|
||||
Remote.login((sResult, oData) => {
|
||||
Remote.login(
|
||||
(sResult, oData) => {
|
||||
|
||||
$win.trigger('rl.tooltips.diactivate');
|
||||
$win.trigger('rl.tooltips.activate');
|
||||
$win.trigger('rl.tooltips.diactivate');
|
||||
$win.trigger('rl.tooltips.activate');
|
||||
|
||||
if (StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
if (StorageResultType.Success === sResult && oData && 'Login' === oData.Action)
|
||||
{
|
||||
if (oData.TwoFactorAuth)
|
||||
if (oData.Result)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.submitRequest(false);
|
||||
if (oData.TwoFactorAuth)
|
||||
{
|
||||
this.additionalCode('');
|
||||
this.additionalCode.visibility(true);
|
||||
this.submitRequest(false);
|
||||
|
||||
_.delay(() => this.additionalCode.focused(true), Magics.Time100ms);
|
||||
_.delay(() => this.additionalCode.focused(true), Magics.Time100ms);
|
||||
}
|
||||
else if (oData.Admin)
|
||||
{
|
||||
getApp().redirectToAdminPanel();
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().loginAndLogoutReload(false);
|
||||
}
|
||||
}
|
||||
else if (oData.Admin)
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
getApp().redirectToAdminPanel();
|
||||
this.submitRequest(false);
|
||||
if (-1 < inArray(oData.ErrorCode, [Notification.InvalidInputArgument]))
|
||||
{
|
||||
oData.ErrorCode = Notification.AuthError;
|
||||
}
|
||||
|
||||
this.submitError(getNotificationFromResponse(oData));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
else if (oData.ErrorMessageAdditional)
|
||||
{
|
||||
this.submitErrorAddidional(oData.ErrorMessageAdditional);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getApp().loginAndLogoutReload(false);
|
||||
}
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
if (-1 < inArray(oData.ErrorCode, [Notification.InvalidInputArgument]))
|
||||
{
|
||||
oData.ErrorCode = Notification.AuthError;
|
||||
}
|
||||
|
||||
this.submitError(getNotificationFromResponse(oData));
|
||||
|
||||
if ('' === this.submitError())
|
||||
{
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
else if (oData.ErrorMessageAdditional)
|
||||
{
|
||||
this.submitErrorAddidional(oData.ErrorMessageAdditional);
|
||||
this.submitRequest(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this.email(), '', sLoginPassword, !!this.signMe(),
|
||||
},
|
||||
this.email(),
|
||||
'',
|
||||
sLoginPassword,
|
||||
!!this.signMe(),
|
||||
this.bSendLanguage ? this.language() : '',
|
||||
this.additionalCode.visibility() ? this.additionalCode() : '',
|
||||
this.additionalCode.visibility() ? !!this.additionalCodeSignMe() : false
|
||||
|
|
|
|||
|
|
@ -68,20 +68,27 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
|||
let lastEmail = '';
|
||||
|
||||
const
|
||||
createCommandReplyHelper = (type) => createCommand(() => {
|
||||
this.lastReplyAction(type);
|
||||
this.replyOrforward(type);
|
||||
}, this.canBeRepliedOrForwarded),
|
||||
createCommandReplyHelper = (type) => createCommand(
|
||||
() => {
|
||||
this.lastReplyAction(type);
|
||||
this.replyOrforward(type);
|
||||
},
|
||||
this.canBeRepliedOrForwarded
|
||||
);
|
||||
|
||||
createCommandActionHelper = (folderType, useFolder) => createCommand(() => {
|
||||
const message = this.message();
|
||||
if (message && this.allowMessageListActions)
|
||||
{
|
||||
this.message(null);
|
||||
getApp().deleteMessagesFromFolder(
|
||||
folderType, message.folderFullNameRaw, [message.uid], useFolder);
|
||||
}
|
||||
}, this.messageVisibility);
|
||||
const
|
||||
createCommandActionHelper = (folderType, useFolder) => createCommand(
|
||||
() => {
|
||||
const message = this.message();
|
||||
if (message && this.allowMessageListActions)
|
||||
{
|
||||
this.message(null);
|
||||
getApp().deleteMessagesFromFolder(
|
||||
folderType, message.folderFullNameRaw, [message.uid], useFolder);
|
||||
}
|
||||
},
|
||||
this.messageVisibility
|
||||
);
|
||||
|
||||
this.oDom = null;
|
||||
this.oHeaderDom = null;
|
||||
|
|
@ -431,9 +438,9 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
|||
|
||||
const
|
||||
fFindDom = function(inputDom) {
|
||||
const children = inputDom ? inputDom.children() : null;
|
||||
return (children && 1 === children.length && children.is('table,div,center')) ? children : null;
|
||||
},
|
||||
const children = inputDom ? inputDom.children() : null;
|
||||
return (children && 1 === children.length && children.is('table,div,center')) ? children : null;
|
||||
},
|
||||
fFindColor = function(inputDom) {
|
||||
let color = '';
|
||||
if (inputDom)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue