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 * @fileoverview | 6 * @fileoverview |
7 * Simple utility functions for Chromoting. | 7 * Simple utility functions for Chromoting. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 20 matching lines...) Expand all Loading... |
31 /** | 31 /** |
32 * @param {Element} element The element from which to remove the class. | 32 * @param {Element} element The element from which to remove the class. |
33 * @param {string} cls The new class. | 33 * @param {string} cls The new class. |
34 * @return {void} Nothing. | 34 * @return {void} Nothing. |
35 */ | 35 */ |
36 function removeClass(element, cls) { | 36 function removeClass(element, cls) { |
37 element.className = | 37 element.className = |
38 element.className.replace(new RegExp('\\b' + cls + '\\b', 'g'), '') | 38 element.className.replace(new RegExp('\\b' + cls + '\\b', 'g'), '') |
39 .replace(' ', ' '); | 39 .replace(' ', ' '); |
40 } | 40 } |
| 41 |
| 42 /** |
| 43 * @return {Object.<string, string>} The URL parameters. |
| 44 */ |
| 45 function getUrlParameters() { |
| 46 var result = {}; |
| 47 var parts = window.location.search.substring(1).split('&'); |
| 48 for (var i = 0; i < parts.length; i++) { |
| 49 var pair = parts[i].split('='); |
| 50 result[pair[0]] = decodeURIComponent(pair[1]); |
| 51 } |
| 52 return result; |
| 53 } |
OLD | NEW |