Bug 948882 - Move inline scripts and styles into separate file for toolkit/crashreporter/content/crashes.xhtml (about:crashes). r=freddyb,gijs
authortiago <tiago.paez11@gmail.com>
Wed, 17 May 2017 05:03:49 -0300
changeset 479710 75df8c6facf7eda425d18b8053dc4c2eb9ed3ec7
parent 479709 95b1c86a8b55c8ef5b3c955a3ab592e3c658f3fa
child 479711 010e2e111043912594c52f7c268f746818e0f99f
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfreddyb, gijs
bugs948882
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 948882 - Move inline scripts and styles into separate file for toolkit/crashreporter/content/crashes.xhtml (about:crashes). r=freddyb,gijs MozReview-Commit-ID: AdM1JIOaRIx
toolkit/crashreporter/content/crashes.css
toolkit/crashreporter/content/crashes.js
toolkit/crashreporter/content/crashes.xhtml
toolkit/crashreporter/jar.mn
new file mode 100644
--- /dev/null
+++ b/toolkit/crashreporter/content/crashes.css
@@ -0,0 +1,69 @@
+/* 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/. */
+
+:root {
+  font-family: sans-serif;
+  margin: 40px auto;
+  min-width: 30em;
+  max-width: 60em;
+}
+table {
+  clear: both;
+  width: 90%;
+  margin: 0 auto;
+  padding-bottom: 2em;
+}
+th {
+  font-size: 130%;
+  text-align: left;
+  white-space: nowrap;
+}
+th[chromedir="rtl"] {
+  text-align: right;
+}
+/* name */
+th:first-child {
+  padding-inline-end: 2em;
+}
+/* submitted */
+th:last-child {
+  text-align: center;
+}
+:link, :visited {
+  display: block;
+  min-height: 17px;
+}
+/* date */
+td:first-child + td {
+  width: 0;
+  padding-inline-start: 1em;
+  padding-inline-end: .5em;
+  white-space: nowrap;
+}
+/* time */
+td:last-child {
+  width: 0;
+  padding-inline-start: .5em;
+  white-space: nowrap;
+}
+
+#clear-reports {
+  float: right;
+}
+#clear-reports[chromedir="rtl"] {
+  float: left;
+}
+
+.submitting {
+  background-image: url(chrome://global/skin/icons/loading.png);
+  background-repeat: no-repeat;
+  background-position: right;
+  background-size: 16px;
+}
+
+@media (min-resolution: 1.1dppx) {
+  .submitting {
+    background-image: url(chrome://global/skin/icons/loading@2x.png);
+  }
+}
--- a/toolkit/crashreporter/content/crashes.js
+++ b/toolkit/crashreporter/content/crashes.js
@@ -7,16 +7,23 @@ var reportURL;
 ChromeUtils.import("resource://gre/modules/CrashReports.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 ChromeUtils.defineModuleGetter(this, "CrashSubmit",
   "resource://gre/modules/CrashSubmit.jsm");
 
+document.addEventListener("DOMContentLoaded", function() {
+  populateReportList();
+  document.getElementById("clear-reports").addEventListener("click", function() {
+    clearReports().then(null, Cu.reportError);
+  });
+});
+
 const buildID = Services.appinfo.appBuildID;
 
 function submitPendingReport(event) {
   let link = event.target;
   let id = link.firstChild.textContent;
   link.className = "submitting";
   CrashSubmit.submit(id, { noThrottle: true }).then(
     (remoteCrashID) => {
--- a/toolkit/crashreporter/content/crashes.xhtml
+++ b/toolkit/crashreporter/content/crashes.xhtml
@@ -9,91 +9,24 @@
   <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
   <!ENTITY % crashesDTD SYSTEM "chrome://global/locale/crashes.dtd">
   %globalDTD;
   %crashesDTD;
 ]>
 
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<style type="text/css">
-:root {
-  font-family: sans-serif;
-  margin: 40px auto;
-  min-width: 30em;
-  max-width: 60em;
-}
-table {
-  clear: both;
-  width: 90%;
-  margin: 0 auto;
-  padding-bottom: 2em;
-}
-th {
-  font-size: 130%;
-  text-align: left;
-  white-space: nowrap;
-}
-th[chromedir="rtl"] {
-  text-align: right;
-}
-/* name */
-th:first-child {
-  padding-inline-end: 2em;
-}
-/* submitted */
-th:last-child {
-  text-align: center;
-}
-:link, :visited {
-  display: block;
-  min-height: 17px;
-}
-/* date */
-td:first-child + td {
-  width: 0;
-  padding-inline-start: 1em;
-  padding-inline-end: .5em;
-  white-space: nowrap;
-}
-/* time */
-td:last-child {
-  width: 0;
-  padding-inline-start: .5em;
-  white-space: nowrap;
-}
-
-#clear-reports {
-  float: right;
-}
-#clear-reports[chromedir="rtl"] {
-  float: left;
-}
-
-.submitting {
-  background-image: url(chrome://global/skin/icons/loading.png);
-  background-repeat: no-repeat;
-  background-position: right;
-  background-size: 16px;
-}
-
-@media (min-resolution: 1.1dppx) {
-  .submitting {
-    background-image: url(chrome://global/skin/icons/loading@2x.png);
-  }
-}
-</style>
+<link rel="stylesheet" type="text/css" href="chrome://global/content/crashes.css"/>
 <link rel="stylesheet" media="screen, projection" type="text/css"
       href="chrome://global/skin/in-content/common.css"/>
 <script type="application/javascript" src="chrome://global/content/crashes.js"/>
 
 <title>&crashReports.title;</title>
-</head><body onload="populateReportList()" dir="&locale.dir;">
-<button chromedir="&locale.dir;" id="clear-reports"
-        onclick="clearReports().then(null, Cu.reportError)">&clearAllReports.label;</button>
+</head><body dir="&locale.dir;">
+<button chromedir="&locale.dir;" id="clear-reports">&clearAllReports.label;</button>
 <div id="reportList">
   <div id="reportListUnsubmitted">
     <h1>&crashesUnsubmitted.label;</h1>
     <table>
       <thead>
         <tr>
           <th chromedir="&locale.dir;">&id.heading;</th>
           <th chromedir="&locale.dir;" colspan="2">&dateCrashed.heading;</th>
--- a/toolkit/crashreporter/jar.mn
+++ b/toolkit/crashreporter/jar.mn
@@ -1,9 +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/.
 
 toolkit.jar:
 #ifdef MOZ_CRASHREPORTER
   content/global/crashes.xhtml            (content/crashes.xhtml)
   content/global/crashes.js               (content/crashes.js)
+  content/global/crashes.css              (content/crashes.css)
 #endif