-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
267 lines (238 loc) · 10.3 KB
/
index.html
File metadata and controls
267 lines (238 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="None">
<link rel="shortcut icon" href="img/favicon.ico">
<title>Go Web API</title>
<link href="css/bootstrap-custom.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="js/jquery-1.10.2.min.js" defer></script>
<script src="js/bootstrap-3.0.3.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="homepage">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=".">Go Web API</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="active">
<a href=".">Home</a>
</li>
<li >
<a href="status/">Status</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Reference <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="jscrossref/">Cross Reference</a>
</li>
<li class="dropdown-submenu">
<a href="#">Files</a>
<ul class="dropdown-menu">
<li >
<a href="file/overview/">Overview</a>
</li>
<li >
<a href="file/webidl/">WebIDL</a>
</li>
<li >
<a href="file/transform/">Transform</a>
</li>
</ul>
</li>
<li class="dropdown-submenu">
<a href="#">Go Language</a>
<ul class="dropdown-menu">
<li >
<a href="go/overview/">Overrview</a>
</li>
<li >
<a href="go/typeconv/">Type conversion</a>
</li>
<li >
<a href="go/syscalljs/">syscall.js</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> Search
</a>
</li>
<li class="disabled">
<a rel="next" >
<i class="fa fa-arrow-left"></i> Previous
</a>
</li>
<li >
<a rel="prev" href="status/">
Next <i class="fa fa-arrow-right"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="main active"><a href="#welcome-to-go-web-api">Welcome to Go Web API</a></li>
<li><a href="#example-code">Example code</a></li>
<li><a href="#statustodo">Status/TODO</a></li>
<li><a href="#github-repositories">GitHub repositories</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="welcome-to-go-web-api">Welcome to Go Web API</h1>
<p>This project is about accessing javascript from Go web assembly. It consists
of a binding generator and generated binding for e.g. DOM, HTML and WebGL.
The source files to binding program is <a href="file/webidl/">WebIDL files</a>.</p>
<h2 id="example-code">Example code</h2>
<p>A simple example can look like this:</p>
<pre><code class="go">package main
import (
"fmt"
"github.com/gowebapi/webapi"
"github.com/gowebapi/webapi/dom/domcore"
"github.com/gowebapi/webapi/html"
)
func main() {
// get the element
element := webapi.GetWindow().Document().GetElementById("myButton")
// cast it into correct class
button := html.HTMLButtonElementFromJS(element)
// change text
button.SetInnerText("Press me!")
// register a callback that will display a counter
count := 1
callback := domcore.EventHandlerToJS(func(event *domcore.Event) interface{} {
button.SetInnerText(fmt.Sprint("Count: ", count))
count++
return nil
})
button.SetOnclick(callback)
// prevent to program to terminate
c := make(chan struct{}, 0)
<-c
}
</code></pre>
<h2 id="statustodo">Status/TODO</h2>
<p>Currently the binder can process the DOM and HTML specification and create a compilable output. It's not 100% feature complete as the specifications depends
on other that is currently not processed.</p>
<p>See <a href="status/">this page</a> about current supported browser standard.</p>
<p>There is also limitation in the Go language, see <a href="go/overview/">overview page</a> on how static methods etc is handeled.</p>
<p>API Documentation can be found here: <a href="https://godoc.org/github.com/gowebapi/webapi"><img alt="GoDoc" src="https://godoc.org/github.com/gowebapi/webapi?status.svg" /></a></p>
<p>The project is currently targeting Go 1.17.</p>
<h2 id="github-repositories">GitHub repositories</h2>
<p>Main repositories is <a href="https://github.com/gowebapi/webapi">API bindings</a> and
<a href="https://github.com/gowebapi/webidl-bind">binder program</a>.</p></div>
</div>
<footer class="col-md-12">
<hr>
<p>Martin Juhlin, 2019</p>
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
</footer>
<script>
var base_url = ".",
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
</script>
<script src="js/base.js" defer></script>
<script src="search/main.js" defer></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form role="form">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="Keyboard Shortcuts Modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="exampleModalLabel">Keyboard Shortcuts</h4>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>
<!--
MkDocs version : 1.0.4
Build Date UTC : 2019-07-24 18:37:56
-->