Merge site updates for v0.05-beta

gh-pages
Hauke D 7 years ago committed by GitHub
commit d4e89eceab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,7 +33,7 @@ js('document')->getElementById('my_button')
</script> </script>
``` ```
- [**Download `webperl_prebuilt_v0.03-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.03-beta/webperl_prebuilt_v0.03-beta.zip) - [**Download `webperl_prebuilt_v0.05-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.05-beta/webperl_prebuilt_v0.05-beta.zip)
- [**Get the sources on GitHub**](https://github.com/haukex/webperl) - [**Get the sources on GitHub**](https://github.com/haukex/webperl)
@ -46,9 +46,9 @@ Quick Start
- In a shell: - In a shell:
$ wget https://github.com/haukex/webperl/releases/download/v0.03-beta/webperl_prebuilt_v0.03-beta.zip $ wget https://github.com/haukex/webperl/releases/download/v0.05-beta/webperl_prebuilt_v0.05-beta.zip
$ unzip webperl_prebuilt_v0.03-beta.zip $ unzip webperl_prebuilt_v0.05-beta.zip
$ cd webperl_prebuilt_v0.03-beta $ cd webperl_prebuilt_v0.05-beta
$ plackup webperl.psgi $ plackup webperl.psgi
HTTP::Server::PSGI: Accepting connections at http://0:5000/ HTTP::Server::PSGI: Accepting connections at http://0:5000/

@ -352,13 +352,39 @@ discussion under
["The Perl Interpreter and its Environment"](#the-perl-interpreter-and-its-environment). ["The Perl Interpreter and its Environment"](#the-perl-interpreter-and-its-environment).
Defaults to `false`. Defaults to `false`.
#### `Perl.noMountIdbfs`
If set to `true` before calling `Perl.start()`, then WebPerl will not automatically
mount the IDBFS filesystem (see ["Virtual File System"](#virtual-file-system).
Defaults to `false`.
This option was added in `v0.05-beta`.
#### `Perl.trace` #### `Perl.trace`
Enable this option at any time to get additional trace-level output Enable this option at any time to get additional trace-level output
to `console.debug()`. Defaults to `false`. to `console.debug()`. Defaults to `false`.
#### `Perl.addStateChangeListener`
**Added in `v0.05-beta`.**
Pass this function a `function (from,to) {...}` to register a new handler
for state changes of the Perl interpreter.
The states currently are:
- `"Uninitialized"` - `Perl.init` has not been called yet.
- `"Initializing"` - `Perl.init` is currently operating.
- `"Ready" - `Perl.init` is finished and `Perl.start` can be called.
- `"Running"` - The Perl interpreter is running, `Perl.eval` and `Perl.end` may be called
- `"Ended"` - The Perl interpreter has ended. You might receive several
state change notifications for this state.
#### `Perl.stateChanged` #### `Perl.stateChanged`
**Deprecated in `v0.05-beta`.** Use `Perl.addStateChangeListener` instead.
Set this to a `function (from,to) {...}` to handle state changes of the Perl interpreter. Set this to a `function (from,to) {...}` to handle state changes of the Perl interpreter.
Defaults to a simple implementation that logs via `console.debug()`. Defaults to a simple implementation that logs via `console.debug()`.
@ -383,6 +409,7 @@ It also provides the functions `unregister`, `sub_once`, and `sub1`
in ["Memory Management and Anonymous `sub`s"](#memory-management-and-anonymous-subs). in ["Memory Management and Anonymous `sub`s"](#memory-management-and-anonymous-subs).
For convenience, it can also re-export `encode_json`, so you can For convenience, it can also re-export `encode_json`, so you can
request it directly from `WebPerl` instead of needing to `use` another module. request it directly from `WebPerl` instead of needing to `use` another module.
Additional functions, like `js_new()`, are documented below.
All functions are exported only on request. All functions are exported only on request.
Note that WebPerl will also enable autoflush for `STDOUT`. Note that WebPerl will also enable autoflush for `STDOUT`.
@ -479,6 +506,21 @@ future be extended to return more than that, similar to `WebPerl::js()`,
and then the passing of Perl values to JavaScript could be accomplished and then the passing of Perl values to JavaScript could be accomplished
differently as well. differently as well.
### `js_new()`
This function is a convenience function for calling JavaScript's `new`.
The first argument is the name of the class, the following arguments are
passed to the constructor. It returns the same thing as the `js()` function,
in this case that would be the new object. For example:
js_new('Blob', ["<html></html>"], {type=>"text/html;charset=utf-8"})
is the same as calling this in JavaScript:
new Blob(["<html></html>"], {type:"text/html;charset=utf-8"})
This function was added in WebPerl `v0.05-beta`.
The Mini IDE The Mini IDE
------------ ------------

Loading…
Cancel
Save