OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <!-- | 3 <!-- |
4 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
6 found in the LICENSE file. | 6 found in the LICENSE file. |
7 --> | 7 --> |
8 <head> | 8 <head> |
9 <meta http-equiv="Pragma" content="no-cache"> | 9 <meta http-equiv="Pragma" content="no-cache"> |
10 <meta http-equiv="Expires" content="-1"> | 10 <meta http-equiv="Expires" content="-1"> |
11 <title><TITLE></title> | 11 <title><TITLE></title> |
12 <script type="text/javascript" src="common.js"></script> | 12 <script type="text/javascript" src="common.js"></script> |
13 <script type="text/javascript"> | 13 <script type="text/javascript"> |
14 function moduleDidLoad() { | 14 function moduleDidLoad() { |
15 // The module is not hidden by default so we can easily see if the plugin | 15 // The module is not hidden by default so we can easily see if the plugin |
16 // failed to load. | 16 // failed to load. |
17 common.hideModule(); | 17 common.hideModule(); |
18 } | 18 } |
19 | 19 |
20 function askBall() { | 20 function askBall() { |
21 var questionEl = document.getElementById('question'); | 21 var questionEl = document.getElementById('question'); |
22 var query = questionEl.value; | 22 var query = questionEl.value; |
23 questionEl.value = ''; | 23 questionEl.value = ''; |
24 document.getElementById('log').innerHTML += 'You asked:' + query + '<br>'; | 24 document.getElementById('log').innerHTML += 'You asked:' + query + '<br>'; |
25 common.naclModule.postMessage('query'); | 25 common.naclModule.postMessage('query'); |
26 return false; | 26 return false; |
27 } | 27 } |
28 </script> | 28 </script> |
29 </head> | 29 </head> |
30 <body onload="common.onload('<NAME>', '<tc>')"> | 30 <body onload="common.onload('<NAME>', '<tc>', '<config>')"> |
31 <h1><TITLE></h1> | 31 <h1><TITLE></h1> |
32 <h2>Status: <code id="statusField">NO-STATUS</code></h2> | 32 <h2>Status: <code id="statusField">NO-STATUS</code></h2> |
33 <div>Magic eightball: type a question below, press the button, and get a | 33 <div>Magic eightball: type a question below, press the button, and get a |
34 response.</div> | 34 response.</div> |
35 <form action="#" onsubmit="return askBall();"> | 35 <form action="#" onsubmit="return askBall();"> |
36 <input type="text" id="question" value=""> | 36 <input type="text" id="question" value=""> |
37 <input type="submit" value="ASK!"> | 37 <input type="submit" value="ASK!"> |
38 </form> | 38 </form> |
39 <!-- The NaCl plugin will be embedded inside the element with id "listener". | 39 <!-- The NaCl plugin will be embedded inside the element with id "listener". |
40 See common.js.--> | 40 See common.js.--> |
41 <div id="listener"></div> | 41 <div id="listener"></div> |
42 <div id="log"></div> | 42 <div id="log"></div> |
43 </body> | 43 </body> |
44 </html> | 44 </html> |
OLD | NEW |