Bug 1560475 - Do not load AccountManager.js into msgAccountCentral.js. r=darktrojan
authoraceman <acelists@atlas.sk>
Thu, 20 Jun 2019 22:53:00 +0200
changeset 35931 42c2ac13e002495c8061841dfe16de6aba93dff5
parent 35930 0b65696ec2396a59b8cc85a601a0baffc0b0a5a0
child 35932 f8de60138717a74dfb72395da77f38bf926bb8ac
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersdarktrojan
bugs1560475
Bug 1560475 - Do not load AccountManager.js into msgAccountCentral.js. r=darktrojan
mailnews/base/content/msgAccountCentral.js
mailnews/base/content/msgAccountCentral.xul
mailnews/base/prefs/content/AccountManager.js
mailnews/base/prefs/content/accountUtils.js
--- a/mailnews/base/content/msgAccountCentral.js
+++ b/mailnews/base/content/msgAccountCentral.js
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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/. */
 
 /* import-globals-from ../../../mail/base/content/mailCore.js */
-/* import-globals-from ../prefs/content/AccountManager.js */
 /* import-globals-from ../prefs/content/accountUtils.js */
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var selectedServer = null;
 
 function OnInit() {
   // Set the header for the page.
@@ -273,23 +272,23 @@ function ViewSettings(selectPage) {
 
 // Open AccountWizard to create an account
 function CreateNewAccount() {
   window.parent.msgOpenAccountWizard();
 }
 
 function CreateNewAccountTB(type) {
   if (type == "mail") {
-  AddMailAccount();
-  return;
+    AddMailAccount();
+    return;
   }
 
   if (type == "feeds") {
-  AddFeedAccount();
-  return;
+    AddFeedAccount();
+    return;
   }
 
   window.parent.msgOpenAccountWizard(
     function(state) {
     let win = getMostRecentMailWindow();
     if (state && win && win.gFolderTreeView && this.gCurrentAccount) {
       win.gFolderTreeView.selectFolder(
         this.gCurrentAccount.incomingServer.rootMsgFolder);
--- a/mailnews/base/content/msgAccountCentral.xul
+++ b/mailnews/base/content/msgAccountCentral.xul
@@ -18,17 +18,16 @@
       onload="OnInit();">
 
   <stringbundle id="bundle_brand"
                 src="chrome://branding/locale/brand.properties"/>
   <stringbundle id="bundle_messenger"
                 src="chrome://messenger/locale/messenger.properties"/>
   <stringbundle id="bundle_prefs"
                 src="chrome://messenger/locale/prefs.properties"/>
-  <script src="chrome://messenger/content/AccountManager.js"/>
   <script src="chrome://messenger/content/accountUtils.js"/>
   <script src="chrome://messenger/content/commandglue.js"/>
   <script src="chrome://messenger/content/mailWindowOverlay.js"/>
   <script src="chrome://messenger/content/mailWindow.js"/>
   <script src="chrome://messenger/content/msgMail3PaneWindow.js"/>
   <script src="chrome://messenger/content/msgAccountCentral.js"/>
   <script src="chrome://messenger/content/mailCore.js"/>
 
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -711,25 +711,16 @@ function onSave() {
 
  return true;
 }
 
 function onAddAccount() {
   MsgAccountWizard();
 }
 
-function AddMailAccount() {
-  NewMailAccount(MailServices.mailSession.topmostMsgWindow);
-}
-
-function AddIMAccount() {
-  window.openDialog("chrome://messenger/content/chat/imAccountWizard.xul",
-                    "", "chrome,modal,titlebar,centerscreen");
-}
-
 /**
  * Highlight the default account row in the account tree,
  * optionally un-highlight the previous one.
  *
  * @param newDefault  The account that has become the new default.
  *                    Can be given as null if there is none.
  * @param oldDefault  The account that has stopped being the default.
  *                    Can be given as null if there was none.
--- a/mailnews/base/prefs/content/accountUtils.js
+++ b/mailnews/base/prefs/content/accountUtils.js
@@ -203,16 +203,26 @@ function initAccountWizardTB(args) {
   if (selType) {
     acctyperadio.selectedItem = acctyperadio.querySelector("radio[value='" + selType + "']");
     accountwizard.advance("identitypage");
   } else {
     acctyperadio.selectedItem = acctyperadio.getItemAtIndex(0);
   }
 }
 
+function AddMailAccount() {
+  NewMailAccount(MailServices.mailSession.topmostMsgWindow);
+}
+
+function AddIMAccount() {
+  window.openDialog("chrome://messenger/content/chat/imAccountWizard.xul",
+                    "", "chrome,modal,titlebar,centerscreen");
+}
+
+
 function AddFeedAccount() {
   window.openDialog("chrome://messenger-newsblog/content/feedAccountWizard.xul",
                     "", "chrome,modal,titlebar,centerscreen");
 }
 
 /**
  * Opens the account settings window on the specified account
  * and page of settings. If the window is already open it is only focused.