Bug 737349 - Add account dialog for Filelink should display Learn More... links for the feature and for each service. r+ui-r=bwinton.
authorMike Conley <mconley@mozilla.com>
Thu, 12 Apr 2012 16:30:19 -0400
changeset 11602 f2d47bbb6bf3d64147367a8d013e95c000de9aba
parent 11601 ab32d49d5df6302448fe1f9c7d634cb2ca422ae4
child 11603 c418e4b2019c658fa8b30d24096bb2e42d393ef0
push idunknown
push userunknown
push dateunknown
bugs737349
Bug 737349 - Add account dialog for Filelink should display Learn More... links for the feature and for each service. r+ui-r=bwinton.
mail/components/cloudfile/content/Dropbox/settings.xhtml
mail/components/cloudfile/content/YouSendIt/settings.xhtml
mail/components/cloudfile/content/addAccountDialog.js
mail/components/cloudfile/content/emptySettings.xhtml
mail/locales/en-US/chrome/messenger/cloudfile/Dropbox/settings.dtd
mail/locales/en-US/chrome/messenger/cloudfile/YouSendIt/settings.dtd
mail/locales/en-US/chrome/messenger/cloudfile/addAccountDialog.dtd
mail/locales/jar.mn
mail/themes/gnomestripe/mail/cloudfile/addAccountDialog.css
mail/themes/pinstripe/mail/cloudfile/addAccountDialog.css
mail/themes/qute/mail/cloudfile/addAccountDialog.css
--- a/mail/components/cloudfile/content/Dropbox/settings.xhtml
+++ b/mail/components/cloudfile/content/Dropbox/settings.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 % dbDTD SYSTEM "chrome://messenger/locale/cloudfile/Dropbox/settings.dtd"> %dbDTD;
+]>
 <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/">&dropboxSettings.learnMore;</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/">&youSendItSettings.learnMore;</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,61 @@ 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)
+      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();
+
+    // 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();
--- 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="">&addAccountDialog.learnMore;</a>
+    </div>
   </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/mail/locales/en-US/chrome/messenger/cloudfile/Dropbox/settings.dtd
@@ -0,0 +1,4 @@
+<!-- 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/.  -->
+<!ENTITY dropboxSettings.learnMore "Learn more…">
--- a/mail/locales/en-US/chrome/messenger/cloudfile/YouSendIt/settings.dtd
+++ b/mail/locales/en-US/chrome/messenger/cloudfile/YouSendIt/settings.dtd
@@ -1,5 +1,6 @@
 <!-- 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/.  -->
 <!ENTITY youSendItSettings.username "Username:">
 <!ENTITY youSendItSettings.needAnAccount "Need an account?">
+<!ENTITY youSendItSettings.learnMore "Learn more…">
--- a/mail/locales/en-US/chrome/messenger/cloudfile/addAccountDialog.dtd
+++ b/mail/locales/en-US/chrome/messenger/cloudfile/addAccountDialog.dtd
@@ -5,8 +5,9 @@
 <!ENTITY addAccountDialog.menuTitle "Select an online storage service">
 <!ENTITY addAccountDialog.style "width: 40em; min-height: 20em;">
 <!ENTITY addAccountDialog.accountName.label "Account Name:">
 <!ENTITY addAccountDialog.noAccountText "We're sorry, but the current version of &brandShortName; only allows one account from each online storage service.">
 <!ENTITY addAccountDialog.createAccountText "This feature allows you to send large attachments using one of several online storage services. You can either connect to an existing account, or sign up for a new account.">
 <!ENTITY addAccountDialog.authorizing "Checking authorization...">
 <!ENTITY addAccountDialog.error "An error occurred while setting up the account!">
 <!ENTITY addAccountDialog.acceptButton.label "Set up Account">
+<!ENTITY addAccountDialog.learnMore "Learn more…">
--- a/mail/locales/jar.mn
+++ b/mail/locales/jar.mn
@@ -120,16 +120,17 @@
   locale/@AB_CD@/messenger/addressbook/addressBook.properties           (%chrome/messenger/addressbook/addressBook.properties)
   locale/@AB_CD@/messenger/addressbook/ldapAutoCompErrs.properties      (%chrome/messenger/addressbook/ldapAutoCompErrs.properties)
   locale/@AB_CD@/messenger/addressbook/pref-directory.dtd               (%chrome/messenger/addressbook/pref-directory.dtd)
   locale/@AB_CD@/messenger/addressbook/pref-directory-add.dtd           (%chrome/messenger/addressbook/pref-directory-add.dtd)
   locale/@AB_CD@/messenger/addressbook/replicationProgress.properties   (%chrome/messenger/addressbook/replicationProgress.properties)
   locale/@AB_CD@/messenger/cloudfile/addAccountDialog.dtd               (%chrome/messenger/cloudfile/addAccountDialog.dtd)
   locale/@AB_CD@/messenger/cloudfile/management.dtd                     (%chrome/messenger/cloudfile/management.dtd)
   locale/@AB_CD@/messenger/cloudfile/Dropbox/management.dtd             (%chrome/messenger/cloudfile/Dropbox/management.dtd)
+  locale/@AB_CD@/messenger/cloudfile/Dropbox/settings.dtd               (%chrome/messenger/cloudfile/Dropbox/settings.dtd)
   locale/@AB_CD@/messenger/cloudfile/YouSendIt/management.dtd           (%chrome/messenger/cloudfile/YouSendIt/management.dtd)
   locale/@AB_CD@/messenger/cloudfile/YouSendIt/settings.dtd             (%chrome/messenger/cloudfile/YouSendIt/settings.dtd)
   locale/@AB_CD@/messenger/messengercompose/messengercompose.dtd        (%chrome/messenger/messengercompose/messengercompose.dtd)
   locale/@AB_CD@/messenger/messengercompose/addressingWidgetOverlay.dtd (%chrome/messenger/messengercompose/addressingWidgetOverlay.dtd)
   locale/@AB_CD@/messenger/messengercompose/askSendFormat.dtd           (%chrome/messenger/messengercompose/askSendFormat.dtd)
   locale/@AB_CD@/messenger/messengercompose/askSendFormat.properties    (%chrome/messenger/messengercompose/askSendFormat.properties)
   locale/@AB_CD@/messenger/messengercompose/sendProgress.dtd            (%chrome/messenger/messengercompose/sendProgress.dtd)
   locale/@AB_CD@/messenger/messengercompose/sendProgress.properties     (%chrome/messenger/messengercompose/sendProgress.properties)
--- 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;
+}