Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: ppapi/native_client/tests/ppapi_example_events/ppapi_example_events.html

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright (c) 2011 The Native Client Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
7 -->
8 <head>
9 <title>PPAPI InputEvent test</title>
10
11 <script type="text/javascript">
12 function $(id) {
13 return document.getElementById(id);
14 }
15
16 var events = '';
17
18 function receiveMessage(message) {
19 events += message.data;
20 }
21
22 function getEvents() {
23 try {
24 var event_dump = $('event_dump');
25 event_dump.firstChild.nodeValue = events;
26 events = '';
27 } catch(e) {
28 alert(e.message);
29 }
30 }
31 </script>
32 </head>
33 <body>
34 <h1>InputEvent Handling Example</h1>
35 <div id="listener">
36 <script type="text/javascript">
37 $('listener').addEventListener('message', receiveMessage, true);
38 </script>
39
40 <embed name="nacl_module"
41 id="event_module"
42 width=400 height=400
43 src="ppapi_example_events.nmf"
44 type="application/x-nacl"
45 style="background-color:gray" />
46 </div>
47 <p>
48 This example demonstrates handling of input events in PPAPI.
49 <p>
50 Each time an input event happens in the context of the gray box,
51 the embedded NaCl module prints a message describing the event to the shell
52 where you started your Browser.
53 <p>
54 Alternatively, you can click the "Get Events" button to display
55 all input events that have happened since the last time you clicked the
56 button.
57 </p>
58 <form name="event_form" action="" method="get">
59 <input type="button" value="Get Events" onclick="getEvents()"/>
60 </form>
61
62 <h2>Recent Events (press button to update):</h2>
63 <pre id=event_dump>
64 no events
65 </pre>
66 </body>
67 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698