OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 function toggleHelpBox() { | 5 function toggleHelpBox() { |
6 var helpBoxOuter = document.getElementById('details'); | 6 var helpBoxOuter = document.getElementById('details'); |
7 helpBoxOuter.classList.toggle('hidden'); | 7 helpBoxOuter.classList.toggle('hidden'); |
8 var detailsButton = document.getElementById('details-button'); | 8 var detailsButton = document.getElementById('details-button'); |
9 if (helpBoxOuter.classList.contains('hidden')) | 9 if (helpBoxOuter.classList.contains('hidden')) |
10 detailsButton.innerText = detailsButton.detailsText; | 10 detailsButton.innerText = detailsButton.detailsText; |
11 else | 11 else |
12 detailsButton.innerText = detailsButton.hideDetailsText; | 12 detailsButton.innerText = detailsButton.hideDetailsText; |
13 | 13 |
14 // Details appears over the main content on small screens. | 14 // Details appears over the main content on small screens. |
15 if (mobileNav) | 15 if (mobileNav) { |
16 document.getElementById('main-content').classList.toggle('hidden'); | 16 document.getElementById('main-content').classList.toggle('hidden'); |
| 17 var runnerContainer = document.querySelector('.runner-container'); |
| 18 if (runnerContainer) { |
| 19 runnerContainer.classList.toggle('hidden'); |
| 20 } |
| 21 } |
17 } | 22 } |
18 | 23 |
19 function diagnoseErrors() { | 24 function diagnoseErrors() { |
20 var extensionId = 'idddmepepmjcgiedknnmlbadcokidhoa'; | 25 var extensionId = 'idddmepepmjcgiedknnmlbadcokidhoa'; |
21 var diagnoseFrame = document.getElementById('diagnose-frame'); | 26 var diagnoseFrame = document.getElementById('diagnose-frame'); |
22 diagnoseFrame.innerHTML = | 27 diagnoseFrame.innerHTML = |
23 '<iframe src="chrome-extension://' + extensionId + | 28 '<iframe src="chrome-extension://' + extensionId + |
24 '/index.html"></iframe>'; | 29 '/index.html"></iframe>'; |
25 } | 30 } |
26 | 31 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (reloadButton.style.display == 'none' && | 140 if (reloadButton.style.display == 'none' && |
136 staleLoadButton.style.display == 'none') { | 141 staleLoadButton.style.display == 'none') { |
137 detailsButton.classList.add('singular'); | 142 detailsButton.classList.add('singular'); |
138 } | 143 } |
139 | 144 |
140 <if expr="not chromeos"> | 145 <if expr="not chromeos"> |
141 // Hide the details button if there are no details to show. | 146 // Hide the details button if there are no details to show. |
142 if (loadTimeData.valueExists('summary') && | 147 if (loadTimeData.valueExists('summary') && |
143 !loadTimeData.getValue('summary').msg) { | 148 !loadTimeData.getValue('summary').msg) { |
144 detailsButton.style.display = 'none'; | 149 detailsButton.style.display = 'none'; |
145 document.getElementById('details').style.display = 'block'; | |
146 } | 150 } |
147 </if> | 151 </if> |
148 | 152 |
149 // Show control buttons. | 153 // Show control buttons. |
150 if (loadTimeData.valueExists('reloadButton') && | 154 if (loadTimeData.valueExists('reloadButton') && |
151 loadTimeData.getValue('reloadButton').msg || | 155 loadTimeData.getValue('reloadButton').msg || |
152 loadTimeData.valueExists('staleLoadButton') && | 156 loadTimeData.valueExists('staleLoadButton') && |
153 loadTimeData.getValue('staleLoadButton').msg) { | 157 loadTimeData.getValue('staleLoadButton').msg) { |
154 controlButtonDiv.hidden = false; | 158 controlButtonDiv.hidden = false; |
155 | 159 |
156 // Set the secondary button state in the cases of two call to actions. | 160 // Set the secondary button state in the cases of two call to actions. |
157 // Reload is secondary to stale load. | 161 // Reload is secondary to stale load. |
158 if (loadTimeData.valueExists('staleLoadButton') && | 162 if (loadTimeData.valueExists('staleLoadButton') && |
159 loadTimeData.getValue('staleLoadButton').msg) { | 163 loadTimeData.getValue('staleLoadButton').msg) { |
160 reloadButton.classList.add('secondary-button'); | 164 reloadButton.classList.add('secondary-button'); |
161 } | 165 } |
162 } | 166 } |
163 | 167 |
164 // Add a main message paragraph. | 168 // Add a main message paragraph. |
165 if (loadTimeData.valueExists('primaryParagraph')) { | 169 if (loadTimeData.valueExists('primaryParagraph')) { |
166 var p = document.querySelector('#main-message p'); | 170 var p = document.querySelector('#main-message p'); |
167 p.innerHTML = loadTimeData.getString('primaryParagraph'); | 171 p.innerHTML = loadTimeData.getString('primaryParagraph'); |
168 p.hidden = false; | 172 p.hidden = false; |
169 } | 173 } |
170 } | 174 } |
171 | 175 |
172 document.addEventListener('DOMContentLoaded', onDocumentLoad); | 176 document.addEventListener('DOMContentLoaded', onDocumentLoad); |
OLD | NEW |