| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** | 5 /** |
| 6 * The global object. | 6 * The global object. |
| 7 * @type {!Object} | 7 * @type {!Object} |
| 8 */ | 8 */ |
| 9 const global = this; | 9 const global = this; |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 e.button, | 142 e.button, |
| 143 e.altKey, | 143 e.altKey, |
| 144 e.ctrlKey, | 144 e.ctrlKey, |
| 145 e.metaKey, | 145 e.metaKey, |
| 146 e.shiftKey | 146 e.shiftKey |
| 147 ]); | 147 ]); |
| 148 e.preventDefault(); | 148 e.preventDefault(); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 }); | 151 }); |
| 152 |
| 153 /** |
| 154 * Creates a new URL which is the old URL with a GET param of key=value. |
| 155 * @param {string} url The base URL. There is not sanity checking on the URL so |
| 156 * it must be passed in a proper format. |
| 157 * @param {string} key The key of the param. |
| 158 * @param {string} value The value of the param. |
| 159 * @return {string} |
| 160 */ |
| 161 function appendParam(url, key, value) { |
| 162 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value); |
| 163 |
| 164 if (url.indexOf('?') == -1) |
| 165 return url + '?' + param; |
| 166 return url + '&' + param; |
| 167 } |
| OLD | NEW |