mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Pgp improvements
This commit is contained in:
parent
3849fd02b4
commit
5123841540
18 changed files with 397 additions and 80 deletions
|
|
@ -74,9 +74,7 @@
|
|||
// Audio.prototype.record = function ()
|
||||
// {
|
||||
// this.getUserMedia({audio:true}, function () {
|
||||
// window.console.log(arguments);
|
||||
// }, function(oError) {
|
||||
// window.console.log(arguments);
|
||||
// });
|
||||
// };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
/* global RL_COMMUNITY */
|
||||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Globals = require('Common/Globals')
|
||||
;
|
||||
|
||||
|
|
@ -24,6 +25,8 @@
|
|||
this.trigger = ko.observable(false);
|
||||
|
||||
this.i18n = _.bind(this.i18n, this);
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
Translator.prototype.data = {};
|
||||
|
|
@ -293,29 +296,41 @@
|
|||
{
|
||||
var
|
||||
self = this,
|
||||
$html = $('html'),
|
||||
fEmptyFunction = function () {},
|
||||
iStart = (new Date()).getTime()
|
||||
;
|
||||
|
||||
$html.addClass('rl-changing-language');
|
||||
Globals.$html.addClass('rl-changing-language');
|
||||
|
||||
$.ajax({
|
||||
'url': require('Common/Links').langLink(sLanguage, bAdmin),
|
||||
'dataType': 'script',
|
||||
'cache': true
|
||||
})
|
||||
.fail(fFail || fEmptyFunction)
|
||||
.fail(fFail || Utils.emptyFunction)
|
||||
.done(function () {
|
||||
_.delay(function () {
|
||||
|
||||
self.reloadData();
|
||||
(fDone || fEmptyFunction)();
|
||||
$html.removeClass('rl-changing-language');
|
||||
|
||||
(fDone || Utils.emptyFunction)();
|
||||
|
||||
Globals.$html
|
||||
.removeClass('rl-changing-language')
|
||||
.removeClass('rl-rtl rl-ltr')
|
||||
.addClass(-1 < Utils.inArray(sLanguage, ['ar', 'he', 'ur']) ? 'rl-rtl' : 'rl-ltr')
|
||||
// .attr('dir', -1 < Utils.inArray(sLanguage, ['ar', 'he', 'ur']) ? 'rtl' : 'ltr')
|
||||
;
|
||||
|
||||
}, 500 < (new Date()).getTime() - iStart ? 1 : 500);
|
||||
})
|
||||
;
|
||||
};
|
||||
|
||||
Translator.prototype.init = function ()
|
||||
{
|
||||
Globals.$html.addClass('rl-' + (Globals.$html.attr('dir') || 'ltr'));
|
||||
};
|
||||
|
||||
module.exports = new Translator();
|
||||
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -852,7 +852,11 @@
|
|||
},
|
||||
|
||||
convertPre = function () {
|
||||
return (arguments && 1 < arguments.length) ? arguments[1].toString().replace(/[\n]/gm, '<br />') : '';
|
||||
return (arguments && 1 < arguments.length) ?
|
||||
arguments[1].toString()
|
||||
.replace(/[\n]/gm, '<br />')
|
||||
.replace(/[\r]/gm, '')
|
||||
: '';
|
||||
},
|
||||
|
||||
fixAttibuteValue = function () {
|
||||
|
|
@ -868,7 +872,7 @@
|
|||
sText = sHtml
|
||||
.replace(/\u0002([\s\S]*)\u0002/gm, '\u200C$1\u200C')
|
||||
.replace(/<p[^>]*><\/p>/gi, '')
|
||||
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
|
||||
.replace(/<pre[^>]*>([\s\S\r\n\t]*)<\/pre>/gmi, convertPre)
|
||||
.replace(/[\s]+/gm, ' ')
|
||||
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
|
||||
.replace(/<br[^>]*>/gmi, '\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue