You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: docs/guides/HTML5 Deployment.md
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Introduction
1
+
# HTML5 Deployment
2
+
3
+
## Introduction
2
4
3
5
**Note: This is an experimental release of HTML5 deployment support and is not recommended for production use.**
4
6
@@ -38,9 +40,9 @@ Two important unsupported features are unlikely to be added in the near future:
38
40
(e.g. `wait 10`)
39
41
* externals (including revdb)
40
42
41
-
# How to deploy an app to HTML5
43
+
##How to deploy an app to HTML5
42
44
43
-
## Step by step
45
+
###Step by step
44
46
45
47
Deploying an app to an HTML5 standalone is straightforward:
46
48
@@ -58,7 +60,7 @@ Deploying an app to an HTML5 standalone is straightforward:
58
60
59
61
Your application will be packaged up and placed in the selected output folder.
60
62
61
-
## Contents of the HTML5 standalone
63
+
###Contents of the HTML5 standalone
62
64
63
65
The HTML5 standalone contains four files:
64
66
@@ -68,7 +70,7 @@ The HTML5 standalone contains four files:
68
70
69
71
* A test HTML page. This can be opened in a browser and will correctly prepare, download and start your HTML5 app in a convenient test environment.
70
72
71
-
## Testing your HTML5 app with a local web server
73
+
###Testing your HTML5 app with a local web server
72
74
73
75
Some browsers, such as Google Chrome, do not permit pages to download resources from `file://` URLs. You won't be able to test your application in these browsers unless you run a local HTTP server.
74
76
@@ -78,11 +80,11 @@ A quick and easy way to run a simple local HTTP server is to use Python. Open a
78
80
79
81
This will let you access your standalone by opening your web browser and visiting <http://localhost:8080>.
80
82
81
-
# Reporting bugs
83
+
##Reporting bugs
82
84
83
85
Please report bugs to the [LiveCode Quality Centre](http://quality.livecode.com/). Make sure to select "HTML5 Standalone" when you're creating your bug report!
84
86
85
-
# Advanced: HTML5 standalone filesystem
87
+
##Advanced: HTML5 standalone filesystem
86
88
87
89
JavaScript applications running in a browser don't have access to the host system's filesystem. Instead, the filesystem-related features of LiveCode, such as `open file`, use a virtual filesystem (VFS) that exists only in memory. This filesystem is initialised before the engine starts, and is reset and its content discarded when the engine stops (when the user closes the browser view or navigates to a different page).
88
90
@@ -100,11 +102,11 @@ There are several special files & directories in the `/boot/` directory:
100
102
101
103
In general, if you wish to add new files or directories to the `standalone.zip` archive, it is best to add them outside the `/boot/` directory tree.
102
104
103
-
# Advanced: Embedding an HTML5 standalone in a web page
105
+
##Advanced: Embedding an HTML5 standalone in a web page
104
106
105
107
The default HTML5 page provided by the HTML5 standalone builder is designed for testing and debugging purposes. However, you may want to embed the standalone engine in a more visually appealing page. To do this, you require three elements: 1) a canvas, 2) a JavaScript `Module` object, and 3) an HTML `<script>` element that downloads the engine.
106
108
107
-
## The canvas
109
+
###The canvas
108
110
109
111
The engine renders into a HTML5 `<canvas>` element. There are three important considerations when creating the canvas:
110
112
@@ -120,7 +122,7 @@ The absolute minimum canvas element would look something like this:
120
122
121
123
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.
122
124
123
-
## The Module object
125
+
###The Module object
124
126
125
127
The top-level JavaScript `Module` object contains the parameters that control how the engine runs. At minimum, you need only specify the `Module.canvas`, which should be your canvas element.
126
128
@@ -132,7 +134,7 @@ The absolute minimum `Module` object declaration would look something like:
132
134
};
133
135
</script>
134
136
135
-
## Engine download
137
+
###Engine download
136
138
137
139
The engine is quite a large JavaScript file, so it's downloaded asynchronously in order to let the rest of the page finish loading and start being displayed.
138
140
@@ -142,7 +144,7 @@ Quite straightforwardly:
142
144
143
145
Make sure to replace `<version>` as appropriate.
144
146
145
-
## Bringing it all together
147
+
###Bringing it all together
146
148
147
149
Here's the complete skeleton web page for an HTML5 standalone:
148
150
@@ -157,7 +159,7 @@ Here's the complete skeleton web page for an HTML5 standalone:
157
159
</body>
158
160
</html>
159
161
160
-
# Advanced: Speeding up engine download
162
+
##Advanced: Speeding up engine download
161
163
162
164
Currently, the engine files are almost 30 MB, which is a lot to download before the engine can start. It is possible to speed up the download by enabling deflate compression in the web server configuration.
163
165
@@ -166,7 +168,7 @@ Enabling deflate compression reduces the total download size to around 6.3 MB.
166
168
* For the Apache web server, configure `mod_deflate` to serve [pre-compressed content](https://httpd.apache.org/docs/2.4/mod/mod_deflate.html#precompressed)
167
169
* For the NGINX web server, add [`gzip_static on;`](https://www.nginx.com/resources/admin-guide/compression-and-decompression/#send) to your configuration.
168
170
169
-
# Advanced: Customizing the Module object
171
+
##Advanced: Customizing the Module object
170
172
171
173
There are a number of LiveCode-specific `Module` attributes that you can modify to affect how the engine behaves:
0 commit comments