OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 var appWindow = chrome.app.window.current(); | |
6 | |
7 document.addEventListener('DOMContentLoaded', function() { | |
8 window.flow = new Flow(); | |
Bernhard Bauer
2014/09/01 10:16:23
Is there a reason you need to put this into the gl
kcarattini
2014/09/02 04:37:23
Done.
| |
9 window.flow.startFlow(); | |
10 | |
11 // Make the close buttons close the app window. | |
12 var closeButtons = document.getElementsByClassName('close'); | |
13 for (var i = 0; i < closeButtons.length; ++i) { | |
14 var closeButton = closeButtons[i]; | |
15 closeButton.addEventListener('click', function(e) { | |
16 appWindow.close(); | |
17 e.stopPropagation(); | |
18 }); | |
19 } | |
20 | |
21 $('ah-cancel-button').addEventListener('click', function(e) { | |
22 appWindow.close(); | |
23 e.stopPropagation(); | |
24 }); | |
25 | |
26 $('hw-cancel-button').addEventListener('click', function(e) { | |
27 appWindow.close(); | |
28 e.stopPropagation(); | |
29 }); | |
30 | |
31 $('st-cancel-button').addEventListener('click', function(e) { | |
32 appWindow.close(); | |
33 e.stopPropagation(); | |
34 }); | |
35 | |
36 $('ah-agree-button').addEventListener('click', function(e) { | |
37 // TODO(kcarattini): Set the Audio History setting. | |
38 appWindow.close(); | |
39 e.stopPropagation(); | |
40 }); | |
41 | |
42 $('hw-agree-button').addEventListener('click', function(e) { | |
43 // TODO(kcarattini): Set the Audio History setting. | |
44 window.flow.advanceStep(); | |
45 e.stopPropagation(); | |
46 }); | |
47 | |
48 // TODO(kcarattini): Remove this once speech training is implemented. The | |
49 // way to get to the next page will be to complete the speech training. | |
50 $('training').addEventListener('click', function(e) { | |
51 // TODO(kcarattini): Set the always-on-hotword setting. | |
52 window.flow.advanceStep(); | |
53 e.stopPropagation(); | |
54 }); | |
55 | |
56 $('try-now-button').addEventListener('click', function(e) { | |
57 // TODO(kcarattini): Figure out what happens when you click this button. | |
58 appWindow.close(); | |
59 e.stopPropagation(); | |
60 }); | |
61 }); | |
OLD | NEW |