| OLD | NEW |
| 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 // Called by the common.js module. | 5 // Called by the common.js module. |
| 6 function attachListeners() { | 6 function attachListeners() { |
| 7 document.getElementById('connectForm').addEventListener('submit', doConnect); | 7 document.getElementById('connectForm').addEventListener('submit', doConnect); |
| 8 document.getElementById('sendForm').addEventListener('submit', doSend); | 8 document.getElementById('sendForm').addEventListener('submit', doSend); |
| 9 document.getElementById('closeButton').addEventListener('click', doClose); | 9 document.getElementById('closeButton').addEventListener('click', doClose); |
| 10 } | 10 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Send a request message. See also websocket.cc for the request format. | 27 // Send a request message. See also websocket.cc for the request format. |
| 28 var message = document.getElementById('message').value; | 28 var message = document.getElementById('message').value; |
| 29 common.naclModule.postMessage('s;' + message); | 29 common.naclModule.postMessage('s;' + message); |
| 30 event.preventDefault(); | 30 event.preventDefault(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function doClose() { | 33 function doClose() { |
| 34 // Send a request message. See also websocket.cc for the request format. | 34 // Send a request message. See also websocket.cc for the request format. |
| 35 common.naclModule.postMessage('c;'); | 35 common.naclModule.postMessage('c;'); |
| 36 } | 36 } |
| 37 |
| 38 function handleMessage(message) { |
| 39 common.logMessage(message.data + '\n'); |
| 40 } |
| OLD | NEW |