Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6643)

Unified Diff: chrome/renderer/resources/neterror.js

Issue 599653003: Remove old template html boilerplate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bydefault
Patch Set: fix android Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/resources/neterror.html ('k') | components/dom_distiller/webui/dom_distiller_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/neterror.js
diff --git a/chrome/renderer/resources/neterror.js b/chrome/renderer/resources/neterror.js
index ae34582c6a3aa601c0de29281b85702aba903020..f49facd6b0dead447d04f591da49b5696202efab 100644
--- a/chrome/renderer/resources/neterror.js
+++ b/chrome/renderer/resources/neterror.js
@@ -29,7 +29,6 @@ if (window.top.location != window.location)
// Re-renders the error page using |strings| as the dictionary of values.
// Used by NetErrorTabHelper to update DNS error pages with probe results.
function updateForDnsProbe(strings) {
- i18nTemplate.process(document, strings);
var context = new JsEvalContext(strings);
jstProcess(context, document.getElementById('t'));
}
@@ -108,8 +107,7 @@ var primaryControlOnLeft = true;
primaryControlOnLeft = false;
</if>
-// Sets up the proper button layout for the current platform.
-function setButtonLayout() {
+function onDocumentLoad() {
var buttonsDiv = document.getElementById('buttons');
var controlButtonDiv = document.getElementById('control-buttons');
var reloadButton = document.getElementById('reload-button');
@@ -119,6 +117,7 @@ function setButtonLayout() {
var primaryButton = reloadButton;
var secondaryButton = staleLoadButton;
+ // Sets up the proper button layout for the current platform.
if (primaryControlOnLeft) {
buttons.classList.add('suggested-left');
controlButtonDiv.insertBefore(primaryButton, secondaryButton);
@@ -132,19 +131,27 @@ function setButtonLayout() {
detailsButton.classList.add('singular');
}
- if (templateData) {
- // Hide the details button if there are no details to show.
- if (templateData.summary && !templateData.summary.msg) {
- detailsButton.hidden = true;
- document.getElementById('help-box-outer').style.display = 'block';
- }
-
- // Show control buttons.
- if (templateData.reloadButton && templateData.reloadButton.msg ||
- templateData.staleLoadButton && templateData.staleLoadButton.msg) {
- controlButtonDiv.hidden = false;
- }
+ // Hide the details button if there are no details to show.
+ if (loadTimeData.valueExists('summary') &&
+ !loadTimeData.getValue('summary').msg) {
+ detailsButton.hidden = true;
+ document.getElementById('help-box-outer').style.display = 'block';
+ }
+
+ // Show control buttons.
+ if (loadTimeData.valueExists('reloadButton') &&
+ loadTimeData.getValue('reloadButton').msg ||
+ loadTimeData.valueExists('staleLoadButton') &&
+ loadTimeData.getValue('staleLoadButton').msg) {
+ controlButtonDiv.hidden = false;
+ }
+
+ // Add a main message paragraph.
+ if (loadTimeData.valueExists('primaryParagraph')) {
+ var p = document.querySelector('#main-message p');
+ p.textContent = loadTimeData.getString('primaryParagraph');
+ p.hidden = false;
}
}
-document.addEventListener('DOMContentLoaded', setButtonLayout);
+document.addEventListener('DOMContentLoaded', onDocumentLoad);
« no previous file with comments | « chrome/renderer/resources/neterror.html ('k') | components/dom_distiller/webui/dom_distiller_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698