Backed out changeset f14aad7b8928 (bug 1672159)
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Wed, 21 Oct 2020 13:57:25 +0300
changeset 30885 73f69fd3bf3c2ee1f14309999992df55ae63cf6c
parent 30884 85ce5884b204114454d73d0765517878d835f96d
child 30886 dbee66d2200cc473148022f79c8519dd2f03aaf5
push id18093
push usermkmelin@iki.fi
push dateWed, 21 Oct 2020 10:58:36 +0000
treeherdercomm-central@dbee66d2200c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1672159
backs outf14aad7b8928a5cac98c3b984ffe1a25ed28d941
Backed out changeset f14aad7b8928 (bug 1672159)
mail/base/jar.mn
mail/extensions/openpgp/content/ui/keyWizard.js
mail/extensions/openpgp/content/ui/keyWizard.xhtml
mail/locales/en-US/chrome/overrides/settingsChange.dtd
mail/locales/en-US/messenger/openpgp/keyWizard.ftl
mail/locales/jar.mn
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -119,16 +119,17 @@ messenger.jar:
 % override chrome://mozapps/content/profile/profileDowngrade.xhtml chrome://messenger/content/profileDowngrade.xhtml
 
 *   content/messenger/buildconfig.html              (content/buildconfig.html)
     content/messenger/buildconfig.css               (content/buildconfig.css)
 % override chrome://global/content/buildconfig.html chrome://messenger/content/buildconfig.html
 % override chrome://global/content/buildconfig.css chrome://messenger/content/buildconfig.css
 
 # L10n resources and overrides.
+% override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://messenger/locale/downloads/settingsChange.dtd
 % override chrome://mozapps/locale/profile/profileDowngrade.dtd chrome://messenger/locale/profileDowngrade.dtd
 % override chrome://global/locale/netError.dtd chrome://messenger/locale/netError.dtd
 
 comm.jar:
 % content communicator %content/communicator/
    content/communicator/contentAreaClick.js         (content/contentAreaClick.js)
    content/communicator/utilityOverlay.js           (content/utilityOverlay.js)
 
--- a/mail/extensions/openpgp/content/ui/keyWizard.js
+++ b/mail/extensions/openpgp/content/ui/keyWizard.js
@@ -352,17 +352,17 @@ async function wizardExternalKey() {
   kDialog.getButton("accept").label = createLabel;
   kDialog.getButton("accept").classList.add("primary");
 
   // If the user is already using an external GnuPG key, populate the input,
   // show the warning description, and enable the primary button.
   if (gIdentity.getBoolAttribute("is_gnupg_key_id")) {
     document.getElementById(
       "externalKey"
-    ).value = "0x" + gIdentity.getUnicharAttribute(
+    ).value = gIdentity.getUnicharAttribute(
       "last_entered_external_gnupg_key_id"
     );
     document.getElementById("openPgpExternalWarning").collapsed = false;
     kDialog.getButton("accept").removeAttribute("disabled");
   } else {
     document.getElementById("openPgpExternalWarning").collapsed = true;
     kDialog.getButton("accept").setAttribute("disabled", true);
   }
@@ -1009,50 +1009,29 @@ function passphrasePromptCallback(win, k
     overlay.classList.add("hide");
     kGenerating = false;
   }
 
   resultFlags.canceled = !prompt;
   return !prompt ? "" : passphrase.value;
 }
 
-var ExternalKeyWiz = {
-  oninput(input) {
-    input.value = this.addBlankSpace(input.value);
-    kDialog.getButton("accept").disabled =
-      input.value && !input.validity.valid;
-  },
-
-  onblur(input) {
-    input.value = this.addBlankSpace(input.value);
-  },
-
-  addBlankSpace(value) {
-    if (!value.startsWith("0x") && value != "0" && value) {
-      value = "0x" + value;
-    }
-    return value
-      .replace(/\s/g, "")
-      .trim();
-  },
-};
+function toggleSaveButton(event) {
+  kDialog
+    .getButton("accept")
+    .toggleAttribute("disabled", !event.target.value.trim());
+}
 
 /**
  * Save the GnuPG Key for the current identity and trigger a callback.
  */
 function openPgpExternalComplete() {
   gIdentity.setBoolAttribute("is_gnupg_key_id", true);
 
   let externalKey = document.getElementById("externalKey").value;
-  externalKey = externalKey.replace(/ /g, "").replace(/^0x/, "").toUpperCase();
-  if (externalKey.length == 40) {
-    // If full fingerprint was entered, grab the last 16 characters, which
-    // is what forms the key id
-    externalKey = externalKey.substr(-16);
-  }
   gIdentity.setUnicharAttribute(
     "last_entered_external_gnupg_key_id",
     externalKey
   );
   gIdentity.setUnicharAttribute("openpgp_key_id", externalKey);
 
   window.arguments[0].okExternalCallback();
   window.close();
--- a/mail/extensions/openpgp/content/ui/keyWizard.xhtml
+++ b/mail/extensions/openpgp/content/ui/keyWizard.xhtml
@@ -294,21 +294,19 @@
           <separator/>
 
           <hbox align="center">
             <label for="externalKey"
                    data-l10n-id="openpgp-external-key-label"></label>
             <hbox class="input-container" flex="1">
               <html:input id="externalKey" type="text"
                           class="input-inline"
-                          placeholder="0x123456789ABCDEF"
-                          oninput="ExternalKeyWiz.oninput(this);"
-                          onblur="ExternalKeyWiz.onblur(this);"
-                          pattern="(0x)?[ 0-9a-fA-F]{16,40}"
-                          minlength="16"/>
+                          data-l10n-id="openpgp-external-key-input"
+                          oninput="toggleSaveButton(event)">
+              </html:input>
             </hbox>
           </hbox>
 
           <separator/>
 
           <hbox id="openPgpExternalWarning"
                 class="inline-notification-container info-container"
                 collapsed="true">
new file mode 100644
--- /dev/null
+++ b/mail/locales/en-US/chrome/overrides/settingsChange.dtd
@@ -0,0 +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  settingsChangePreferences.label  "Settings can be changed using the Attachments tab in &brandShortName;'s Preferences.">
+<!ENTITY  settingsChangeOptions.label      "Settings can be changed using the Attachments tab in &brandShortName;'s Options.">
--- a/mail/locales/en-US/messenger/openpgp/keyWizard.ftl
+++ b/mail/locales/en-US/messenger/openpgp/keyWizard.ftl
@@ -177,8 +177,11 @@ openpgp-external-key-description = Confi
 
 openpgp-external-key-info = In addition, you must use Key Manager to import and accept the corresponding Public Key.
 
 openpgp-external-key-warning = <b>You may configure only one external GnuPG Key.</b> Your previous entry will be replaced.
 
 openpgp-save-external-button = Save key ID
 
 openpgp-external-key-label = Secret Key ID:
+
+openpgp-external-key-input =
+    .placeholder = 123456789341298340
--- a/mail/locales/jar.mn
+++ b/mail/locales/jar.mn
@@ -176,16 +176,17 @@
   locale/@AB_CD@/messenger/preferences/applicationManager.properties    (%chrome/messenger/preferences/applicationManager.properties)
   locale/@AB_CD@/messenger/preferences/preferences.properties           (%chrome/messenger/preferences/preferences.properties)
   locale/@AB_CD@/messenger/migration/migration.dtd                      (%chrome/messenger/migration/migration.dtd)
   locale/@AB_CD@/messenger/migration/migration.properties               (%chrome/messenger/migration/migration.properties)
   locale/@AB_CD@/messenger/newmailaccount/accountProvisioner.properties (%chrome/messenger/newmailaccount/accountProvisioner.properties)
   locale/@AB_CD@/messenger/newmailaccount/accountProvisioner.dtd        (%chrome/messenger/newmailaccount/accountProvisioner.dtd)
   locale/@AB_CD@/messenger/activity.dtd                                 (%chrome/messenger/activity.dtd)
   locale/@AB_CD@/messenger/activity.properties                          (%chrome/messenger/activity.properties)
+  locale/@AB_CD@/messenger/downloads/settingsChange.dtd                 (%chrome/overrides/settingsChange.dtd)
   locale/@AB_CD@/messenger/netError.dtd                                 (%chrome/overrides/netError.dtd)
   locale/@AB_CD@/messenger/profileDowngrade.dtd                         (%chrome/overrides/profileDowngrade.dtd)
   locale/@AB_CD@/messenger/newsError.dtd                                (%chrome/messenger/newsError.dtd)
   locale/@AB_CD@/messenger/chat.dtd                                     (%chrome/messenger/chat.dtd)
   locale/@AB_CD@/messenger/chat.properties                              (%chrome/messenger/chat.properties)
   locale/@AB_CD@/messenger/addbuddy.dtd                                 (%chrome/messenger/addbuddy.dtd)
   locale/@AB_CD@/messenger/joinChat.dtd                                 (%chrome/messenger/joinChat.dtd)
   locale/@AB_CD@/messenger/imAccounts.properties                        (%chrome/messenger/imAccounts.properties)