Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 9bc2ec8

Browse files
committed
[[ Emscripten ]] Update HTML5 deployment guide
1 parent 4fea640 commit 9bc2ec8

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/guides/HTML5 Deployment.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ group: deployment
66

77
## Introduction
88

9-
**Note: This is BETA release of HTML5 deployment support. If you intend to use it in production, please test thoroughly that it supports all the functionality you are looking for.**
9+
**Note: This release of HTML5 deployment support is not yet feature complete. If you intend to use it in production, please test thoroughly that it supports all the functionality you are looking for.**
1010

1111
Almost every Internet-connected device has a web browser. If your application can run in a browser, your app can be used anywhere and by anyone, without any need to download or install it.
1212

@@ -26,18 +26,19 @@ We hope to broaden the range of supported browsers in the future.
2626

2727
The HTML5 engine in this release of LiveCode has a limited range of features. You can:
2828

29-
* deploy single-stack applications with embedded resources
29+
* deploy single or multiple stack applications with embedded resources. Stacks other than the main stack will open in their own floating container windows.
3030
* use most of the engine's built-in controls and graphics capabilities.
3131
* read and write temporary files in a special virtual filesystem (which is erased when the user navigates away from the page)
3232
* use LiveCode Builder widgets and extensions
3333
* interact with JavaScript code in the web page using `do <script> as "JavaScript"`
34+
* call JavaScript from LiveCode Builder widgets and extensions using the com.livecode.emscripten module
35+
* implement widgets by embedding DOM elements as native layers
3436
* perform basic networking operations using the **load** command
3537

3638
Several important features are not yet supported:
3739

3840
* some `ask` and `answer` message boxes
3941
* multimedia (the "player" control)
40-
* JavaScript in LiveCode Builder extensions
4142

4243
Two important unsupported features are unlikely to be added in the near future:
4344

@@ -113,17 +114,19 @@ The default HTML5 page provided by the HTML5 standalone builder is designed for
113114

114115
### The canvas
115116

116-
The engine renders into a HTML5 `<canvas>` element. There are three important considerations when creating the canvas:
117+
The engine renders into a HTML5 `<canvas>` element contained within a `<div>` element. There are some important considerations when creating the canvas & div:
117118

118-
* the canvas must have absolutely no border, or mouse coordinate calculations will be incorrect
119+
* both the canvas and div must have absolutely no border, or mouse coordinate calculations will be incorrect
119120

120-
* it will be automatically resized by the engine to match the size of your stack, so don't attempt to set its size using HTML or CSS
121+
* they will be automatically resized by the engine to match the size of your stack, so don't attempt to set their size using HTML or CSS
121122

122-
* it needs to be easily uniquely identifiable, so that the engine can find it.
123+
* the canvas should be the only element within the containing div, which may be used to hold additional elements as native layers are added to the app.
124+
125+
* the canvas needs to be easily uniquely identifiable, so that the engine can find it.
123126

124127
The absolute minimum canvas element would look something like this:
125128

126-
<canvas style="border: 0px none;" id="canvas" oncontextmenu="event.preventDefault();"></canvas>
129+
<div><canvas style="border: 0px none;" id="canvas" oncontextmenu="event.preventDefault();"></canvas></div>
127130

128131
By default, most web browsers will indicate when the canvas has focus by displaying a highlighted outline. This helps users identify which part of the web page is capturing their key presses. You can usually disable this outline by adding `outline: none;` to the canvas's CSS styles.
129132

@@ -155,7 +158,9 @@ Here's the complete skeleton web page for an HTML5 standalone:
155158

156159
<html>
157160
<body>
158-
<canvas style="border: 0px none;" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
161+
<div>
162+
<canvas style="border: 0px none;" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
163+
</div>
159164

160165
<script type="text/javascript">
161166
var Module = { canvas: document.getElementById('canvas') };

0 commit comments

Comments
 (0)