Bug 1321274 - Remove usage of javascript String generics: mail. r?mkmelin
MozReview-Commit-ID: D0DqzGvRVFR
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -412,17 +412,17 @@ var EmailAccountProvisioner = {
node.style.display = "none";
}
document.getElementById("instructions").classList.add("hide");
EmailAccountProvisioner.saveName();
// Here's where we do some kind of hack-y client-side sanitization.
// Believe it or not, this is how you sanitize stuff to HTML elements
// via jQuery.
- // let name = String.trim($("<div></div>").text($("#name").val()).html());
+ // let name = $("<div></div>").text($("#name").val()).html().trim();
// Not quite sure what this was for, but here's the hack converted
// to vanilla JS.
let nameElement = document.getElementById("name");
let div = document.createElement("div");
div.textContent = nameElement.value;
let name = div.innerHTML.trim();
if (!name) {
nameElement.select();
@@ -456,17 +456,17 @@ var EmailAccountProvisioner = {
};
request.ontimeout = () => {
gLog.info("Timeout of XMLHttpRequest fetching address data.");
EmailAccountProvisioner.showSearchError();
}
request.onloadend = function() {
// Also called if we timeout.
let firstAndLastName = document.getElementById("FirstAndLastName");
- firstAndLastName.innerHTML = String.trim(firstname + " " + lastname);
+ firstAndLastName.innerHTML = (firstname + " " + lastname).trim();
EmailAccountProvisioner.searchEnabled(true);
EmailAccountProvisioner.spinning(false);
};
request.timeout = CONNECTION_TIMEOUT;
request.send(null);
},
/**
@@ -496,17 +496,17 @@ var EmailAccountProvisioner = {
}
gLog.info("Opening up a contentTab with the order form.");
// Then open a content tab.
let mail3Pane = Services.wm.getMostRecentWindow("mail:3pane");
let tabmail = mail3Pane.document.getElementById("tabmail");
tabmail.openTab("accountProvisionerTab", {
contentPage: url,
- realName: String.trim(firstName + " " + lastName),
+ realName: (firstName + " " + lastName).trim(),
email: email,
searchEngine: provider.search_engine,
onLoad: function (aEvent, aBrowser) {
window.close();
},
});
// Wait for the handler to close us.