Browse Source

Platform: markup improvements for web applications.

Indented and cleaned up cruft from HTML template, renamed
NaClApplication.css to WebApplication.css, as it is universal and not
tied only to NaCl.
pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
15cc649b27
  1. 2
      src/Platform/CMakeLists.txt
  2. 10
      src/Platform/NaClApplication.h
  3. 0
      src/Platform/WebApplication.css
  4. 14
      src/Platform/magnum-info-nacl.html

2
src/Platform/CMakeLists.txt

@ -86,7 +86,7 @@ endif()
# JavaScript and CSS stuff for NaCl
if(WITH_NACLAPPLICATION OR WITH_WINDOWLESSNACLAPPLICATION)
install(FILES NaClApplication.js NaClApplication.css DESTINATION ${MAGNUM_DATA_INSTALL_DIR})
install(FILES NaClApplication.js WebApplication.css DESTINATION ${MAGNUM_DATA_INSTALL_DIR})
endif()
# GLX application

10
src/Platform/NaClApplication.h

@ -75,24 +75,24 @@ to simplify porting.
You need to provide HTML markup for your application. Template one is below,
you can modify it to your liking. The markup references two files,
`NaClApplication.js` and `NaClApplication.css`, both are in `Platform/`
`NaClApplication.js` and `WebApplication.css`, both are in `Platform/`
directory in the source tree and are also installed into `share/magnum/` inside
your NaCl toolchain.
@code
<!DOCTYPE html>
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Magnum NaCl Application</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="NaClApplication.css" />
<link rel="stylesheet" href="WebApplication.css" />
</head>
<body>
<h1>Magnum NaCl Application</h1>
<div id="listener">
<script type="text/javascript" src="NaClApplication.js"></script>
<embed id="module" type="application/x-nacl" src="application.nmf" />
<div id="status">Initialization...</div>
<div id="statusDescription"></div>
<div id="statusDescription" />
<script src="NaClApplication.js"></script>
</div>
</body>
</html>

0
src/Platform/NaClApplication.css → src/Platform/WebApplication.css

14
src/Platform/magnum-info-nacl.html

@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Magnum Info</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="NaClApplication.css" />
<link rel="stylesheet" href="WebApplication.css" />
<style type="text/css">
#module {
position: absolute;
@ -22,7 +22,11 @@
<body>
<h1>Magnum Info</h1>
<div id="listener">
<script type="text/javascript" src="NaClApplication.js"></script>
<embed id="module" type="application/x-nacl" src="magnum-info.nmf" />
<div id="status">Initialization...</div>
<div id="statusDescription" />
<div id="info" />
<script src="NaClApplication.js"></script>
<script type="text/javascript">
function messageReceived(message) {
var info = document.getElementById('info');
@ -32,10 +36,6 @@ function messageReceived(message) {
var listener = document.getElementById('listener');
listener.addEventListener('message', messageReceived, true);
</script>
<embed id="module" type="application/x-nacl" src="magnum-info.nmf" />
<div id="status">Initialization...</div>
<div id="statusDescription"></div>
<div id="info"></div>
</div>
</body>
</html>

Loading…
Cancel
Save