Update Modello web samples from upstream; version up
[profile/ivi/sdk/web-sample-build.git] / samples / web / Sample / Tizen / Web App / Saythis / project / js / main.js
1 /*
2  * Copyright (c) 2012, Intel Corporation.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9 var mySpeechObj = tizen.speech;
10
11 $(document).ready(function()
12 {
13    $('#speakButton').click(function() {
14
15             var text = $('#inputArea').val();
16             console.log(text);
17
18             if (text) {
19                mySpeechObj.vocalizeString(text);
20             }
21
22             $('#inputArea').val("");
23     });
24
25     $('#inputArea').keyup(function(event) {
26             if (event.keyCode === 13) {
27                     $('#speakButton').click();
28              }
29     });
30 });