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

Side by Side Diff: remoting/webapp/util.js

Issue 9610003: Use classList in host_table_entry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « remoting/webapp/remoting.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 /**
6 * @fileoverview
7 * Simple utility functions for Chromoting.
8 */
9
10 /**
11 * TODO(garykac): Remove this once host_list.js and host_table_entry.js have
12 * been updated to use classList directly.
13 *
14 * @param {Element} element The element to which to add the class.
15 * @param {string} cls The new class.
16 * @return {void} Nothing.
17 */
18 function addClass(element, cls) {
19 var helem = /** @type {HTMLElement} */ element;
20 helem.classList.add(cls);
21 }
22
23 /**
24 * TODO(garykac): Remove this once host_list.js and host_table_entry.js have
25 * been updated to use classList directly.
26 *
27 * @param {Element} element The element from which to remove the class.
28 * @param {string} cls The new class.
29 * @return {void} Nothing.
30 */
31 function removeClass(element, cls) {
32 var helem = /** @type {HTMLElement} */ element;
33 helem.classList.remove(cls);
34 }
35
36 /**
37 * @return {Object.<string, string>} The URL parameters.
38 */
39 function getUrlParameters() {
40 var result = {};
41 var parts = window.location.search.substring(1).split('&');
42 for (var i = 0; i < parts.length; i++) {
43 var pair = parts[i].split('=');
44 result[pair[0]] = decodeURIComponent(pair[1]);
45 }
46 return result;
47 }
48
49 // This function can be called from the Javascript console to show all the UI,
50 // for example prior to auditing the CSS. It is not useful otherwise.
51 function unhideAll() {
52 var hidden = document.querySelectorAll('[hidden]');
53 for (var i in hidden) {
54 hidden[i].hidden = false;
55 }
56 }
OLDNEW
« no previous file with comments | « remoting/webapp/remoting.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698