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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 e.button, | 180 e.button, |
181 e.altKey, | 181 e.altKey, |
182 e.ctrlKey, | 182 e.ctrlKey, |
183 e.metaKey, | 183 e.metaKey, |
184 e.shiftKey | 184 e.shiftKey |
185 ]); | 185 ]); |
186 e.preventDefault(); | 186 e.preventDefault(); |
187 } | 187 } |
188 } | 188 } |
189 }); | 189 }); |
| 190 |
| 191 /** |
| 192 * Creates a new URL which is the old URL with a GET param of key=value. |
| 193 * @param {string} url The base URL. There is not sanity checking on the URL so |
| 194 * it must be passed in a proper format. |
| 195 * @param {string} key The key of the param. |
| 196 * @param {string} value The value of the param. |
| 197 * @return {string} |
| 198 */ |
| 199 function appendParam(url, key, value) { |
| 200 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value); |
| 201 |
| 202 if (url.indexOf('?') == -1) |
| 203 return url + '?' + param; |
| 204 return url + '&' + param; |
| 205 } |
OLD | NEW |