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

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

Issue 422933002: Shift the error page "More" button over to text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'c to r287451 to get past removal of chrome/browser/resources/ssl/blocking.html and thus the pr… Created 6 years, 4 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') | no next file » | 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 b518a87c935abf9c682d56bd2900270d8a06d9b3..14117c4804925bbe1dbda8ebf79adc392e7eba92 100644
--- a/chrome/renderer/resources/neterror.js
+++ b/chrome/renderer/resources/neterror.js
@@ -5,19 +5,18 @@
function toggleHelpBox() {
var helpBoxOuter = document.getElementById('help-box-outer');
helpBoxOuter.classList.toggle('hidden');
- var moreLessButton = document.getElementById('more-less-button');
- if (helpBoxOuter.classList.contains('hidden')) {
- moreLessButton.innerText = moreLessButton.moreText;
- } else {
- moreLessButton.innerText = moreLessButton.lessText;
- }
+ var detailsButton = document.getElementById('details-button');
+ if (helpBoxOuter.classList.contains('hidden'))
+ detailsButton.innerText = detailsButton.detailsText;
+ else
+ detailsButton.innerText = detailsButton.hideDetailsText;
}
function diagnoseErrors() {
- var extension_id = "idddmepepmjcgiedknnmlbadcokidhoa";
- var diagnose_frame = document.getElementById('diagnose-frame');
- diagnose_frame.innerHTML =
- '<iframe src="chrome-extension://' + extension_id +
+ var extensionId = 'idddmepepmjcgiedknnmlbadcokidhoa';
+ var diagnoseFrame = document.getElementById('diagnose-frame');
+ diagnoseFrame.innerHTML =
+ '<iframe src="chrome-extension://' + extensionId +
'/index.html"></iframe>';
}
@@ -41,7 +40,7 @@ function updateIconClass(classList, newClass) {
var oldClass;
if (classList.hasOwnProperty('last_icon_class')) {
- oldClass = classList['last_icon_class']
+ oldClass = classList['last_icon_class'];
if (oldClass == newClass)
return;
}
@@ -94,21 +93,38 @@ function loadStaleButtonClick() {
}
}
-function moreButtonClick() {
- if (window.errorPageController) {
- errorPageController.moreButtonClick();
- }
+function detailsButtonClick() {
+ if (window.errorPageController)
+ errorPageController.detailsButtonClick();
}
+var primaryControlOnLeft = true;
<if expr="is_macosx or is_ios or is_linux or is_android">
-// Re-orders buttons. Used on Mac, Linux, and Android, where reload should go
-// on the right.
-function swapButtonOrder() {
+primaryControlOnLeft = false;
+</if>
+
+// Sets up the proper button layout for the current platform.
+function setButtonLayout() {
+ var buttonsDiv = document.getElementById('buttons');
+ var controlButtonDiv = document.getElementById('control-buttons');
var reloadButton = document.getElementById('reload-button');
- var moreLessButton = document.getElementById('more-less-button');
+ var detailsButton = document.getElementById('details-button');
var staleLoadButton = document.getElementById('stale-load-button');
- reloadButton.parentNode.insertBefore(moreLessButton, reloadButton);
- reloadButton.parentNode.insertBefore(staleLoadButton, reloadButton)
+
+ var primaryButton = reloadButton;
+ var secondaryButton = staleLoadButton;
+
+ if (primaryControlOnLeft) {
+ buttons.classList.add('suggested-left');
+ controlButtonDiv.insertBefore(primaryButton, secondaryButton);
+ } else {
+ buttons.classList.add('suggested-right');
+ controlButtonDiv.insertBefore(secondaryButton, primaryButton);
+ }
+
+ if (reloadButton.style.display == 'none' &&
+ staleLoadButton.style.display == 'none') {
+ detailsButton.classList.add('singular');
+ }
}
-document.addEventListener("DOMContentLoaded", swapButtonOrder);
-</if>
+document.addEventListener('DOMContentLoaded', setButtonLayout);
« no previous file with comments | « chrome/renderer/resources/neterror.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698