Skip to content

Commit e6f1a2b

Browse files
authored
Merge pull request #6771 from tannewt/ww_online_code_editor
Add /code/ for online editing
2 parents 4b1d1fd + 525eb71 commit e6f1a2b

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Online Code Editor</title>
7+
</head>
8+
9+
<body>
10+
<script type="module" src="https://code.circuitpython.org/assets/js/device.js"></script>
11+
</body>
12+
</html>

supervisor/shared/web_workflow/static/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Code Edit</title>
5+
<title>Offline Code Edit</title>
66
<link rel="stylesheet" href="http://circuitpython.org/assets/css/webworkflow-8.css">
77
<link rel="stylesheet" href="/style.css">
88
</head>

supervisor/shared/web_workflow/web_workflow.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *req
926926

927927
#define STATIC_FILE(filename) extern uint32_t filename##_length; extern uint8_t filename[]; extern const char *filename##_content_type;
928928

929+
STATIC_FILE(code_html);
929930
STATIC_FILE(directory_html);
930931
STATIC_FILE(directory_js);
931932
STATIC_FILE(welcome_html);
@@ -1143,6 +1144,8 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) {
11431144
} else {
11441145
_REPLY_STATIC(socket, request, edit_html);
11451146
}
1147+
} else if (strcmp(request->path, "/code/") == 0) {
1148+
_REPLY_STATIC(socket, request, code_html);
11461149
} else if (strncmp(request->path, "/cp/", 4) == 0) {
11471150
const char *path = request->path + 3;
11481151
if (strcasecmp(request->method, "OPTIONS") == 0) {

0 commit comments

Comments
 (0)