Skip to content

Commit b3b040b

Browse files
committed
Merge branch 'dev' into main
2 parents 0870587 + 233601e commit b3b040b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4613
-1260
lines changed

.github/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Request
4+
url: https://github.com/codeitcodes/codeit/issues/new?labels=idea-feature
5+
about: Suggest an idea
6+
- name: Bug Report
7+
url: https://github.com/codeitcodes/codeit/issues/new?labels=bug&body=**What%20browser%20are%20you%20using%3F**%0A%0AFor%20example%3A%20Chrome%20or%20Safari%0A%0A**What%20operating%20system%20are%20you%20using%3F**%0A%0AFor%20example%3A%20Android%2C%20iOS%2C%20Windows%0A%0A**Describe%20your%20issue**%0A%0ADescribe%20the%20problem%20you're%20seeing%2C%20any%20important%20steps%20to%20reproduce%2C%20and%20what%20behavior%20you%20expect%20instead.
8+
about: Something isn't working

404.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html style="background:#000;height: 100%;">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>404 not found</title>
6+
<meta name="theme-color" content="#000">
7+
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover,shrink-to-fit=no">
8+
<link rel="shortcut icon" href="/icons/app-favicon.png">
9+
<style>
10+
.quote::before {
11+
content: '"';
12+
color: gray;
13+
opacity: 0.5;
14+
font-size: 50px;
15+
position: absolute;
16+
top: -40px;
17+
left: -8px;
18+
}
19+
</style>
20+
</head>
21+
<body style="
22+
display: flex;
23+
flex-flow: column;
24+
justify-content: center;
25+
height: 100%;
26+
margin: 0;
27+
color: #fff;
28+
font-family: system-ui;
29+
max-width: 500px;
30+
margin: auto;
31+
padding: 0 20px;
32+
" ontouchstart>
33+
<p style="
34+
font-size: 19px;
35+
line-height: 1.5;
36+
margin-bottom: 40px;
37+
margin-top: 0;
38+
position: relative;
39+
" class="quote">Of course everything in the world has been thought of. But what about everything that's not yet in the world? There's way more of that, and none of it's been thought of.</p>
40+
<p style="text-align:right;font-style:italic;color:gray;margin-top: 0;margin-bottom: 0;"><a style="
41+
color: hsl(0deg 0% 66%);
42+
">- Bill Wurtz</a><br><br>404 not found</p>
43+
</body>
44+
</html>

bottomfloat.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function updateFloat() {
3232
sidebarOpen.addEventListener('click', () => {
3333

3434
// if bottom float isn't expanded
35-
if (liveView.children.length == 0) {
35+
if (!liveView.querySelector('.live-frame')) {
3636

3737
toggleSidebar(true);
3838
saveSidebarStateLS();
@@ -89,6 +89,10 @@ pushWrapper.addEventListener('click', () => {
8989
})
9090

9191

92+
// download selected file on click of button
93+
floatDownload.addEventListener('click', downloadSelFile);
94+
95+
9296
// if on mobile
9397
if (isMobile) {
9498

codedrop.js

Lines changed: 110 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,102 @@
1-
21
function getFileLang(src) {
3-
4-
var EXTENSIONS = {
5-
'js': 'javascript',
6-
'py': 'python',
7-
'rb': 'ruby',
8-
'ps1': 'powershell',
9-
'psm1': 'powershell',
10-
'sh': 'bash',
11-
'bat': 'batch',
12-
'h': 'c',
13-
'tex': 'latex'
14-
};
2+
3+
var lang_aliases = /*aliases_placeholder[*/ {
4+
"html": "markup",
5+
"xml": "markup",
6+
"svg": "markup",
7+
"mathml": "markup",
8+
"ssml": "markup",
9+
"atom": "markup",
10+
"rss": "markup",
11+
"js": "javascript",
12+
"g4": "antlr4",
13+
"ino": "arduino",
14+
"adoc": "asciidoc",
15+
"avs": "avisynth",
16+
"avdl": "avro-idl",
17+
"shell": "bash",
18+
"shortcode": "bbcode",
19+
"rbnf": "bnf",
20+
"oscript": "bsl",
21+
"cs": "csharp",
22+
"dotnet": "csharp",
23+
"cfc": "cfscript",
24+
"coffee": "coffeescript",
25+
"conc": "concurnas",
26+
"jinja2": "django",
27+
"dns-zone": "dns-zone-file",
28+
"dockerfile": "docker",
29+
"gv": "dot",
30+
"eta": "ejs",
31+
"xlsx": "excel-formula",
32+
"xls": "excel-formula",
33+
"gamemakerlanguage": "gml",
34+
"gni": "gn",
35+
"go-mod": "go-module",
36+
"hbs": "handlebars",
37+
"hs": "haskell",
38+
"idr": "idris",
39+
"gitignore": "ignore",
40+
"hgignore": "ignore",
41+
"npmignore": "ignore",
42+
"webmanifest": "json",
43+
"kt": "kotlin",
44+
"kts": "kotlin",
45+
"kum": "kumir",
46+
"tex": "latex",
47+
"context": "latex",
48+
"ly": "lilypond",
49+
"emacs": "lisp",
50+
"elisp": "lisp",
51+
"emacs-lisp": "lisp",
52+
"md": "markdown",
53+
"moon": "moonscript",
54+
"n4jsd": "n4js",
55+
"nani": "naniscript",
56+
"objc": "objectivec",
57+
"qasm": "openqasm",
58+
"objectpascal": "pascal",
59+
"px": "pcaxis",
60+
"pcode": "peoplecode",
61+
"pq": "powerquery",
62+
"mscript": "powerquery",
63+
"pbfasm": "purebasic",
64+
"purs": "purescript",
65+
"py": "python",
66+
"qs": "qsharp",
67+
"rkt": "racket",
68+
"razor": "cshtml",
69+
"rpy": "renpy",
70+
"robot": "robotframework",
71+
"rb": "ruby",
72+
"sh-session": "shell-session",
73+
"shellsession": "shell-session",
74+
"smlnj": "sml",
75+
"sol": "solidity",
76+
"sln": "solution-file",
77+
"rq": "sparql",
78+
"t4": "t4-cs",
79+
"trickle": "tremor",
80+
"troy": "tremor",
81+
"trig": "turtle",
82+
"ts": "typescript",
83+
"tsconfig": "typoscript",
84+
"uscript": "unrealscript",
85+
"uc": "unrealscript",
86+
"url": "uri",
87+
"vb": "visual-basic",
88+
"vba": "visual-basic",
89+
"webidl": "web-idl",
90+
"mathematica": "wolfram",
91+
"nb": "wolfram",
92+
"wl": "wolfram",
93+
"xeoracube": "xeora",
94+
"yml": "yaml"
95+
} /*]*/ ;
1596

1697
src = src.replaceAll('\n', '');
17-
1898
const extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
19-
return EXTENSIONS[extension] || extension;
99+
return lang_aliases[extension] || extension;
20100

21101
}
22102

@@ -30,6 +110,17 @@ function processFile(file) {
30110
cd.textContent = event.target.result;
31111
cd.lang = getFileLang(file.name);
32112
cd.focus();
113+
114+
// change tab character
115+
if (cd.textContent.includes('\t')) {
116+
117+
cd.options.tab = '\t';
118+
119+
} else {
120+
121+
cd.options.tab = ' ';
122+
123+
}
33124

34125
cd.history = [];
35126

@@ -52,7 +143,7 @@ cd.on('drop', (ev) => {
52143
ev.preventDefault();
53144

54145
// if not logged into git
55-
if (gitToken == null) {
146+
if (gitToken == '') {
56147

57148
// remove drop indication
58149
document.body.classList.remove('focus');
@@ -93,7 +184,7 @@ cd.on('dragover', (ev) => {
93184
ev.preventDefault();
94185

95186
// if not logged into git
96-
if (gitToken == null) {
187+
if (gitToken == '') {
97188

98189
// show drop indication
99190
document.body.classList.add('focus');
@@ -105,7 +196,7 @@ cd.on('dragover', (ev) => {
105196
cd.on('dragleave', (ev) => {
106197

107198
// if not logged into git
108-
if (gitToken == null) {
199+
if (gitToken == '') {
109200

110201
// remove drop indication
111202
document.body.classList.remove('focus');
@@ -119,7 +210,7 @@ if ('launchQueue' in window) {
119210
launchQueue.setConsumer(async (launchParams) => {
120211

121212
// if not logged into git
122-
if (gitToken == null) {
213+
if (gitToken == '') {
123214

124215
// nothing to do when the queue is empty
125216
if (!launchParams.files.length) {

0 commit comments

Comments
 (0)