04.30.07
POW 0.1.2 Preview Available
POW 0.1.2 is available. It allows modules from developers to be loaded. Here’s how to create the “hello world” module.
hello.sjs:
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<?sjs
var a = Math.floor(Math.random()*2);
if(a < 1) {
document.writeln("¡Hola, mundo!");
} else {
document.writeln("Hello World!");
}
?>
</body>
</html>
hello.install.sjs
<html>
<head>
<title>Hello POW Module</title>
</head>
<body>
<script>
var pow_installer = {
version: "1.0.0",
name: "hello",
location: "http://localhost/~davidkellogg/xul/pow/modules/hello.zip"
};
</script>
<center>Downloading Pow Module will begin now.</center>
<br/>
If this does not happen, please go directly to <a href="hello.zip">hello.zip</a>.
Once completed please see <a href="http://localhost:6670/modules/hello/hello.sjs">Hello Mundo!</a>.
</body>
</html>
zip hello.zip hello.sjs
Place the hello.install.html file in the same directory as hello.zip.
That’s it!
A few extra notes:
1. Files ending in .install.sjs and .install.html both work as installers.
2. The installer Javascript is never executed by the chrome for security reasons, so formatting counts. Use the pow_installer formatting as shown.
3. File extensions are whitelisted (.js, .html, .sjs, .gif, .jpg, .png). All others must be copied manually. This is a security restriction.
4. Please document your module. We need to keep minimum standards.
5. Further restrictions on eval and file writes may occur. Both may result in security alerts or files that must be copied by hand.
Tell me if there any problems with your modules.
Dave