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

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

Issue 9562044: Added connection history (minus the history data) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't instantiate the connection history dialog. 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/main.html ('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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 * Functions related to controlling the modal UI state of the app. UI states 7 * Functions related to controlling the modal UI state of the app. UI states
8 * are expressed as HTML attributes with a dotted hierarchy. For example, the 8 * are expressed as HTML attributes with a dotted hierarchy. For example, the
9 * string 'host.shared' will match any elements with an associated attribute 9 * string 'host.shared' will match any elements with an associated attribute
10 * of 'host' or 'host.shared', showing those elements and hiding all others. 10 * of 'host' or 'host.shared', showing those elements and hiding all others.
(...skipping 18 matching lines...) Expand all
29 HOST_SHARE_FAILED: 'home.host.share-failed', 29 HOST_SHARE_FAILED: 'home.host.share-failed',
30 HOST_SHARE_FINISHED: 'home.host.share-finished', 30 HOST_SHARE_FINISHED: 'home.host.share-finished',
31 CLIENT: 'home.client', 31 CLIENT: 'home.client',
32 CLIENT_UNCONNECTED: 'home.client.unconnected', 32 CLIENT_UNCONNECTED: 'home.client.unconnected',
33 CLIENT_PIN_PROMPT: 'home.client.pin-prompt', 33 CLIENT_PIN_PROMPT: 'home.client.pin-prompt',
34 CLIENT_CONNECTING: 'home.client.connecting', 34 CLIENT_CONNECTING: 'home.client.connecting',
35 CLIENT_CONNECT_FAILED_IT2ME: 'home.client.connect-failed.it2me', 35 CLIENT_CONNECT_FAILED_IT2ME: 'home.client.connect-failed.it2me',
36 CLIENT_CONNECT_FAILED_ME2ME: 'home.client.connect-failed.me2me', 36 CLIENT_CONNECT_FAILED_ME2ME: 'home.client.connect-failed.me2me',
37 CLIENT_SESSION_FINISHED_IT2ME: 'home.client.session-finished.it2me', 37 CLIENT_SESSION_FINISHED_IT2ME: 'home.client.session-finished.it2me',
38 CLIENT_SESSION_FINISHED_ME2ME: 'home.client.session-finished.me2me', 38 CLIENT_SESSION_FINISHED_ME2ME: 'home.client.session-finished.me2me',
39 HISTORY: 'home.history',
39 IN_SESSION: 'in-session' 40 IN_SESSION: 'in-session'
40 }; 41 };
41 42
42 /** 43 /**
43 * Update the DOM by showing or hiding elements based on whether or not they 44 * Update the DOM by showing or hiding elements based on whether or not they
44 * have an attribute matching the specified name. 45 * have an attribute matching the specified name.
45 * @param {string} mode The value against which to match the attribute. 46 * @param {string} mode The value against which to match the attribute.
46 * @param {string} attr The attribute name to match. 47 * @param {string} attr The attribute name to match.
47 * @return {void} Nothing. 48 * @return {void} Nothing.
48 */ 49 */
49 remoting.updateModalUi = function(mode, attr) { 50 remoting.updateModalUi = function(mode, attr) {
50 var modes = mode.split('.'); 51 var modes = mode.split('.');
51 for (var i = 1; i < modes.length; ++i) 52 for (var i = 1; i < modes.length; ++i)
52 modes[i] = modes[i - 1] + '.' + modes[i]; 53 modes[i] = modes[i - 1] + '.' + modes[i];
53 var elements = document.querySelectorAll('[' + attr + ']'); 54 var elements = document.querySelectorAll('[' + attr + ']');
54 for (var i = 0; i < elements.length; ++i) { 55 for (var i = 0; i < elements.length; ++i) {
55 var element = /** @type {Element} */ elements[i]; 56 var element = /** @type {Element} */ elements[i];
56 var hidden = true; 57 var hidden = true;
57 for (var m = 0; m < modes.length; ++m) { 58 for (var m = 0; m < modes.length; ++m) {
58 if (hasClass(element.getAttribute(attr), modes[m])) { 59 if (hasClass(element.getAttribute(attr), modes[m])) {
59 hidden = false; 60 hidden = false;
60 break; 61 break;
61 } 62 }
62 } 63 }
63 element.hidden = hidden; 64 element.hidden = hidden;
64 } 65 }
65 } 66 };
66 67
67 /** 68 /**
68 * @type {remoting.AppMode} The current app mode 69 * @type {remoting.AppMode} The current app mode
69 */ 70 */
70 remoting.currentMode = remoting.AppMode.HOME; 71 remoting.currentMode = remoting.AppMode.HOME;
71 72
72 /** 73 /**
73 * Change the app's modal state to |mode|, determined by the data-ui-mode 74 * Change the app's modal state to |mode|, determined by the data-ui-mode
74 * attribute. 75 * attribute.
75 * 76 *
(...skipping 16 matching lines...) Expand all
92 } 93 }
93 }; 94 };
94 95
95 /** 96 /**
96 * Get the major mode that the app is running in. 97 * Get the major mode that the app is running in.
97 * @return {string} The app's current major mode. 98 * @return {string} The app's current major mode.
98 */ 99 */
99 remoting.getMajorMode = function() { 100 remoting.getMajorMode = function() {
100 return remoting.currentMode.split('.')[0]; 101 return remoting.currentMode.split('.')[0];
101 }; 102 };
OLDNEW
« no previous file with comments | « remoting/webapp/main.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698