Release fixes

This commit is contained in:
RainLoop Team 2015-05-12 20:33:02 +04:00
parent 5b6c90aea9
commit f91f74fe7c
21 changed files with 398 additions and 83 deletions

View file

@ -103,7 +103,7 @@
*/
HtmlEditor.prototype.clearSignatureSigns = function (sText)
{
return sText.replace(/(\u200C|<x-signature>|<\/x-signature>)/g, '');
return sText.replace(/(\u200C|\u0002)/g, '');
};
/**

View file

@ -861,7 +861,7 @@
;
sText = sHtml
.replace(/<x-signature>([\s\S]*)<\/x-signature>/gm, '\u200C$1\u200C')
.replace(/\u0002([\s\S]*)\u0002/gm, '\u200C$1\u200C')
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
@ -1014,7 +1014,7 @@
.replace(/>/g, '&gt;').replace(/</g, '&lt;')
.replace(/~~~blockquote~~~[\s]*/g, '<blockquote>')
.replace(/[\s]*~~~\/blockquote~~~/g, '</blockquote>')
.replace(/\u200C([\s\S]*)\u200C/g, '<x-signature>$1</x-signature>')
.replace(/\u200C([\s\S]*)\u200C/g, '\u0002$1\u0002')
.replace(/\n/g, '<br />')
;

6
dev/External/ko.js vendored
View file

@ -275,8 +275,7 @@
ko.bindingHandlers.csstext = {
'init': function (oElement, fValueAccessor) {
var Utils = require('Common/Utils');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
if (oElement && oElement.styleSheet && undefined !== oElement.styleSheet.cssText)
{
oElement.styleSheet.cssText = ko.unwrap(fValueAccessor());
}
@ -286,8 +285,7 @@
}
},
'update': function (oElement, fValueAccessor) {
var Utils = require('Common/Utils');
if (oElement && oElement.styleSheet && !Utils.isUnd(oElement.styleSheet.cssText))
if (oElement && oElement.styleSheet && undefined !== oElement.styleSheet.cssText)
{
oElement.styleSheet.cssText = ko.unwrap(fValueAccessor());
}

View file

@ -225,16 +225,16 @@
{
var
iCount = 0,
oMessagesBodiesDom = null,
oMessagesDom = null,
iEnd = Globals.iMessageBodyCacheCount - Consts.Values.MessageBodyCacheLimit
;
if (0 < iEnd)
{
oMessagesBodiesDom = this.messagesBodiesDom();
if (oMessagesBodiesDom)
oMessagesDom = this.messagesBodiesDom();
if (oMessagesDom)
{
oMessagesBodiesDom.find('.rl-cache-class').each(function () {
oMessagesDom.find('.rl-cache-class').each(function () {
var oItem = $(this);
if (iEnd > oItem.data('rl-cache-count'))
{
@ -246,7 +246,7 @@
if (0 < iCount)
{
_.delay(function () {
oMessagesBodiesDom.find('.rl-cache-purge').remove();
oMessagesDom.find('.rl-cache-purge').remove();
}, 300);
}
}
@ -301,10 +301,10 @@
MessageUserStore.prototype.hideMessageBodies = function ()
{
var oMessagesBodiesDom = this.messagesBodiesDom();
if (oMessagesBodiesDom)
var oMessagesDom = this.messagesBodiesDom();
if (oMessagesDom)
{
oMessagesBodiesDom.find('.b-text-part').hide();
oMessagesDom.find('.b-text-part').hide();
}
};
@ -508,7 +508,7 @@
sResultHtml = '',
bPgpSigned = false,
bPgpEncrypted = false,
oMessagesBodiesDom = this.messagesBodiesDom(),
oMessagesDom = this.messagesBodiesDom(),
oSelectedMessage = this.selectorMessageSelected(),
oMessage = this.message(),
aThreads = []
@ -546,11 +546,12 @@
oMessage.initFlagsByJson(oData.Result);
}
oMessagesBodiesDom = oMessagesBodiesDom && oMessagesBodiesDom[0] ? oMessagesBodiesDom : null;
if (oMessagesBodiesDom)
oMessagesDom = oMessagesDom && oMessagesDom[0] ? oMessagesDom : null;
if (oMessagesDom)
{
sId = 'rl-mgs-' + oMessage.hash.replace(/[^a-zA-Z0-9]/g, '');
oTextBody = oMessagesBodiesDom.find('#' + sId);
oTextBody = oMessagesDom.find('#' + sId);
if (!oTextBody || !oTextBody[0])
{
bHasExternals = !!oData.Result.HasExternals;
@ -622,7 +623,7 @@
oMessage.body = oBody;
if (oMessage.body)
{
oMessagesBodiesDom.append(oMessage.body);
oMessagesDom.append(oMessage.body);
}
oMessage.storeDataInDom();

View file

@ -1098,25 +1098,25 @@
oText.find('.rlBlockquoteSwitcher').off('.rlBlockquoteSwitcher').remove();
oText.find('[data-html-editor-font-wrapper]').removeAttr('data-html-editor-font-wrapper');
(function () {
var oTmp = null, iLimit = 0;
while (true)
{
iLimit++;
oTmp = oText.children();
if (10 > iLimit && oTmp.is('div') && 1 === oTmp.length)
{
oTmp.children().unwrap();
continue;
}
break;
}
}());
// (function () {
//
// var oTmp = null, iLimit = 0;
//
// while (true)
// {
// iLimit++;
//
// oTmp = oText.children();
// if (10 > iLimit && oTmp.is('div') && 1 === oTmp.length)
// {
// oTmp.children().unwrap();
// continue;
// }
//
// break;
// }
//
// }());
sText = oText.html();
}

View file

@ -24,6 +24,8 @@
Cache = require('Common/Cache'),
EmailModel = require('Model/Email'),
SocialStore = require('Stores/Social'),
AppStore = require('Stores/User/App'),
SettingsStore = require('Stores/User/Settings'),
@ -531,6 +533,32 @@
}
};
/**
* @todo
* @param {string} sEmail
*/
MessageViewMailBoxUserView.prototype.displayMailToPopup = function (sMailToUrl)
{
sMailToUrl = sMailToUrl.replace(/\?.+$/, '');
var
sResult = '',
aTo = [],
fParseEmailLine = function (sLine) {
return sLine ? _.compact(_.map([window.decodeURIComponent(sLine)], function (sItem) {
var oEmailModel = new EmailModel();
oEmailModel.mailsoParse(sItem);
return '' !== oEmailModel.email ? oEmailModel : null;
})) : null;
}
;
aTo = fParseEmailLine(sMailToUrl);
sResult = aTo && aTo[0] ? aTo[0].email : '';
window.console.log(sResult);
};
MessageViewMailBoxUserView.prototype.onBuild = function (oDom)
{
var
@ -666,6 +694,21 @@
// setup maito protocol
return !(!!oEvent && 3 !== oEvent['which'] && Utils.mailToHelper($(this).attr('href'), require('View/Popup/Compose')));
})
// .on('mouseover', 'a', _.debounce(function (oEvent) {
//
// if (oEvent)
// {
// var sMailToUrl = $(this).attr('href');
// if (sMailToUrl && 'mailto:' === sMailToUrl.toString().substr(0, 7).toLowerCase())
// {
// sMailToUrl = sMailToUrl.toString().substr(7);
// self.displayMailToPopup(sMailToUrl);
// }
// }
//
// return true;
//
// }, 1000))
.on('click', '.attachmentsPlace .attachmentIconParent', function (oEvent) {
if (oEvent && oEvent.stopPropagation)
{