• R/O
  • SSH
  • HTTPS

iris-fmw: Commit


Commit MetaInfo

Revision278 (tree)
Time2012-02-26 21:54:07
Authorshirayanagi

Log Message

nacl 修正

Change Summary

Incremental Difference

--- trunk/framework/sample/Windows/unittest/src/nacl_test/iutest/index.html (revision 277)
+++ trunk/framework/sample/Windows/unittest/src/nacl_test/iutest/index.html (revision 278)
@@ -1,28 +1,28 @@
1-<!DOCTYPE html>
2-<html lang="ja">
3-
4-
5-
6-
7-
8-<head>
9-<title>iutest</title>
10-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11-<script type="text/javascript" src="http://www.google.com/jsapi"></script>
12-<script type="text/javascript">google.load("jquery", "1.5");</script>
13-
14-<script type="text/javascript">
15- hModule = null; // Global application object.
1+<!DOCTYPE html>
2+<html lang="ja">
3+
4+
5+
6+
7+
8+<head>
9+<title>iutest</title>
10+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
12+<script type="text/javascript">google.load("jquery", "1.5");</script>
13+
14+<script type="text/javascript">
15+ hModule = null; // Global application object.
1616 statusText = 'NO-STATUS';
17- var kMaxArraySize = 20;
17+ var kMaxArraySize = 256;
1818 var messageArray = new Array();
19-
19+
2020 function moduleDidLoad() {
21- hModule = document.getElementById('iutest');
22- // Add a message handler that accepts messages coming from the NaCl
23- // module.
24- hModule.addEventListener('message', handleMessage, false);
25- updateStatus('SUCCESS');
21+ hModule = document.getElementById('iutest');
22+ // Add a message handler that accepts messages coming from the NaCl
23+ // module.
24+ hModule.addEventListener('message', handleMessage, false);
25+ updateStatus('SUCCESS');
2626 }
2727
2828 // Handle a message coming from the NaCl module.
@@ -36,92 +36,96 @@
3636 document.getElementById('eventString').innerHTML = newData;
3737 // Print event to console.
3838 console.log(message.data);
39- }
40-
41- // If the page loads before the Native Client module loads, then set the
42- // status message indicating that the module is still loading. Otherwise,
43- // do not change the status message.
44- function pageDidLoad() {
45- if (hModule == null) {
46- updateStatus('LOADING...');
47- } else {
48- // It's possible that the Native Client module onload event fired
49- // before the page's onload event. In this case, the status message
50- // will reflect 'SUCCESS', but won't be displayed. This call will
51- // display the current message.
52- updateStatus();
53- }
54- }
55-
39+ }
40+
41+ // If the page loads before the Native Client module loads, then set the
42+ // status message indicating that the module is still loading. Otherwise,
43+ // do not change the status message.
44+ function pageDidLoad() {
45+ if (hModule == null) {
46+ updateStatus('LOADING...');
47+ } else {
48+ // It's possible that the Native Client module onload event fired
49+ // before the page's onload event. In this case, the status message
50+ // will reflect 'SUCCESS', but won't be displayed. This call will
51+ // display the current message.
52+ updateStatus();
53+ }
54+ }
55+
5656 function main() {
5757 var inputBox = document.forms.iutestForm.inputBox;
5858 hModule.postMessage('iutest_main:' + inputBox.value);
59- }
60-
61- // Set the global status message. If the element with id 'statusField'
62- // exists, then set its HTML to the status message as well.
63- // opt_message The message test. If this is null or undefined, then
64- // attempt to set the element with id 'statusField' to the value of
65- // |statusText|.
66- function updateStatus(opt_message) {
67- if (opt_message)
68- statusText = opt_message;
69- var statusField = document.getElementById('status_field');
70- if (statusField) {
71- statusField.innerHTML = statusText;
72- }
73- }
74-</script>
75-</head>
76-
77-<body onload="pageDidLoad()">
78-<!--[if lte IE 8]>
79-<p style="font-size : 20pt; padding : 1em ;">
80-IE では動作しません。
81-<a href="http://www.google.co.jp/chrome/intl/ja/landing_ie.html" target="_blank">Google Chrome</a> を利用してください。
82-</p>
83-<![endif]-->
84-<p>
85- <form name="iutestForm" action="" method="get">
86- <input type="text" id="inputBox" name="inputBox" value="Hello world" /><p>
87- <input type="button" value="run" onclick="main()" />
88- </form>
89- <!-- Load the published .nexe. This includes the 'src' attribute which
90- shows how to load multi-architecture modules. Each entry in the "nexes"
91- object in the .nmf manifest file is a key-value pair: the key is the runtime
92- ('x86-32', 'x86-64', etc.); the value is a URL for the desired NaCl module.
93- To load the debug versions of your .nexes, set the 'src' attribute to the
94- _dbg.nmf version of the manifest file.
95-
96- Note that the <EMBED> element is wrapped inside a <DIV>, which has a 'load'
97- event listener attached. This method is used instead of attaching the 'load'
98- event listener directly to the <EMBED> element to ensure that the listener
99- is active before the NaCl module 'load' event fires.
100- -->
101- <div id="listener">
102- <script type="text/javascript">
59+ }
60+
61+ // Set the global status message. If the element with id 'statusField'
62+ // exists, then set its HTML to the status message as well.
63+ // opt_message The message test. If this is null or undefined, then
64+ // attempt to set the element with id 'statusField' to the value of
65+ // |statusText|.
66+ function updateStatus(opt_message) {
67+ if (opt_message)
68+ statusText = opt_message;
69+ var statusField = document.getElementById('status_field');
70+ if (statusField) {
71+ statusField.innerHTML = statusText;
72+ }
73+ }
74+</script>
75+</head>
76+
77+<body onload="pageDidLoad()">
78+<!--[if lte IE 8]>
79+<p style="font-size : 20pt; padding : 1em ;">
80+IE では動作しません。
81+<a href="http://www.google.co.jp/chrome/intl/ja/landing_ie.html" target="_blank">Google Chrome</a> を利用してください。
82+</p>
83+<![endif]-->
84+ <h2>Output</h2>
85+ <p>
86+ <b id='eventString'>None</b>
87+ </p>
88+
89+ <p>
90+ <form name="iutestForm" action="" method="get">
91+ <p>コマンドライン引数</p>
92+ <input type="text" id="inputBox" name="inputBox" value="" /><p>
93+ <input type="button" value="run" onclick="main()" />
94+ </form>
95+ <!-- Load the published .nexe. This includes the 'src' attribute which
96+ shows how to load multi-architecture modules. Each entry in the "nexes"
97+ object in the .nmf manifest file is a key-value pair: the key is the runtime
98+ ('x86-32', 'x86-64', etc.); the value is a URL for the desired NaCl module.
99+ To load the debug versions of your .nexes, set the 'src' attribute to the
100+ _dbg.nmf version of the manifest file.
101+
102+ Note that the <EMBED> element is wrapped inside a <DIV>, which has a 'load'
103+ event listener attached. This method is used instead of attaching the 'load'
104+ event listener directly to the <EMBED> element to ensure that the listener
105+ is active before the NaCl module 'load' event fires.
106+ -->
107+ <div id="listener">
108+ <script type="text/javascript">
103109 function handleError(e) {
104- var embed_element = document.getElementById('iutest');
105- window.alert('Error: lastError = ' + embed_element.lastError);
106- }
107- document.getElementById('listener')
108- .addEventListener('error', handleError, true);
109- document.getElementById('listener')
110- .addEventListener('load', moduleDidLoad, true);
111- </script>
112-
113- <embed name="nacl_module"
114- id="iutest"
115- width="0" height="0"
116- src="iutest.nmf"
117- type="application/x-nacl" />
118- </div>
119-
120-</p>
121-<h2>Events</h2>
122-<p><b id='eventString'>None</b></p>
123-
124-<h2>Status</h2>
125-<div id="status_field">NO-STATUS</div>
126-</body>
127-</html>
110+ var embed_element = document.getElementById('iutest');
111+ window.alert('Error: lastError = ' + embed_element.lastError);
112+ }
113+ document.getElementById('listener')
114+ .addEventListener('error', handleError, true);
115+ document.getElementById('listener')
116+ .addEventListener('load', moduleDidLoad, true);
117+ </script>
118+
119+ <embed name="nacl_module"
120+ id="iutest"
121+ width="0" height="0"
122+ src="iutest.nmf"
123+ type="application/x-nacl" />
124+ </div>
125+
126+</p>
127+
128+<h2>Status</h2>
129+<div id="status_field">NO-STATUS</div>
130+</body>
131+</html>
Show on old repository browser