-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.html
339 lines (333 loc) · 18.3 KB
/
index.html
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CircuitPython Code Editor</title>
<link rel="icon" href="/assets/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/sass/style.scss">
</head>
<body>
<div id="blackout" class="body-blackout"></div>
<div id="clickblock" class="body-blackout no-overlay"></div>
<div class="layout">
<header id="site-header">
<div class="wrapper">
<div class="content container">
<nav class="site-brand">
<div class="site-logo">
<a href="https://code.circuitpython.org/">
<img alt="CircuitPython Logo" height="50"
src="/images/logo.png"
srcset="/images/logo.png 1x,
/images/logo@2x.png 2x,
/images/logo@3x.png 3x" >
</a>
</div>
<div class="get-started">
<a class="github-repo" href="https://github.com/circuitpython/web-editor">
<i class="fa-brands fa-github"></i>
</a>
<button class="btn-connect">Connect</button>
</div>
</nav>
</div>
</div>
<div class="bottom-bar"></div>
</header>
<header id="mobile-header">
<div class="header-contents">
<nav class="site-brand">
<div class="site-logo">
<a href="https://code.circuitpython.org/">
<img alt="CircuitPython Logo" height="40"
src="/images/logo.png"
srcset="/images/logo.png 1x,
/images/logo@2x.png 2x,
/images/logo@3x.png 3x" >
</a>
</div>
<div class="get-started">
<a class="github-repo" href="https://github.com/circuitpython/web-editor">
<i class="fa-brands fa-github"></i>
</a>
<button class="btn-connect">Connect</button>
</div>
</nav>
</div>
<div class="bottom-bar"></div>
</header>
<div id="main-content">
<div id="editor-page" class="active">
<div id="editor-bar">
<button class="purple-button btn-new">New<i class="fa-solid fa-plus"></i></button>
<button class="purple-button btn-open">Open<i class="fa-solid fa-folder-open"></i></button>
<button class="purple-button btn-save">Save<i class="fa-solid fa-floppy-disk"></i></button>
<button class="purple-button btn-save-as">Save As<i class="fa-solid fa-download"></i></button>
<div class="file-path"></div>
<button class="purple-button btn-save-run">Save + Run<i class="fa-solid fa-play"></i></button>
</div>
<div id="mobile-editor-bar">
<div id="mobile-menu">
<div class="menu-toggle">
<button id="mobile-menu-button">
<span class="sr-only">Open Mobile Menu</span>
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
</div>
</div>
<div class="file-path"></div>
<a class="purple-button btn-save-run">Save + Run<i class="fa-solid fa-play"></i></a>
<div class="clear"></div>
<nav id="mobile-menu-contents" role="navigation" class="hidden" aria-expanded="false" aria-label="Mobile Menu">
<ul>
<li><a class="btn-new">New<i class="fa-solid fa-plus"></i></a></li>
<li><a class="btn-open">Open<i class="fa-solid fa-folder-open"></i></a></li>
<li><a class="btn-save">Save<i class="fa-solid fa-floppy-disk"></i></a></li>
<li><a class="btn-save-as">Save As<i class="fa-solid fa-download"></i></a></li>
</ul>
</nav>
</div>
<div id="editor"></div>
</div>
<div id="page-separator" class=""></div>
<div id="serial-page" class="">
<div id="serial-bar">
<button class="purple-button btn-restart">Restart<i class="fa-solid fa-redo"></i></button>
<button class="purple-button btn-clear">Clear<i class="fa-solid fa-broom"></i></button>
<div id="terminal-title"></div>
</div>
<div id="terminal"></div>
</div>
</div>
<div id="footer-bar">
<button id="btn-mode-editor" class="mode-button active">Editor</button>
<button id="btn-mode-serial" class="mode-button">Serial</button>
<div class="spacer"></div>
<button class="purple-button btn-info" disabled>Info<i class="fa-solid fa-info-circle"></i></button>
</div>
</div>
<!-- Loading Animation -->
<div class="loader" id="loader">
<div>
<picture>
<source srcset="/images/loading-blinka.webp" type="image/webp">
<img src="/images/loading-blinka.gif" alt="Loading Animation" height="100" width="100">
</picture>
</div>
</div>
<!-- Dialog Box Templates -->
<div class="popup-modal shadow file-dialog closable" data-popup-modal="files">
<div class="buttons">
<button id="del-button" title="Delete Selected Folder or File" class="purple-button"><i class="fa-solid fa-trash-alt"></i></button>
<button id="rename-button" title="Rename Selected Folder or File" class="purple-button"><i class="fa-solid fa-pencil-alt"></i></button>
<button id="new-folder-button" title="Create New Folder in Current Folder" class="purple-button"><i class="fa-solid fa-folder-plus"></i></button>
<button id="upload-button" title="Upload to Current Folder" class="purple-button"><i class="fa-solid fa-upload"></i></button>
<button id="download-button" title="Download Folder or File" class="purple-button"><i class="fa-solid fa-download"></i></button>
<button id="move-button" title="Move Selected Folder or File" class="purple-button"><i class="fa-solid fa-file-export"></i></button>
</div>
<span id="current-path"></span>
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<div id="file-list"></div>
<div class="buttons">
<input type="text" id="filename" />
<button class="purple-button ok-button">Ok</button>
<button class="purple-button cancel-button">Cancel</button>
</div>
</div>
<div class="popup-modal shadow file-dialog closable" data-popup-modal="folder-select">
<span id="current-path"></span>
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<div id="file-list"></div>
<div class="buttons">
<input type="text" id="filename" />
<button class="purple-button ok-button">Ok</button>
<button class="purple-button cancel-button">Cancel</button>
</div>
</div>
<div class="popup-modal shadow prompt closable" data-popup-modal="unsaved">
<div id="message"></div>
<div class="buttons">
<button class="purple-button ok-button">Save</button>
<button class="purple-button not-ok-button">Don't Save</button>
<button class="purple-button cancel-button">Cancel</button>
</div>
</div>
<div class="popup-modal shadow prompt closable" data-popup-modal="upload-type">
<div id="message"></div>
<div class="buttons stacked">
<button id="upload-files" class="purple-button files-button" value="files">Upload Files<i class="fa-solid fa-file"></i></button>
<button id="upload-folders" class="purple-button folders-button" value="folders">Upload Folders<i class="fa-solid fa-folder"></i></button>
</div>
</div>
<div class="popup-modal shadow prompt closable" data-popup-modal="connection-type">
<div id="message"></div>
<div class="buttons stacked">
<button id="web-workflow" class="purple-button files-button" value="web">WiFi<i class="fa-solid fa-wifi"></i></button>
<button id="ble-workflow" class="purple-button files-button" value="ble">Bluetooth<i class="fa-brands fa-bluetooth-b"></i></button>
<button id="usb-workflow" class="purple-button files-button" value="usb">USB<i class="fa-brands fa-usb"></i></button>
</div>
</div>
<div class="popup-modal shadow prompt closable" data-popup-modal="message">
<div id="message"></div>
<div class="buttons centered">
<button class="purple-button ok-button">Ok</button>
</div>
</div>
<div class="popup-modal shadow prompt" data-popup-modal="progress" data-tabbable="false">
<div class="label centered" id="status"></div>
<div class="label centered" id="percentage"></div>
<progress value="0"></progress>
</div>
<div class="popup-modal shadow connect-dialog closable" data-popup-modal="ble-connect">
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<div id="ble-instructions" class="connection-layout content">
<p>If you are connecting to a new device, follow the steps below. Otherwise click the Reconnect button.</p>
<p><button class="purple-button" id="bleReconnect">Reconnect</button></p>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Web Bluetooth not available!</h1>
<p>Web Bluetooth is currently only supported in Chromium-based browsers.</p>
<p>On Linux only with older versions of Google Chrome, enable the experimental <a
href="about://flags/#enable-experimental-web-platform-features">about://flags/#enable-experimental-web-platform-features</a>
flag. However be careful as it would be risky to browse the web with this flag turned
on as it enables many other experimental web platform features. Starting with Chromium
version 100, enable the <a href="about://flags/#enable-web-bluetooth">about://flags/#enable-web-bluetooth</a>
safer flag instead.</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Request Bluetooth Device</h1>
<p>CircuitPython boards with <a href="https://circuitpython.org/downloads?features=Bluetooth%2FBTLE">nrf chips need
CircuitPython 7.0.0 or newer</a>. The first time a device is connected to your host,
you'll need to enable public broadcasting by pressing reset when the faster, blue blink
is happening on start up. The device will reset and the second, blue blink will be solid
when done successfully.</p>
<p>
<button class="purple-button" id="requestBluetoothDevice">Request Bluetooth Device</button>
</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Bond Device</h1>
<p>Once you are connected, we need to prompt a bond. Without this CircuitPython boards with
USB won't continue to advertise after a hard reset or powerloss. This button also loads
code.py from the device so click it even if the device has been connected before.</p>
<p>
<button class="purple-button" id="promptBond">Bond Bluetooth Device</button>
</p>
</div>
</section>
</div>
</div>
<div class="popup-modal shadow connect-dialog closable" data-popup-modal="web-connect">
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<div id="web-instructions" class="connection-layout content">
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Update CircuitPython</h1>
<p>Web Workflow is only available on CircuitPython boards with <a
href="https://circuitpython.org/downloads?mcufamilies=esp32&mcufamilies=esp32c3&mcufamilies=esp32s2&mcufamilies=esp32s3"
target="_blank">ESP chips running CircuitPython 8.0.0-beta.6 or newer</a>.</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Connect Device to the Internet</h1>
<p>To connect the device to your network, you will need to set up the settings.toml file on your device
and add your WiFi credentials. The <a href="https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor/device-setup"
target="_blank">CircuitPython Web Workflow Code Editor Quick Start Guide</a> has more details how to create
this file.</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Navigate to your Device</h1>
<p>Once your device is connected to your Local Area Network, you can navigate to
<a id="device-link" href="http://circuitpython.local/code/">http://circuitpython.local/code/</a>. This opens
a page on your device that loads this website onto the device and to avoid any cross domain security issues.</p>
</div>
</section>
</div>
</div>
<div class="popup-modal shadow connect-dialog closable" data-popup-modal="usb-connect">
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<div id="usb-instructions" class="connection-layout content">
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Web Serial not available!</h1>
<p>Web Serial is currently only supported in Chromium-based browsers.</p>
<p>For versions of Google Chrome between versions 78-89, Web Serial needs to manually be enabled. On recent browsers, this feature is enabled by default. If you are on an older version of the browser,
you may be able to enable Web Serial with the
<a href="about://flags/#enable-experimental-web-platform-features">about://flags/#enable-experimental-web-platform-features</a>
flag.</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Select Serial Device</h1>
<p>Connect to the Serial Port of your device. At this time, it will need to be enabled to continue.</p>
<p>
<button class="purple-button" id="requestSerialDevice">Connect to Device</button>
</p>
</div>
</section>
<section class="step">
<div class="step-number"></div>
<div class="step-content">
<h1>Select USB Host Folder</h1>
<p>Select the root folder of your device. This is typically the CIRCUITPY Drive on your computer unless you renamed it. If your device does not appear as a drive on your computer, it will need to have the USB Host functionality enabled.</p>
<p>
<button class="purple-button hidden" id="useHostFolder">Use <span id="workingFolder"></span></button>
<button class="purple-button first-item" id="selectHostFolder">Select New Folder</button>
</p>
</div>
</section>
</div>
</div>
<div class="popup-modal shadow closable" data-popup-modal="device-discovery">
<i class="fa-solid fa-2x fa-xmark text-white bg-primary p-3 popup-modal__close"></i>
<table class="device-info">
<thead>
<tr>
<th colspan="2">Current Device Info</th>
</tr>
</thead>
<tbody>
<tr>
<td>Board:</td>
<td><a id="board" target="_blank"></a></td>
</tr>
<tr>
<td>Version:</td>
<td><span id="version"></span></td>
</tr>
<tr>
<td>Hostname:</td>
<td><a id="hostname"></a></td>
</tr>
<tr>
<td>IP Address:</td>
<td><a id="ip"></a></td>
</tr>
</tbody>
</table>
<h3>More network devices<i class="refresh fa-solid fa-sync-alt" title="Refresh Device List"></i></h3>
<div id="devices"></div>
<div class="buttons centered">
<button class="purple-button ok-button">Close</button>
</div>
</div>
<script type="module" src="/js/script.js"></script>
</body>
</html>