Bug 737349 - Add account dialog for Filelink should display Learn More... links for the feature and for each service. r+ui-r=bwinton, a=bienvenu.
--- a/mail/components/cloudfile/content/Dropbox/settings.xhtml
+++ b/mail/components/cloudfile/content/Dropbox/settings.xhtml
@@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!DOCTYPE html
-PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"DTD/xhtml1-strict.dtd">
+<!DOCTYPE html [
+ <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
+]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet"
type="text/css"
href="chrome://messenger/skin/cloudfile/addAccountDialog.css" />
</head>
<body id="provider-settings">
+ <div id="learn-more">
+ <a href="https://www.dropbox.com/"></a>
+ </div>
</body>
</html>
--- a/mail/components/cloudfile/content/YouSendIt/settings.xhtml
+++ b/mail/components/cloudfile/content/YouSendIt/settings.xhtml
@@ -7,21 +7,24 @@
<!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
<!ENTITY % ysiDTD SYSTEM "chrome://messenger/locale/cloudfile/YouSendIt/settings.dtd"> %ysiDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="application/javascript"
src="chrome://messenger/content/cloudfile/YouSendIt/settings.js"/>
<link rel="stylesheet"
- type="text/css"
- href="chrome://messenger/skin/cloudfile/addAccountDialog.css" />
+ type="text/css"
+ href="chrome://messenger/skin/cloudfile/addAccountDialog.css" />
</head>
<body id="provider-settings">
<form id="provider-form" onsubmit="return false;">
<label for="username">&youSendItSettings.username;</label>
<input id="username" type="text" required="true"/>
+ <div id="learn-more" class="float-right">
+ <a href="https://www.yousendit.com/"></a>
+ </div>
<div>
<a href="http://www.yousendit.com/compare-plans">&youSendItSettings.needAnAccount;</a>
</div>
</form>
</body>
</html>
--- a/mail/components/cloudfile/content/addAccountDialog.js
+++ b/mail/components/cloudfile/content/addAccountDialog.js
@@ -61,46 +61,68 @@ let addAccountDialog = {
this._authSpinner = document.getElementById("authorizing");
this._error = document.getElementById("error");
this._createAccountText = document.getElementById("createAccountText");
this.removeTitleMenuItem();
this.addAccountTypes();
// Hook up our onInput event handler
- this._settings.addEventListener("DOMContentLoaded", function(e) {
- let doc = this.contentDocument;
-
- let links = doc.getElementsByTagName("a");
-
- for (let [, link] in Iterator(links))
- link.addEventListener("click", addAccountDialog.onClickLink);
-
- let form = doc.getElementById(kFormId);
-
- if (form)
- form.addEventListener("input", addAccountDialog.onInput);
-
- addAccountDialog.onInput();
-
- // Focus the first field in the form, if any, that does not have the
- // class "focus-filter".
- let firstField = doc.querySelector("form:not(.filter) input:not(.hidden)");
- if (firstField)
- firstField.focus();
-
- }, false);
+ this._settings.addEventListener("DOMContentLoaded",
+ this.onIFrameLoaded.bind(this),
+ false);
this._settings.addEventListener("overflow", function(e) {
addAccountDialog.fitIFrame();
});
+ // Hook up the default "Learn More..." link to the appropriate link.
+ let learnMore = this._settings
+ .contentDocument
+ .querySelector('#learn-more > a[href=""]');
+ if (learnMore) {
+ this.insertLearnMoreString(learnMore);
+ learnMore.href = Services.prefs
+ .getCharPref("mail.cloud_files.learn_more_url");
+ }
+
+ // The default emptySettings.xhtml is already loaded into the IFrame
+ // at this point, before we could attach our DOMContentLoaded event
+ // listener, so we'll call the function here manually.
+ this.onIFrameLoaded(null);
+
addAccountDialog.fitIFrame();
},
+ onIFrameLoaded: function AAD_onIFrameLoaded(aEvent) {
+ let doc = this._settings.contentDocument;
+
+ let links = doc.getElementsByTagName("a");
+
+ for (let [, link] in Iterator(links))
+ link.addEventListener("click", this.onClickLink);
+
+ let form = doc.getElementById(kFormId);
+
+ if (form)
+ form.addEventListener("input", this.onInput);
+
+ this.onInput();
+
+ let learnMore = doc.querySelector('#learn-more > a');
+ if (learnMore)
+ this.insertLearnMoreString(learnMore);
+
+ // Focus the first field in the form, if any, that does not have the
+ // class "focus-filter".
+ let firstField = doc.querySelector("form:not(.filter) input:not(.hidden)");
+ if (firstField)
+ firstField.focus();
+ },
+
fitIFrame: function() {
// Determine the height of the accountSettings iframe, and adjust
// the height of the window appropriately.
let newHeight = this._settings.contentDocument
.body
.offsetHeight;
this._settings.style.height = this._settings.style.minHeight = newHeight + "px";
window.sizeToContent();
@@ -209,13 +231,18 @@ let addAccountDialog = {
.getElementById(kFormId);
if (form)
return form.checkValidity();
return true;
},
+ insertLearnMoreString: function AAD_insertLearnMoreString(aNode) {
+ let msgBundle = Services.strings
+ .createBundle("chrome://messenger/locale/messenger.properties");
+ aNode.textContent = msgBundle.GetStringFromName("crashedpluginsMessage.learnMore");
+ },
}
XPCOMUtils.defineLazyServiceGetter(this, "gProtocolService",
"@mozilla.org/uriloader/external-protocol-service;1",
"nsIExternalProtocolService");
--- a/mail/components/cloudfile/content/emptySettings.xhtml
+++ b/mail/components/cloudfile/content/emptySettings.xhtml
@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!DOCTYPE html
-PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"DTD/xhtml1-strict.dtd">
+<!DOCTYPE html [
+ <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> %htmlDTD;
+ <!ENTITY % aadDTD SYSTEM "chrome://messenger/locale/cloudfile/addAccountDialog.dtd"> %aadDTD;
+]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet"
type="text/css"
href="chrome://messenger/skin/cloudfile/addAccountDialog.css" />
</head>
<body id="provider-settings">
+ <div id="learn-more">
+ <a href=""></a>
+ </div>
</body>
</html>
--- a/mail/themes/gnomestripe/mail/cloudfile/addAccountDialog.css
+++ b/mail/themes/gnomestripe/mail/cloudfile/addAccountDialog.css
@@ -79,8 +79,16 @@ a {
}
/* Make the icons show up in the menulist */
#accountType > menupopup > menuitem > .menu-iconic-left {
-moz-padding-end: 2px;
display: -moz-box;
min-width: 16px;
}
+
+#learn-more {
+ text-align: right;
+}
+
+.float-right {
+ float: right;
+}
--- a/mail/themes/pinstripe/mail/cloudfile/addAccountDialog.css
+++ b/mail/themes/pinstripe/mail/cloudfile/addAccountDialog.css
@@ -84,8 +84,16 @@ a {
width: 100%;
}
#accountType > menupopup > menuitem > .menu-iconic-left {
display: -moz-box;
min-width: 16px;
-moz-padding-end: 2px;
}
+
+#learn-more {
+ text-align: right;
+}
+
+.float-right {
+ float: right;
+}
--- a/mail/themes/qute/mail/cloudfile/addAccountDialog.css
+++ b/mail/themes/qute/mail/cloudfile/addAccountDialog.css
@@ -79,8 +79,16 @@ a {
width: 100%;
}
#accountType > menupopup > menuitem > .menu-iconic-left {
display: -moz-box;
min-width: 16px;
-moz-padding-end: 2px;
}
+
+#learn-more {
+ text-align: right;
+}
+
+.float-right {
+ float: right;
+}