OLD | NEW |
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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 function onLoad() { | 10 function onLoad() { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 { event: 'click', id: 'host-config-error-dismiss', fn: goHome }, | 84 { event: 'click', id: 'host-config-error-dismiss', fn: goHome }, |
85 { event: 'click', id: 'open-paired-client-manager-dialog', | 85 { event: 'click', id: 'open-paired-client-manager-dialog', |
86 fn: remoting.setMode.bind(null, | 86 fn: remoting.setMode.bind(null, |
87 remoting.AppMode.HOME_MANAGE_PAIRINGS) }, | 87 remoting.AppMode.HOME_MANAGE_PAIRINGS) }, |
88 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare } | 88 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare } |
89 ]; | 89 ]; |
90 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ | 90 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ |
91 var auth_actions = [ | 91 var auth_actions = [ |
92 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, | 92 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, |
93 { event: 'click', id: 'cancel-connect-button', fn: goHome }, | 93 { event: 'click', id: 'cancel-connect-button', fn: goHome }, |
94 { event: 'click', id: 'sign-out', fn:remoting.signOut }, | |
95 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, | 94 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, |
96 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect } | 95 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect } |
97 ]; | 96 ]; |
98 registerEventListeners(it2me_actions); | 97 registerEventListeners(it2me_actions); |
99 registerEventListeners(me2me_actions); | 98 registerEventListeners(me2me_actions); |
100 registerEventListeners(host_actions); | 99 registerEventListeners(host_actions); |
101 registerEventListeners(auth_actions); | 100 registerEventListeners(auth_actions); |
102 remoting.init(); | 101 remoting.init(); |
103 | 102 |
104 window.addEventListener('resize', remoting.onResize, false); | 103 window.addEventListener('resize', remoting.onResize, false); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (element) { | 135 if (element) { |
137 element.addEventListener(eventname, fn, false); | 136 element.addEventListener(eventname, fn, false); |
138 } else { | 137 } else { |
139 console.error('Could not set ' + eventname + | 138 console.error('Could not set ' + eventname + |
140 ' event handler on element ' + id + | 139 ' event handler on element ' + id + |
141 ': element not found.'); | 140 ': element not found.'); |
142 } | 141 } |
143 } | 142 } |
144 | 143 |
145 window.addEventListener('load', onLoad, false); | 144 window.addEventListener('load', onLoad, false); |
OLD | NEW |