Chromium Code Reviews| 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 | |
|
benwells
2014/09/01 01:28:48
Instead of setting appWindow in the background pag
kcarattini
2014/09/01 06:59:06
Done.
| |
| 5 document.addEventListener('DOMContentLoaded', function() { | |
| 6 window.flow = new Flow(); | |
| 7 window.flow.startFlow(); | |
| 8 | |
| 9 // Make the close buttons close the app window. | |
| 10 var closeButtons = document.getElementsByClassName('x'); | |
| 11 for (var i = 0; i < closeButtons.length; ++i) { | |
| 12 var closeButton = closeButtons[i]; | |
| 13 closeButton.addEventListener('click', function(e) { | |
| 14 appWindow.close(); | |
| 15 e.stopPropagation(); | |
| 16 }); | |
| 17 } | |
| 18 | |
| 19 $('ah-no-thanks-button').addEventListener('click', function(e) { | |
| 20 appWindow.close(); | |
| 21 e.stopPropagation(); | |
| 22 }); | |
| 23 | |
| 24 $('no-thanks-button').addEventListener('click', function(e) { | |
| 25 appWindow.close(); | |
| 26 e.stopPropagation(); | |
| 27 }); | |
| 28 | |
| 29 $('finish-later-button').addEventListener('click', function(e) { | |
| 30 appWindow.close(); | |
| 31 e.stopPropagation(); | |
| 32 }); | |
| 33 | |
| 34 $('ah-agree-button').addEventListener('click', function(e) { | |
| 35 // TODO(kcarattini): Set the Audio History setting. | |
| 36 appWindow.close(); | |
| 37 e.stopPropagation(); | |
| 38 }); | |
| 39 | |
| 40 $('agree-button').addEventListener('click', function(e) { | |
| 41 // TODO(kcarattini): Set the Audio History setting. | |
| 42 window.flow.advanceStep(); | |
| 43 e.stopPropagation(); | |
| 44 }); | |
| 45 | |
| 46 // TODO(kcarattini): Remove this once speech training is implemented. The | |
| 47 // way to get to the next page will be to complete the speech training. | |
| 48 $('training').addEventListener('click', function(e) { | |
| 49 // TODO(kcarattini): Set the always-on-hotword setting. | |
| 50 window.flow.advanceStep(); | |
| 51 e.stopPropagation(); | |
| 52 }); | |
| 53 | |
| 54 $('try-now-button').addEventListener('click', function(e) { | |
| 55 // TODO(kcarattini): Figure out what happens when you click this button. | |
| 56 appWindow.close(); | |
| 57 e.stopPropagation(); | |
| 58 }); | |
| 59 }); | |
| OLD | NEW |