Skip to content

Commit 10f0079

Browse files
authored
Merge pull request #160 from codeitcodes/dev
Dev
2 parents 6ea7f87 + 5938a43 commit 10f0079

File tree

6 files changed

+41
-25
lines changed

6 files changed

+41
-25
lines changed

filebrowser.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,10 +2261,22 @@ learnShare.addEventListener('click', () => {
22612261

22622262
const invite = 'Hey, I\'m using Codeit to code. It\'s a mobile code editor connected to Git. Join me! ' + window.location.origin;
22632263

2264-
// copy invite to clipboard
2265-
copy(invite).then(() => {
2266-
showMessage('Copied invite!');
2267-
});
2264+
if (isMobile) {
2265+
2266+
// share invite
2267+
navigator.share({
2268+
title: 'Share Codeit',
2269+
text: invite
2270+
});
2271+
2272+
} else {
2273+
2274+
// copy invite to clipboard
2275+
copy(invite).then(() => {
2276+
showMessage('Copied invite!');
2277+
});
2278+
2279+
}
22682280

22692281
})
22702282

full.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,12 +1302,12 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
13021302
animation: lock-click .14s .124s var(--ease-function);
13031303
}
13041304

1305-
.sidebar .repo .lock.locked #housing-fill {
1306-
fill: currentColor;
1305+
.sidebar .repo .lock:not(.locked) #housing-fill {
1306+
opacity: 0 !important;
13071307
}
13081308

13091309
.sidebar .repo .lock.locked #plug {
1310-
fill: transparent;
1310+
opacity: 0 !important;
13111311
}
13121312

13131313
@keyframes lock-click {

live-view/live-view.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,10 @@ function addBottomSwipeListener() {
440440
file: selectedFile,
441441
openLive: true
442442
});
443-
444-
copy(link).then(() => {
445-
showMessage('Copied link!');
443+
444+
navigator.share({
445+
title: 'Run ' + treeLoc[0] + '/' + treeLoc[1].split(':')[0] + ' with Codeit',
446+
url: link,
446447
});
447448

448449
}
@@ -451,6 +452,7 @@ function addBottomSwipeListener() {
451452

452453
yOffset = 0;
453454
active = false;
455+
swiped = false;
454456

455457
}
456458

@@ -476,7 +478,8 @@ function addBottomSwipeListener() {
476478
}
477479

478480
// check if passed swipe boundary
479-
if (Math.abs(yOffset) > yBoundary) {
481+
if (Math.abs(yOffset) > yBoundary
482+
|| swiped) {
480483
swiped = true;
481484
} else {
482485
swiped = false;
@@ -503,12 +506,8 @@ function addBottomSwipeListener() {
503506

504507
}
505508

506-
toggleLiveView(selectedFile);
507-
508-
// wait until animation has ended to enable swiping
509-
window.setTimeout(() => {
510-
swiped = false;
511-
}, 400);
509+
// if live view is closed
510+
if (!liveViewToggle) toggleLiveView(selectedFile);
512511

513512
}
514513

@@ -544,13 +543,9 @@ function addBottomSwipeListener() {
544543

545544
}
546545

547-
toggleLiveView(selectedFile);
546+
// if live view is open
547+
if (liveViewToggle) toggleLiveView(selectedFile);
548548

549-
// wait until animation has ended to enable swiping
550-
window.setTimeout(() => {
551-
swiped = false;
552-
}, 400);
553-
554549
}
555550

556551
}

utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ const lockIcon = `
661661
<path id="shackle" d="M9,8.834L9,6C9,4.34 10.34,3 12,3C13.66,3 15,4.34 15,6L15,8.834L9,8.834Z" fill="none"></path>
662662
</g>
663663
<path id="housing" d="M18.026 8H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10a2.006 2.006 0 0 0-1.974-2ZM18 19c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v8Z"></path>
664-
<path id="housing-fill" d="M18 19c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v8Zm-6-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z" fill="transparent"></path>
664+
<path id="housing-fill" d="M18 19c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1h10c.55 0 1 .45 1 1v8Zm-6-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z"></path>
665665
<path id="plug" d="M12 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z"></path>
666666
<path id="bounding-box" fill="none" d="M0 0h24v24H0z"></path>
667667
</g>

worker/client-channel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
// update worker name when updating worker
7-
const WORKER_NAME = 'codeit-worker-v523';
7+
const WORKER_NAME = 'codeit-worker-v525';
88

99

1010
// internal paths
@@ -166,6 +166,7 @@ let enableDevLogs = false;
166166

167167
workerChannel.addEventListener('message', (event) => {
168168

169+
if (event.data.type === 'updateWorker') self.registration.update();
169170
if (event.data.type === 'enableDevLogs') enableDevLogs = true;
170171
if (event.data.type === 'hello') workerChannel.postMessage('hello!');
171172

worker/worker-channel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ async function setupWorkerChannel() {
117117

118118
}
119119

120+
if (window.location.hostname === 'dev.codeit.codes') {
121+
122+
workerChannel.postMessage({
123+
type: 'updateWorker'
124+
});
125+
126+
}
127+
120128
});
121129

122130
}

0 commit comments

Comments
 (0)