Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Adds event listeners and populates on-load-div. | |
| 6 window.onload = function() { | |
| 7 updateOnLoadText('OnLoadText'); | |
| 8 }; | |
| 9 | |
| 10 var updateOnLoadText = function(text) { | |
| 11 document.getElementById('on-load-div').innerHTML = text; | |
| 12 } | |
| 13 | |
| 14 var updateURLToLoadText = function(text) { | |
|
Eugene But (OOO till 7-30)
2016/12/16 03:38:11
nit: s/URL/Url per JS Style Guide
kkhorimoto
2016/12/20 23:23:45
Done.
| |
| 15 document.getElementById('url-to-load').innerHTML = text; | |
| 16 } | |
| 17 | |
| 18 // Returns a DOMString representing the URL used as the innerHTML of the | |
| 19 // url-to-load div. | |
| 20 var getURL = function() { | |
|
Eugene But (OOO till 7-30)
2016/12/16 03:38:11
ditto
kkhorimoto
2016/12/20 23:23:45
Done.
| |
| 21 return document.getElementById('url-to-load').innerHTML; | |
| 22 } | |
| 23 | |
| 24 var locationAssign = function() { | |
| 25 updateOnLoadText(''); | |
| 26 window.location.assign(getURL()); | |
| 27 } | |
| 28 | |
| 29 var locationReplace = function() { | |
| 30 updateOnLoadText(''); | |
| 31 window.location.replace(getURL()); | |
| 32 } | |
| 33 | |
| 34 var locationReload = function() { | |
| 35 updateOnLoadText(''); | |
| 36 window.location.reload(); | |
| 37 } | |
| 38 | |
| 39 var setLocationToDOMString = function() { | |
| 40 updateOnLoadText(''); | |
| 41 window.location = getURL(); | |
| 42 } | |
| 43 | |
| OLD | NEW |