mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-26 21:35:09 -06:00
73 lines
2.4 KiB
HTML
73 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Wi!</title>
|
|
|
|
<script type="text/javascript">
|
|
WiModule = null; // Global application object.
|
|
statusText = 'NO-STATUS';
|
|
|
|
function moduleDidLoad() {
|
|
WiModule = document.getElementById('wi');
|
|
updateStatus('SUCCESS');
|
|
}
|
|
|
|
// If the page loads before the Native Client module loads, then set the
|
|
// status message indicating that the module is still loading. Otherwise,
|
|
// do not change the status message.
|
|
function pageDidLoad() {
|
|
if (WiModule == null) {
|
|
updateStatus('LOADING...');
|
|
} else {
|
|
// It's possible that the Native Client module onload event fired
|
|
// before the page's onload event. In this case, the status message
|
|
// will reflect 'SUCCESS', but won't be displayed. This call will
|
|
// display the current message.
|
|
updateStatus();
|
|
}
|
|
}
|
|
|
|
// Set the global status message. If the element with id 'statusField'
|
|
// exists, then set its HTML to the status message as well.
|
|
// opt_message The message test. If this is null or undefined, then
|
|
// attempt to set the element with id 'statusField' to the value of
|
|
// |statusText|.
|
|
function updateStatus(opt_message) {
|
|
if (opt_message)
|
|
statusText = opt_message;
|
|
var statusField = document.getElementById('status_field');
|
|
if (statusField) {
|
|
statusField.innerHTML = statusText;
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="pageDidLoad()">
|
|
|
|
<h1>Native Client Module Wi</h1>
|
|
<p>
|
|
<!-- Load the published .nexe. This includes the 'nacl' attribute which
|
|
shows how to load multi-architecture modules. Each entry in the "nexes"
|
|
object in the .nmf manifest file is a key-value pair: the key is the
|
|
instruction set architecture ('x86-32', 'x86-64', etc.); the value is a URL
|
|
for the desired NaCl module.
|
|
To load the debug versions of your .nexes, set the 'nacl' attribute to the
|
|
_dbg.nmf version of the manifest file.
|
|
|
|
Note: Since this NaCl module does not use any real-estate in the browser,
|
|
it's width and height are set to 0, and the 'dimensions' attribute is not
|
|
set (see the pi_generator example for use of the 'dimensions' attribute).
|
|
-->
|
|
<embed name="nacl_module"
|
|
id="wi"
|
|
width=0 height=0
|
|
nacl="wi.nmf"
|
|
type="application/x-nacl"
|
|
onload="moduleDidLoad();" />
|
|
</p>
|
|
|
|
<h2>Status</h2>
|
|
<div id="status_field">NO-STATUS</div>
|
|
</body>
|
|
</html>
|