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

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

Issue 9903008: Added first-run infographic screens for IT2Me and Me2Me. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
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 '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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { event: 'click', id: 'cancel-connect-button', 65 { event: 'click', id: 'cancel-connect-button',
66 fn: remoting.cancelConnect }, 66 fn: remoting.cancelConnect },
67 { event: 'click', id: 'toolbar-stub', 67 { event: 'click', id: 'toolbar-stub',
68 fn: function() { remoting.toolbar.toggle(); } }, 68 fn: function() { remoting.toolbar.toggle(); } },
69 { event: 'click', id: 'start-daemon', 69 { event: 'click', id: 'start-daemon',
70 fn: function() { remoting.askPinDialog.showForStart(); } }, 70 fn: function() { remoting.askPinDialog.showForStart(); } },
71 { event: 'click', id: 'change-daemon-pin', 71 { event: 'click', id: 'change-daemon-pin',
72 fn: function() { remoting.askPinDialog.showForPin(); } }, 72 fn: function() { remoting.askPinDialog.showForPin(); } },
73 { event: 'click', id: 'stop-daemon', fn: stopDaemon }, 73 { event: 'click', id: 'stop-daemon', fn: stopDaemon },
74 { event: 'submit', id: 'access-code-form', fn: sendAccessCode }, 74 { event: 'submit', id: 'access-code-form', fn: sendAccessCode },
75 { event: 'submit', id: 'pin-form', fn: connectHostWithPin } 75 { event: 'submit', id: 'pin-form', fn: connectHostWithPin },
76 { event: 'click', id: 'get-started-it2me',
77 fn: remoting.showIt2MeUiAndSave },
78 { event: 'click', id: 'get-started-me2me',
79 fn: remoting.showMe2MeUiAndSave }
76 ]; 80 ];
77 81
78 for (var i = 0; i < actions.length; ++i) { 82 for (var i = 0; i < actions.length; ++i) {
79 var action = actions[i]; 83 var action = actions[i];
80 var element = document.getElementById(action.id); 84 var element = document.getElementById(action.id);
81 if (element) { 85 if (element) {
82 element.addEventListener(action.event, action.fn, false); 86 element.addEventListener(action.event, action.fn, false);
83 } else { 87 } else {
84 console.error('Could not set ' + action.event + 88 console.error('Could not set ' + action.event +
85 ' event handler on element ' + action.id + 89 ' event handler on element ' + action.id +
86 ': element not found.'); 90 ': element not found.');
87 } 91 }
88 } 92 }
89 remoting.init(); 93 remoting.init();
90 } 94 }
91 95
92 function onBeforeUnload() { 96 function onBeforeUnload() {
93 return remoting.promptClose(); 97 return remoting.promptClose();
94 } 98 }
95 99
96 window.addEventListener('load', onLoad, false); 100 window.addEventListener('load', onLoad, false);
97 window.addEventListener('beforeunload', onBeforeUnload, false); 101 window.addEventListener('beforeunload', onBeforeUnload, false);
98 window.addEventListener('resize', remoting.onResize, false); 102 window.addEventListener('resize', remoting.onResize, false);
99 window.addEventListener('unload', remoting.disconnect, false); 103 window.addEventListener('unload', remoting.disconnect, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698