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

Side by Side Diff: chrome/renderer/resources/neterror.js

Issue 207553008: Surface button for loading stale cache copy on net error page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrect spelling of iOS. Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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('help-box-outer'); 6 var helpBoxOuter = document.getElementById('help-box-outer');
7 helpBoxOuter.classList.toggle('hidden'); 7 helpBoxOuter.classList.toggle('hidden');
8 var moreLessButton = document.getElementById('more-less-button'); 8 var moreLessButton = document.getElementById('more-less-button');
9 if (helpBoxOuter.classList.contains('hidden')) { 9 if (helpBoxOuter.classList.contains('hidden')) {
10 moreLessButton.innerText = moreLessButton.moreText; 10 moreLessButton.innerText = moreLessButton.moreText;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 classList['last_icon_class'] = newClass; 53 classList['last_icon_class'] = newClass;
54 } 54 }
55 55
56 // Does a search using |baseSearchUrl| and the text in the search box. 56 // Does a search using |baseSearchUrl| and the text in the search box.
57 function search(baseSearchUrl) { 57 function search(baseSearchUrl) {
58 var searchTextNode = document.getElementById('search-box'); 58 var searchTextNode = document.getElementById('search-box');
59 document.location = baseSearchUrl + searchTextNode.value; 59 document.location = baseSearchUrl + searchTextNode.value;
60 return false; 60 return false;
61 } 61 }
62 62
63 // Implements button clicks. This function is needed during the transition
64 // between implementing these in trunk chromium and implementing them in
65 // iOS.
66 function reloadButtonClick(url) {
67 if (window.errorPageController) {
68 errorPageController.reloadButtonClick();
69 } else {
70 location = url;
71 }
72 }
73
74 function loadStaleButtonClick() {
75 if (window.errorPageController) {
76 errorPageController.loadStaleButtonClick();
77 }
jar (doing other things) 2014/04/21 23:48:19 nit: No need for curlies (per style used in this f
Randy Smith (Not in Mondays) 2014/04/22 20:40:02 Done.
78 }
79
80 function moreButtonClick() {
81 if (window.errorPageController) {
82 errorPageController.moreButtonClick();
83 }
84 }
85
63 <if expr="is_macosx or is_ios or is_linux or is_android"> 86 <if expr="is_macosx or is_ios or is_linux or is_android">
64 // Re-orders buttons. Used on Mac, Linux, and Android, where reload should go 87 // Re-orders buttons. Used on Mac, Linux, and Android, where reload should go
65 // on the right. 88 // on the right.
66 function swapButtonOrder() { 89 function swapButtonOrder() {
67 reloadButton = document.getElementById('reload-button'); 90 var reloadButton = document.getElementById('reload-button');
68 moreLessButton = document.getElementById('more-less-button'); 91 var moreLessButton = document.getElementById('more-less-button');
92 var staleLoadButton = document.getElementById('stale-load-button');
69 reloadButton.parentNode.insertBefore(moreLessButton, reloadButton); 93 reloadButton.parentNode.insertBefore(moreLessButton, reloadButton);
94 reloadButton.parentNode.insertBefore(staleLoadButton, reloadButton)
70 } 95 }
71 document.addEventListener("DOMContentLoaded", swapButtonOrder); 96 document.addEventListener("DOMContentLoaded", swapButtonOrder);
72 </if> 97 </if>
OLDNEW
« chrome/renderer/net/net_error_page_controller.cc ('K') | « chrome/renderer/resources/neterror.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698