Bug 762393 - merge junkLog.* files in /mailnews and /mail. r=IanN, r=mconley
authoraceman <acelists@atlas.sk>
Mon, 18 Jun 2012 18:48:41 -0400
changeset 10462 47380a5f11f4a7bd2dcb857f35187b42d374eea8
parent 10461 59d9b916d310ee83a37a8e10f41942af0fe28c38
child 10463 5edf3019ddaccf043cddbba3a08570742e1d33a2
push id7912
push userryanvm@gmail.com
push dateMon, 18 Jun 2012 22:49:17 +0000
treeherdercomm-central@47380a5f11f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, mconley
bugs762393
Bug 762393 - merge junkLog.* files in /mailnews and /mail. r=IanN, r=mconley
mail/components/preferences/jar.mn
mail/components/preferences/junkLog.js
mail/components/preferences/junkLog.xul
mail/components/preferences/security.js
mail/locales/en-US/chrome/messenger/junkLog.dtd
mail/locales/en-US/chrome/messenger/preferences/junkLog.dtd
mail/locales/jar.mn
mailnews/base/content/junkLog.js
mailnews/base/content/junkLog.xul
suite/locales/en-US/chrome/mailnews/junkLog.dtd
--- a/mail/components/preferences/jar.mn
+++ b/mail/components/preferences/jar.mn
@@ -12,18 +12,16 @@ messenger.jar:
     content/messenger/preferences/chat.xul
     content/messenger/preferences/chat.js
     content/messenger/preferences/compose.xul
     content/messenger/preferences/compose.js
 *   content/messenger/preferences/sendoptions.xul
     content/messenger/preferences/sendoptions.js
     content/messenger/preferences/security.xul
     content/messenger/preferences/security.js
-    content/messenger/preferences/junkLog.xul
-    content/messenger/preferences/junkLog.js
 *   content/messenger/preferences/advanced.js
 *   content/messenger/preferences/advanced.xul
 *   content/messenger/preferences/receipts.xul
     content/messenger/preferences/connection.js
     content/messenger/preferences/connection.xul
 *   content/messenger/preferences/downloads.js
     content/messenger/preferences/attachmentReminder.js
     content/messenger/preferences/attachmentReminder.xul
deleted file mode 100644
--- a/mail/components/preferences/junkLog.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * 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/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var gLogView;
-var gLogFile;
-
-function onLoad()
-{
-  gLogView = document.getElementById("logView");
-  gLogView.docShell.allowJavascript = false; // for security, disable JS
-
-  gLogFile = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile);
-  gLogFile.append("junklog.html");
-
-  if (gLogFile.exists())
-  {
-    // convert the file to a URL so we can load it.
-    gLogView.setAttribute("src", Services.io.newFileURI(gLogFile).spec);
-  }
-}
-
-function clearLog()
-{
-  if (gLogFile.exists())
-  {
-    gLogFile.remove(false);
-    gLogView.setAttribute("src", "about:blank"); // we don't have a log file to show
-  }
-}
deleted file mode 100644
--- a/mail/components/preferences/junkLog.xul
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- -*- Mode: Java; tab-width: 2; 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/. -->
-
-<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/preferences/junkLog.dtd">
-
-<dialog id="viewLogWindow"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="onLoad();"
-        title="&adaptiveJunkLog.title;"
-        windowtype="mailnews:junklog"
-        buttons="accept"
-        buttonlabelaccept="&closeLog.label;"
-        buttonaccesskeyaccept="&closeLog.accesskey;"
-        ondialogaccept="window.close()"
-        persist="screenX screenY width height"
-        style="width: 40em; height: 25em;">
-
-  <script type="application/javascript" src="chrome://messenger/content/preferences/junkLog.js"/>
-
-  <vbox flex="1">
-    <hbox>
-      <label value="&adaptiveJunkLogInfo.label;"/>
-      <spacer flex="1"/>
-      <button label="&clearLog.label;" accesskey="&clearLog.accesskey;" oncommand="clearLog()"/>
-    </hbox>
-    <vbox flex="1">
-      <spacer height="10px"/>
-      <hbox flex="1">
-        <spacer width="10px"/>
-        <browser id="logView" disablehistory="true" disablesecurity="true"
-                 src="about:blank" autofind="false" flex="1"/>
-        <spacer width="10px"/>
-      </hbox>
-      <spacer height="10px"/>
-    </vbox>
-  </vbox>
-</dialog>
--- a/mail/components/preferences/security.js
+++ b/mail/components/preferences/security.js
@@ -39,17 +39,18 @@ var gSecurityPane = {
 
   updateJunkLogButton: function(aEnableButton)
   {
     document.getElementById('openJunkLogButton').disabled = !aEnableButton;
   },
 
   openJunkLog: function()
   {
-    document.documentElement.openWindow("mailnews:junklog", "chrome://messenger/content/preferences/junkLog.xul",
+    document.documentElement.openWindow("mailnews:junklog",
+                                        "chrome://messenger/content/junkLog.xul",
                                         "", null);
   },
 
   resetTrainingData: function()
   {
     // make sure the user really wants to do this
     var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                           .getService(Components.interfaces.nsIPromptService);
rename from mail/locales/en-US/chrome/messenger/preferences/junkLog.dtd
rename to mail/locales/en-US/chrome/messenger/junkLog.dtd
--- a/mail/locales/jar.mn
+++ b/mail/locales/jar.mn
@@ -107,16 +107,17 @@
   locale/@AB_CD@/messenger/gloda.properties                             (%chrome/messenger/gloda.properties)
   locale/@AB_CD@/messenger/glodaComplete.properties                     (%chrome/messenger/glodaComplete.properties)
   locale/@AB_CD@/messenger/templateUtils.properties                     (%chrome/messenger/templateUtils.properties)
   locale/@AB_CD@/messenger/glodaFacetView.properties                    (%chrome/messenger/glodaFacetView.properties)
   locale/@AB_CD@/messenger/glodaFacetView.dtd                           (%chrome/messenger/glodaFacetView.dtd)
   locale/@AB_CD@/messenger/quickFilterBar.dtd                           (%chrome/messenger/quickFilterBar.dtd)
   locale/@AB_CD@/messenger/safeMode.dtd                                 (%chrome/messenger/safeMode.dtd)
   locale/@AB_CD@/messenger/taskbar.properties                           (%chrome/messenger/taskbar.properties)
+  locale/@AB_CD@/messenger/junkLog.dtd                                  (%chrome/messenger/junkLog.dtd)
   locale/@AB_CD@/messenger/addressbook/abMainWindow.dtd                 (%chrome/messenger/addressbook/abMainWindow.dtd)
   locale/@AB_CD@/messenger/addressbook/abNewCardDialog.dtd              (%chrome/messenger/addressbook/abNewCardDialog.dtd)
   locale/@AB_CD@/messenger/addressbook/abContactsPanel.dtd              (%chrome/messenger/addressbook/abContactsPanel.dtd)
   locale/@AB_CD@/messenger/addressbook/abAddressBookNameDialog.dtd      (%chrome/messenger/addressbook/abAddressBookNameDialog.dtd)
   locale/@AB_CD@/messenger/addressbook/abCardOverlay.dtd                (%chrome/messenger/addressbook/abCardOverlay.dtd)
   locale/@AB_CD@/messenger/addressbook/abResultsPaneOverlay.dtd         (%chrome/messenger/addressbook/abResultsPaneOverlay.dtd)
   locale/@AB_CD@/messenger/addressbook/abMailListDialog.dtd             (%chrome/messenger/addressbook/abMailListDialog.dtd)
   locale/@AB_CD@/messenger/addressbook/addressBook.properties           (%chrome/messenger/addressbook/addressBook.properties)
@@ -140,17 +141,16 @@
   locale/@AB_CD@/messenger/messengercompose/mailComposeEditorOverlay.dtd (%chrome/messenger/messengercompose/mailComposeEditorOverlay.dtd)
   locale/@AB_CD@/messenger/preferences/preferences.dtd                  (%chrome/messenger/preferences/preferences.dtd)
   locale/@AB_CD@/messenger/preferences/general.dtd                      (%chrome/messenger/preferences/general.dtd)
   locale/@AB_CD@/messenger/preferences/display.dtd                      (%chrome/messenger/preferences/display.dtd)
   locale/@AB_CD@/messenger/preferences/chat.dtd                         (%chrome/messenger/preferences/chat.dtd)
   locale/@AB_CD@/messenger/preferences/compose.dtd                      (%chrome/messenger/preferences/compose.dtd)
   locale/@AB_CD@/messenger/preferences/sendoptions.dtd                  (%chrome/messenger/preferences/sendoptions.dtd)
   locale/@AB_CD@/messenger/preferences/security.dtd                     (%chrome/messenger/preferences/security.dtd)
-  locale/@AB_CD@/messenger/preferences/junkLog.dtd                      (%chrome/messenger/preferences/junkLog.dtd)
   locale/@AB_CD@/messenger/preferences/advanced.dtd                     (%chrome/messenger/preferences/advanced.dtd)
   locale/@AB_CD@/messenger/preferences/attachmentReminder.dtd           (%chrome/messenger/preferences/attachmentReminder.dtd)
   locale/@AB_CD@/messenger/preferences/receipts.dtd                     (%chrome/messenger/preferences/receipts.dtd)
   locale/@AB_CD@/messenger/preferences/connection.dtd                   (%chrome/messenger/preferences/connection.dtd)
   locale/@AB_CD@/messenger/preferences/applications.dtd                 (%chrome/messenger/preferences/applications.dtd)
   locale/@AB_CD@/messenger/preferences/applications.properties          (%chrome/messenger/preferences/applications.properties)
   locale/@AB_CD@/messenger/preferences/applicationManager.dtd           (%chrome/messenger/preferences/applicationManager.dtd)
   locale/@AB_CD@/messenger/preferences/applicationManager.properties    (%chrome/messenger/preferences/applicationManager.properties)
--- a/mailnews/base/content/junkLog.js
+++ b/mailnews/base/content/junkLog.js
@@ -1,9 +1,10 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * 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/. */
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 var gLogView;
 var gLogFile;
 
--- a/mailnews/base/content/junkLog.xul
+++ b/mailnews/base/content/junkLog.xul
@@ -1,41 +1,49 @@
 <?xml version="1.0"?>
 
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
+<!-- -*- Mode: Java; tab-width: 2; 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/. -->
 
 <?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://messenger/locale/junkLog.dtd">
 
 <dialog id="viewLogWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="onLoad();"
-        title="&junkLog.title;"
+        title="&adaptiveJunkLog.title;"
         windowtype="mailnews:junklog"
         buttons="accept"
         buttonlabelaccept="&closeLog.label;"
         buttonaccesskeyaccept="&closeLog.accesskey;"
-        ondialogaccept="window.close()"
+        ondialogaccept="window.close();"
         persist="screenX screenY width height"
         style="width: 40em; height: 25em;">
 
   <script type="application/javascript" src="chrome://messenger/content/junkLog.js"/>
 
   <vbox flex="1">
     <hbox>
-      <label value="&junkLogInfo.label;"/>
+      <label value="&adaptiveJunkLogInfo.label;"/>
       <spacer flex="1"/>
-      <button label="&clearLog.label;" accesskey="&clearLog.accesskey;" oncommand="clearLog()"/>
+      <button label="&clearLog.label;"
+              accesskey="&clearLog.accesskey;"
+              oncommand="clearLog();"/>
     </hbox>
     <vbox flex="1">
       <spacer height="10px"/>
       <hbox flex="1">
         <spacer width="10px"/>
-        <browser id="logView" disablehistory="true" disablesecurity="true" src="about:blank" autofind="false" flex="1"/>
+        <browser id="logView"
+                 disablehistory="true"
+                 disablesecurity="true"
+                 src="about:blank"
+                 autofind="false"
+                 flex="1"/>
         <spacer width="10px"/>
       </hbox>
       <spacer height="10px"/>
     </vbox>
   </vbox>
 </dialog>
--- a/suite/locales/en-US/chrome/mailnews/junkLog.dtd
+++ b/suite/locales/en-US/chrome/mailnews/junkLog.dtd
@@ -1,10 +1,10 @@
 <!-- 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 junkLog.title "Junk Mail Log">
-<!ENTITY junkLogInfo.label "Log of junk mail control activity.">
+<!ENTITY adaptiveJunkLog.title "Adaptive Junk Mail Log">
+<!ENTITY adaptiveJunkLogInfo.label "Log of adaptive junk mail control activity.">
 <!ENTITY clearLog.label "Clear Log">
 <!ENTITY clearLog.accesskey "C">
 <!ENTITY closeLog.label "Close">
 <!ENTITY closeLog.accesskey "o">