Bug 1383837 - Remove unused code in about:telemetry r?chutten draft
authorflyingrub <flyinggrub@gmail.com>
Mon, 24 Jul 2017 22:28:01 +0200
changeset 614663 fe755085f1c502c4c00e5d18d21dd9d0e8442e59
parent 614662 5e3d60ba395462f7e4f8cb141cad3610f11bdf7e
child 614664 960e0f42adb7d88908e14dbdd0deafd2c0561cb5
child 615875 08d8f9acf0bf0776503ce1ac2b11c9a484c7c964
child 615881 e3b9172a2a37695c986b4c9f9ea26d04847ebda9
child 617327 c321a4b61a52c8e7ef7d4d4ac9405bb6b7301867
push id70086
push userbmo:flyinggrub@gmail.com
push dateMon, 24 Jul 2017 21:55:28 +0000
reviewerschutten
bugs1383837
milestone56.0a1
Bug 1383837 - Remove unused code in about:telemetry r?chutten Remove the code related to expanding sections since it's not relevant anymore. MozReview-Commit-ID: 3Uav9S2Kj2U
toolkit/content/aboutTelemetry.css
toolkit/content/aboutTelemetry.js
toolkit/content/aboutTelemetry.xhtml
--- a/toolkit/content/aboutTelemetry.css
+++ b/toolkit/content/aboutTelemetry.css
@@ -209,27 +209,16 @@ body {
   font-size: x-large;
   display: inline;
 }
 
 .has-data .section-name {
   cursor: pointer;
 }
 
-.data,
-.subdata {
-  margin: 15px;
-  display: none;
-}
-
-.has-data.expanded .data,
-.has-subdata.expanded .subdata {
-  display: block;
-}
-
 .stack-title {
   font-size: medium;
   font-weight: bold;
   text-decoration: underline;
 }
 
 #histograms, #thread-hang-stats>div {
   overflow: hidden;
@@ -338,55 +327,16 @@ body[dir="rtl"] caption {
 body[dir="rtl"] .copy-node {
   left: 1px;
 }
 
 .histogram:hover .copy-node {
   visibility: visible;
 }
 
-.statebox {
-  display: none;
-}
-
-.filter-ui {
-  padding-inline-start: 10em;
-  display: none;
-}
-
-.has-data.expanded .filter-ui {
-  display: inline;
-}
-
-.processes-ui {
-  display: none;
-}
-
-.has-data.expanded .processes-ui {
-  display: initial;
-}
-
-.filter-blocked {
-  display: none;
-}
-
-#raw-ping-data-section {
-  width: 100%;
-  height: 100%;
-}
-
 #raw-ping-data {
-  margin: 0px;
   font-size: 15px;
 }
 
-#hide-raw-ping {
-  float: right;
-  cursor: pointer;
-  font-size: 20px;
-  background-color:#d8d8d8;
-  padding: 5px 10px;
-}
-
 caption {
   font-size: larger;
   margin: 5px 0;
 }
\ No newline at end of file
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1522,17 +1522,16 @@ var GenericSubsection = {
       dataDiv.appendChild(s);
     }
   },
 
   renderSubsectionHeader(title, hasData, sectionID) {
     this.addSubSectionToSidebar(sectionID, title);
     let section = document.createElement("section");
     section.setAttribute("id", sectionID + "-" + title);
-    section.classList.add("data-subsection", "expanded");
     if (hasData) {
       section.classList.add("has-subdata");
     }
     return section;
   },
 
   renderSubsectionData(title, data) {
     // Create data container
@@ -1815,30 +1814,16 @@ function setHasData(aSectionID, aHasData
   sectionElement.classList[aHasData ? "add" : "remove"]("has-data");
 
   // Display or Hide the section in the sidebar
   let sectionCategory = document.querySelector(".category[value=" + aSectionID + "]");
   sectionCategory.classList[aHasData ? "add" : "remove"]("has-data");
 }
 
 /**
- * Helper function that expands and collapses sections +
- * changes caption on the toggle text
- */
-function toggleSection(aEvent) {
-  let parentElement = aEvent.target.parentElement;
-  if (!parentElement.classList.contains("has-data") &&
-      !parentElement.classList.contains("has-subdata")) {
-    return; // nothing to toggle
-  }
-
-  parentElement.classList.toggle("expanded");
-}
-
-/**
  * Sets the text of the page header based on a config pref + bundle strings
  */
 function setupPageHeader() {
   let serverOwner = Preferences.get(PREF_TELEMETRY_SERVER_OWNER, "Mozilla");
   let brandName = brandBundle.GetStringFromName("brandFullName");
   let subtitleText = bundle.formatStringFromName(
     "pageSubtitle", [serverOwner, brandName], 2);
 
@@ -1900,19 +1885,19 @@ function show(selected) {
 function showSubSection(selected) {
   let current_selection = document.querySelector(".category-subsection.selected");
   if (current_selection)
     current_selection.classList.remove("selected");
   selected.classList.add("selected");
 
   let section = document.getElementById(selected.getAttribute("value"));
   section.parentElement.childNodes.forEach((element) => {
-    element.classList.remove("expanded");
-  }, this);
-  section.classList.add("expanded");
+    element.hidden = true;
+  });
+  section.hidden = false;
 
   let title = selected.parentElement.querySelector(".category-name").textContent;
   document.getElementById("sectionTitle").textContent = title + " - " + selected.textContent;
   document.getSelection().empty(); // prevent subsection text selection
 }
 
 /**
  * Initializes load/unload, pref change and mouse-click listeners
@@ -1999,28 +1984,16 @@ function setupListeners() {
   document.getElementById("late-writes-hide-symbols").addEventListener("click",
     function() {
       if (!gPingData) {
         return;
       }
 
       LateWritesSingleton.renderLateWrites(gPingData.payload.lateWrites);
   });
-
-  // Clicking on the section name will toggle its state
-  let sectionHeaders = document.getElementsByClassName("section-name");
-  for (let sectionHeader of sectionHeaders) {
-    sectionHeader.addEventListener("click", toggleSection);
-  }
-
-  // Clicking on the "toggle" text will also toggle section's state
-  let toggleLinks = document.getElementsByClassName("toggle-caption");
-  for (let toggleLink of toggleLinks) {
-    toggleLink.addEventListener("click", toggleSection);
-  }
 }
 
 function onLoad() {
   window.removeEventListener("load", onLoad);
 
   // Set the text in the page header
   setupPageHeader();
 
--- a/toolkit/content/aboutTelemetry.xhtml
+++ b/toolkit/content/aboutTelemetry.xhtml
@@ -142,105 +142,105 @@
         <p id="home-explanation"></p>
         <p id="ping-explanation"></p>
       </div>
 
       <div id="raw-ping-data-section" class="tab" hidden="true">
         <pre id="raw-ping-data"></pre>
       </div>
 
-      <section id="general-data-section" class="tab data-section expanded" hidden="true">
+      <section id="general-data-section" class="tab data-section" hidden="true">
         <div id="general-data" class="data">
         </div>
       </section>
 
-      <section id="environment-data-section" class="tab data-section expanded" hidden="true">
+      <section id="environment-data-section" class="tab data-section" hidden="true">
         <div id="environment-data" class="data">
         </div>
       </section>
 
-      <section id="session-info-section" class="tab data-section expanded" hidden="true">
+      <section id="session-info-section" class="tab data-section" hidden="true">
         <div id="session-info" class="data">
         </div>
       </section>
 
-      <section id="scalars-section" class="tab data-section expanded" hidden="true">
+      <section id="scalars-section" class="tab data-section" hidden="true">
         <div id="scalars" class="data">
         </div>
       </section>
 
-      <section id="keyed-scalars-section" class="tab data-section expanded" hidden="true">
+      <section id="keyed-scalars-section" class="tab data-section" hidden="true">
         <div id="keyed-scalars" class="data">
         </div>
       </section>
 
-      <section id="histograms-section" class="tab data-section expanded" hidden="true">
+      <section id="histograms-section" class="tab data-section" hidden="true">
         <div id="histograms" class="data">
         </div>
       </section>
 
-      <section id="keyed-histograms-section" class="tab data-section expanded" hidden="true">
+      <section id="keyed-histograms-section" class="tab data-section" hidden="true">
         <div id="keyed-histograms" class="data">
         </div>
       </section>
 
-      <section id="events-section" class="tab data-section expanded" hidden="true">
+      <section id="events-section" class="tab data-section" hidden="true">
         <div id="events" class="data">
         </div>
       </section>
 
-      <section id="simple-measurements-section" class="tab data-section expanded" hidden="true">
+      <section id="simple-measurements-section" class="tab data-section" hidden="true">
         <div id="simple-measurements" class="data">
         </div>
       </section>
 
-      <section id="telemetry-log-section" class="tab data-section expanded" hidden="true">
+      <section id="telemetry-log-section" class="tab data-section" hidden="true">
         <div id="telemetry-log" class="data">
         </div>
       </section>
 
-      <section id="slow-sql-section" class="tab data-section expanded" hidden="true">
+      <section id="slow-sql-section" class="tab data-section" hidden="true">
         <div id="slow-sql-tables" class="data">
           <p id="sql-warning" class="hidden">&aboutTelemetry.fullSqlWarning;</p>
         </div>
       </section>
 
-      <section id="chrome-hangs-section" class="tab data-section expanded" hidden="true">
+      <section id="chrome-hangs-section" class="tab data-section" hidden="true">
         <div id="chrome-hangs" class="data">
           <a id="chrome-hangs-fetch-symbols" href="#">&aboutTelemetry.fetchStackSymbols;</a>
           <a id="chrome-hangs-hide-symbols" class="hidden" href="#">&aboutTelemetry.hideStackSymbols;</a>
           <br/>
           <br/>
           <div id="chrome-hangs-data">
           </div>
         </div>
       </section>
 
-      <section id="thread-hang-stats-section" class="tab data-section expanded" hidden="true">
+      <section id="thread-hang-stats-section" class="tab data-section" hidden="true">
         <div id="thread-hang-stats" class="data">
         </div>
       </section>
 
-      <section id="late-writes-section" class="tab data-section expanded" hidden="true">
+      <section id="late-writes-section" class="tab data-section" hidden="true">
         <div id="late-writes" class="data">
           <a id="late-writes-fetch-symbols" href="#">&aboutTelemetry.fetchStackSymbols;</a>
           <a id="late-writes-hide-symbols" class="hidden" href="#">&aboutTelemetry.hideStackSymbols;</a>
           <br/>
           <br/>
           <div id="late-writes-data">
           </div>
         </div>
       </section>
 
-      <section id="addon-details-section" class="tab data-section expanded" hidden="true">
+      <section id="addon-details-section" class="tab data-section" hidden="true">
         <div id="addon-details" class="data">
         </div>
       </section>
 
-      <section id="captured-stacks-section" class="tab data-section expanded" hidden="true">
+      <section id="captured-stacks-section" class="tab data-section" hidden="true">
         <div id="captured-stacks" class="data">
           <a id="captured-stacks-fetch-symbols" href="#">&aboutTelemetry.fetchStackSymbols;</a>
           <a id="captured-stacks-hide-symbols" class="hidden" href="#">&aboutTelemetry.hideStackSymbols;</a>
           <br/>
           <br/>
           <div id="captured-stacks-data">
           </div>
         </div>