mailto link parser

This commit is contained in:
RainLoop Team 2014-08-12 17:51:34 +04:00
parent 6ad84283b7
commit 016b3eead3
8 changed files with 146 additions and 30 deletions

View file

@ -355,9 +355,9 @@ MailBoxMessageViewViewModel.prototype.onBuild = function (oDom)
self.message.focused(true);
}
})
.on('mousedown', 'a', function (oEvent) {
.on('click', 'a', function (oEvent) {
// setup maito protocol
return !(oEvent && 3 !== oEvent['which'] && RL.mailToHelper($(this).attr('href')));
return !(!!oEvent && 3 !== oEvent['which'] && RL.mailToHelper($(this).attr('href')));
})
.on('click', '.attachmentsPlace .attachmentPreview', function (oEvent) {
if (oEvent && oEvent.stopPropagation)

View file

@ -655,8 +655,10 @@ PopupsComposeViewModel.prototype.editor = function (fOnInit)
* @param {string=} sType = Enums.ComposeType.Empty
* @param {?MessageModel|Array=} oMessageOrArray = null
* @param {Array=} aToEmails = null
* @param {string=} sCustomSubject = null
* @param {string=} sCustomPlainText = null
*/
PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToEmails)
PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText)
{
kn.routeOff();
@ -850,7 +852,14 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
}
else if (Enums.ComposeType.Empty === sComposeType)
{
sText = this.convertSignature(sSignature);
this.subject(Utils.isNormal(sCustomSubject) ? '' + sCustomSubject : '');
sText = Utils.isNormal(sCustomPlainText) ? '' + sCustomPlainText : '';
if (bSignatureToAll && '' !== sSignature && '' !== sText)
{
sText = this.convertSignature(sSignature) + '<br />' + sText;
}
this.editor(function (oEditor) {
oEditor.setHtml(sText, false);
if (Enums.EditorDefaultType.Html !== RL.data().editorDefaultType())