-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
359 lines (355 loc) · 12.6 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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://okraleditor.glitch.me/" />
<meta property="og:title" content="Okral Code Editor | Created by Okerew" />
<meta
property="og:description"
content="Okral Code Editor is a coding editor created by Okerew, with features such as git integration, collab integration, remote servers, basic feautures, syntax highlighting, basic code completion and more."
/>
<meta
property="og:image"
content="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/bitmap.png?v=1712415155543"
/>
<title>Okral Code Editor</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.9/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.9/ext-language_tools.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.1.0/purify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-html.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.15.1/beautify-css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.5/socket.io.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/esprima.min.js"></script>
<script src="/script.js" defer></script>
<link rel="stylesheet" href="style.css" />
<link
rel="icon"
href="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/bitmap.png?v=1712415155543"
/>
</head>
<body>
<div class="navbar">
<select id="language-select">
<option value="text">Select a language</option>
<option value="javascript">JavaScript</option>
<option value="html">HTML</option>
<option value="css">CSS</option>
<option value="php">PHP</option>
<option value="sql">SQL</option>
<option value="markdown">Markdown</option>
<option value="dockerfile">Docker File</option>
<option value="json">JSON</option>
<option value="jsx">JSX</option>
<option value="mysql">MySql</option>
<option value="graphqlschema">GraphQL</option>
<option value="python">Python</option>
<option value="c_cpp">C++</option>
<option value="pgsql">Postgres</option>
<option value="yaml">Yaml</option>
<option value="golang">Go</option>
<option value="kotlin">Kotlin</option>
</select>
<button onclick="fileOps()">
<img
class="n_icon"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/files.svg?v=1718201369975"
alt="files"
/>
Files
</button>
<a href="https://okral.glitch.me"
><img
class="n_icon"
alt="Download"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/7623247_arrow_down_download_essential_download%20icon_icon.png?v=1718119372571"
/>
Download
</a>
<a href="https://github.com/Okerew/okraleditor/wiki"
><img
class="n_icon"
alt="Help"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/3937344_help_helpdesk_info_information_question_icon.png?v=1718119337173"
/>
Help
</a>
<button onclick="openSettings()">
<img
class="n_icon"
alt="settings"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/settings-svgrepo-com.png?v=1718119957148"
/>
Settings
</button>
<button onclick="runCode()">
<img
class="n_icon"
alt="run"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/debug-alt-svgrepo-com(1).png?v=1718119788062"
/>
Run
</button>
<button onclick="gitOps()">
<img
class="n_icon"
alt="git"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/9041208_git_icon.png?v=1718119096710"
/>
Git
</button>
<button onclick="loadExtensions()">
<img
class="n_icon"
alt="extensions"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/add-ons-svgrepo-com.png?v=1718119842796"
/>
Extensions
</button>
<button onclick="shareWorkspace()">
<img
class="n_icon"
alt="share"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/share-svgrepo-com.png?v=1718120049222"
/>
Share
</button>
<button onclick="beautifyCode()">
<img
class="n_icon"
alt="prettier"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/prettier-svgrepo-com.svg?v=1718120177640"
/>
Prettier
</button>
<button onclick="connectToCollaborativeServer()">
<img
class="n_icon"
alt="collab"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/live-share-svgrepo-com.svg?v=1718120045898"
/>
Collab
</button>
<button onclick="loadCodeSnippet()">
<img
class="n_icon"
alt="code_snippets"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/snippets.svg?v=1718125931651"
/>
Snippets
</button>
<button onclick="snapOps()">
<img
class="n_icon"
alt="editor_snapshot"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/snapshot.svg?v=1718219860500"
/>
Snapsohts
</button>
<button onclick="loadServerFiles()">
<img
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/remote-svgrepo-com.svg?v=1718630857189"
class="n_icon"
alt="remote_server"
/>
Remote
</button>
<button onclick="createDatabaseForm()">
<img
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/database-svgrepo-com(1).svg?v=1720206047667"
class="n_icon"
alt="databases"
/>
Databases
</button>
<button onclick="kubernetesOps()">
<img
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/kubernetes.svg?v=1720371964372"
class="n_icon"
alt="kubernetes"
/>
Kubernetes
</button>
<button onclick="chatOps()">
<img
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/hubot-svgrepo-com.svg?v=1722957656521"
class="n_icon"
alt="chatbot"
/>
Chatbot
</button>
<button onclick="executeDockerOperation()"><img src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/docker.svg?v=1723136091344" class="n_icon" alt="docker"> Docker</button>
</div>
<h1>Okral Code Editor</h1>
<div class="tabBar" id="tabBar">
<button id="closeActiveTab">Close Active Tab</button>
<button onclick="addTab()">Add Tab</button>
</div>
<div id="editor"></div>
<div id="settingsModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeSettings()">×</span>
<h2>Settings</h2>
<label>Darkmode/Lightmode</label>
<button onclick="toggleTheme()">Toggle</button>
<br /><br />
<label>Config</label>
<button onclick="saveToCookie()">Save</button>
<br /><br />
<label>Zen</label>
<button onclick="toggleZenMode()">Mode</button>
<br /><br />
<a href="https://github.com/Okerew/okraleditor/wiki/Keybinds"
>Keybinds</a
>
<br /><br />
<label>Split</label>
<button onclick="toggleSplitView()">Toggle</button>
</div>
</div>
<div id="fileModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closefileOps()">×</span>
<h2>
File
</h2>
<label>File</label>
<input
type="file"
id="fileInput"
accept=""
onchange="openFile(event)"
/>
<br />
<label>File</label>
<button onclick="saveFile()">Save</button>
<br />
<label>File Structure</label>
<button onclick="removeStructure()">Remove</button>
<br />
<label>Remote File</label>
<button onclick="saveRemoteActiveFile()">Save</button>
<br />
<label>Remote File Tree</label>
<button onclick="remoteFileTree()">Show/Hide</button>
</div>
</div>
<div id="runModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeRunCode()">×</span>
<h2>
Run
</h2>
<label>HTML</label>
<button onclick="executeHtmlCode()">Run</button>
<br>
<label>Show/Hide</label>
<button onclick="htmlOutput()">Output</button>
<br />
<label>Markdown</label>
<button onclick="runMarkdown()">Run</button>
<br />
<br>
<label>JavaScript</label>
<button onclick="executeCodeInWorker()">Run</button>
<br />
<label>Python</label>
<button onclick="executePythonCode()">Run</button>
<br />
<label>C++</label>
<button onclick="executeCppCode()">Run</button>
<br>
<label>HTTP request</label>
<button onclick="executeHttpRequests()">
Run
</button>
<br>
<label>Remote File</label>
<button onclick="executeRemoteActiveFile()">Run</button>
<br />
<label>Sql Output</label>
<button onclick="sqlOutput()">Show/Hide</button>
</div>
</div>
<div id="gitModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeGitOps()">×</span>
<h2>
Git
</h2>
<label>Git</label>
<button onclick="pushToGithub()">Push</button>
<br /><br />
<label>Git</label>
<button onclick="loadRepoFiles()">Clone</button>
<br /><br />
<label>Git</label>
<button onclick="mergeBranches()">Merge</button>
<br /><br />
<label>Git File Tree</label>
<button onclick="hideFileTree()">Show/Hide</button>
<br /><br />
<label>Git</label>
<button onclick="pushAllToGithub()">Push All</button>
</div>
</div>
<div id="snippetModal" class="modal">
<div class="modal-content">
<span onclick="closeSnipetOps()" class="close">×</span>
<h2>
Snapshots
</h2>
<button onclick="saveCodeSnippet()">Save Snippet</button>
<h2>Saved Snippets</h2>
<ul id="snippetList"></ul>
</div>
</div>
<div id="snapshotModal" class="modal">
<div class="modal-content">
<span onclick="hideSnapOps()" class="close">×</span>
<h2>Editor Snapshots</h2>
<ul id="snapshotList"></ul>
</div>
</div>
<div id="chatbotModal" class="modal">
<div class="modal-content">
<span onclick="hideChatOps()" class="close">×</span>
<h2>Ai Chatbot</h2>
<div>
<textarea
placeholder="Enter url of the chatbot server"
id="chatbot-url"
rows="1"
>
https://3cea9b40-82e9-4c0e-b1b9-50816c1bd3d6-00-1fvj2t34qbik8.worf.replit.dev/chat</textarea
>
<div id="chat-container"></div>
<div class="prompt">
<textarea
id="chatbot-user-input"
rows="2"
placeholder="Enter your prompt here..."
></textarea>
<button id="chatbot-send-button">
Send
<img
class="send_icon"
src="https://cdn.glitch.global/08dad197-ffa7-4cdd-b579-683ad1281936/send-svgrepo-com.svg?v=1722957088895"
alt="send"
/>
</button>
</div>
</div>
</div>
</div>
<div id="output-container"></div>
<div id="sqlResultContainer"></div>
<div id="kubernetesResultContainer"></div>
<div id="formContainer"></div>
<script src="parsers.js"></script>
<script src="chatbot.js"></script>
</body>
</html>