Bug 1053774: use nsIExternalProtocolService to send emails. r=MattN

This commit is contained in:
Mike de Boer
2014-09-18 10:52:05 +02:00
parent a0a334d24b
commit a5bc8ab69a
4 changed files with 34 additions and 30 deletions

View File

@@ -361,17 +361,11 @@ loop.panel = (function(_, mozL10n) {
}
},
_generateMailTo: function() {
return encodeURI([
"mailto:?subject=" + __("share_email_subject3") + "&",
"body=" + __("share_email_body3", {callUrl: this.state.callUrl})
].join(""));
},
handleEmailButtonClick: function(event) {
this.handleLinkExfiltration(event);
// Note: side effect
document.location = event.target.dataset.mailto;
navigator.mozLoop.composeEmail(__("share_email_subject3"),
__("share_email_body3", { callUrl: this.state.callUrl }));
},
handleCopyButtonClick: function(event) {
@@ -409,8 +403,7 @@ loop.panel = (function(_, mozL10n) {
className: inputCSSClass}),
React.DOM.p({className: "btn-group url-actions"},
React.DOM.button({className: "btn btn-email", disabled: !this.state.callUrl,
onClick: this.handleEmailButtonClick,
'data-mailto': this._generateMailTo()},
onClick: this.handleEmailButtonClick},
__("share_button")
),
React.DOM.button({className: "btn btn-copy", disabled: !this.state.callUrl,
@@ -537,8 +530,7 @@ loop.panel = (function(_, mozL10n) {
React.renderComponent(PanelView({
client: client,
notifications: notifications}
), document.querySelector("#main"));
notifications: notifications}), document.querySelector("#main"));
document.body.classList.add(loop.shared.utils.getTargetPlatform());
document.body.setAttribute("dir", mozL10n.getDirection());