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

Side by Side Diff: native_client_sdk/src/project_templates/html/project_file.html

Issue 16972010: Dropping nacl sdk dead code (documentation, project_template). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 <head>
4 <title><ProjectName>!</title>
5
6 <script type="text/javascript">
7 <ProjectName>Module = null; // Global application object.
8 statusText = 'NO-STATUS';
9
10 // Indicate load success.
11 function moduleDidLoad() {
12 <ProjectName>Module = document.getElementById('<PROJECT_NAME>');
13 updateStatus('SUCCESS');
14 }
15
16 // The 'message' event handler. This handler is fired when the NaCl module
17 // posts a message to the browser by calling PPB_Messaging.PostMessage()
18 // (in C) or pp::Instance.PostMessage() (in C++). This implementation
19 // simply displays the content of the message in an alert panel.
20 function handleMessage(message_event) {
21 alert(message_event.data);
22 }
23
24 // If the page loads before the Native Client module loads, then set the
25 // status message indicating that the module is still loading. Otherwise,
26 // do not change the status message.
27 function pageDidLoad() {
28 if (<ProjectName>Module == null) {
29 updateStatus('LOADING...');
30 } else {
31 // It's possible that the Native Client module onload event fired
32 // before the page's onload event. In this case, the status message
33 // will reflect 'SUCCESS', but won't be displayed. This call will
34 // display the current message.
35 updateStatus();
36 }
37 }
38
39 // Set the global status message. If the element with id 'statusField'
40 // exists, then set its HTML to the status message as well.
41 // opt_message The message test. If this is null or undefined, then
42 // attempt to set the element with id 'statusField' to the value of
43 // |statusText|.
44 function updateStatus(opt_message) {
45 if (opt_message)
46 statusText = opt_message;
47 var statusField = document.getElementById('status_field');
48 if (statusField) {
49 statusField.innerHTML = statusText;
50 }
51 }
52 </script>
53 </head>
54 <body onload="pageDidLoad()">
55
56 <h1>Native Client Module <ProjectName></h1>
57 <p>
58 <!-- Load the published .nexe. This includes the 'nacl' attribute which
59 shows how to load multi-architecture modules. Each entry in the "nexes"
60 object in the .nmf manifest file is a key-value pair: the key is the
61 instruction set architecture ('x86-32', 'x86-64', etc.); the value is a URL
62 for the desired NaCl module.
63 To load the debug versions of your .nexes, set the 'nacl' attribute to the
64 _dbg.nmf version of the manifest file.
65
66 Note: Since this NaCl module does not use any real-estate in the browser,
67 its width and height are set to 0.
68
69 Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
70 and a 'message' event listener attached. This wrapping method is used
71 instead of attaching the event listeners directly to the <EMBED> element to
72 ensure that the listeners are active before the NaCl module 'load' event
73 fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or
74 pp::Instance.PostMessage() (in C++) from within the initialization code in
75 your NaCl module.
76 -->
77 <div id="listener">
78 <script type="text/javascript">
79 var listener = document.getElementById('listener');
80 listener.addEventListener('load', moduleDidLoad, true);
81 listener.addEventListener('message', handleMessage, true);
82 </script>
83
84 <embed name="nacl_module"
85 id="<PROJECT_NAME>"
86 width=0 height=0
87 src="<PROJECT_NAME>.nmf"
88 type="application/x-nacl" />
89 </div>
90 </p>
91
92 <h2>Status</h2>
93 <div id="status_field">NO-STATUS</div>
94 </body>
95 </html>
OLDNEW
« no previous file with comments | « native_client_sdk/src/project_templates/cc/project_file.cc ('k') | native_client_sdk/src/project_templates/init_project.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698