04.30.07

POW 0.1.2 Preview Available

Posted in POW at 4:11 pm by David Kellogg

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

04.23.07

POW 0.1.1 preview available

Posted in POW at 4:37 pm by David Kellogg

POW (Plain Old Webserver) 0.1.1 preview is ready for review. Here are the fixes and features.

* Data/DB directory retrieval
* Fixed Windows DB bug
* Supports HTTP 1.1 “Transfer-Encoding: chunked”
* Changed scoping rules to persist only the pow_server object

The last part means that the following will no longer be possible.

Page 1:

var a = 5;

Page 2:

document.writeln(a); // ERROR: a is not defined

The following variable, though, will persist for as long as the server is running:

pow_server.a = 5; // Persists indefinitely

Dave

04.20.07

I’ve got developers?

Posted in POW at 8:57 am by David Kellogg

Wow. This is something I did not expect.

I somehow imagined people would download POW, use it for interesting, unanticipated projects and submit some patches.

What actually happened was much better. There is a great deal of interest from Russia. POW wiki pages were translated into Russian. Users ported their JS applications to POW. I will spend a while filtering through their aps to see how they work. Thanks to everyone for creating a community out of nothing. I think now I have to get back to work on scoping bugs/features.