Synchronize localizations from Transifex

Update package.json dependencies
Fix eslint errors
webpack 2 -> webpack 3
This commit is contained in:
RainLoop Team 2017-06-24 22:26:27 +03:00
parent 36dbe0defd
commit 8da988fef2
34 changed files with 888 additions and 757 deletions

View file

@ -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);

View file

@ -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');

View file

@ -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();

View file

@ -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, '&amp;')
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
.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)