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 # JavaScript and CSS stuff for NaCl
if(WITH_NACLAPPLICATION OR WITH_WINDOWLESSNACLAPPLICATION) 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() endif()
# GLX application # 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 need to provide HTML markup for your application. Template one is below,
you can modify it to your liking. The markup references two files, 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 directory in the source tree and are also installed into `share/magnum/` inside
your NaCl toolchain. your NaCl toolchain.
@code @code
<!DOCTYPE html> <!DOCTYPE html>
<html> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>Magnum NaCl Application</title> <title>Magnum NaCl Application</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="stylesheet" href="NaClApplication.css" /> <link rel="stylesheet" href="WebApplication.css" />
</head> </head>
<body> <body>
<h1>Magnum NaCl Application</h1> <h1>Magnum NaCl Application</h1>
<div id="listener"> <div id="listener">
<script type="text/javascript" src="NaClApplication.js"></script>
<embed id="module" type="application/x-nacl" src="application.nmf" /> <embed id="module" type="application/x-nacl" src="application.nmf" />
<div id="status">Initialization...</div> <div id="status">Initialization...</div>
<div id="statusDescription"></div> <div id="statusDescription" />
<script src="NaClApplication.js"></script>
</div> </div>
</body> </body>
</html> </html>

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

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

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

Loading…
Cancel
Save