From 8a1b22a29236036387e121dc475a3cd308a2f084 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 16:46:21 +0200
Subject: [PATCH 01/85] Update filebrowser.js
---
filebrowser.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index ddf8b317a6..365ec1959c 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2797,7 +2797,7 @@ function toggleSidebar(open) {
}
-function deleteModFileInHTML(fileEl) {
+async function deleteModFileInHTML(fileEl) {
const fileSha = getAttr(fileEl, 'sha');
@@ -2807,7 +2807,15 @@ function deleteModFileInHTML(fileEl) {
if (fileEl.classList.contains('selected')) {
- loadFileInHTML(fileEl, fileSha);
+ const scrollPos = selectedFile.scrollPos;
+
+ await loadFileInHTML(fileEl, fileSha);
+
+ // prevent bottom float disappearing on mobile
+ if (isMobile) lastScrollTop = scrollPos[1];
+
+ // scroll to pos in code
+ cd.scrollTo(scrollPos[0], scrollPos[1]);
}
From 56ba2067b2d94c9a80af14ebb510211c8abb655f Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 16:56:15 +0200
Subject: [PATCH 02/85] Update codeit.js
---
lib/codeit.js | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index b45128d790..4c33e62ae9 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -621,29 +621,39 @@ class CodeitElement extends HTMLElement {
if (selContents.includes('\n')) {
- // tab lines in selection
+ // add tabs to selection string
selContents = cd.options.tab + selContents.split('\n').join('\n' + cd.options.tab);
- // insert tabbed selection
+ // delete selection
cd.deleteCurrentSelection();
- cd.insert(selContents);
+
+ // insert tabbed selection
+ cd.insert(selContents, { moveToEnd: false });
+
+ // get caret pos in text
+ const pos = cd.getSelection();
+
+ // restore pos in text
+ cd.setSelection(pos.start, (pos.start + selContents.length));
} else {
// tab selection
- const sel = cd.getSelection();
- cd.setSelection(Math.min(sel.start, sel.end));
+ // get caret pos in text
+ const pos = cd.getSelection();
+
+ cd.setSelection(Math.min(pos.start, pos.end));
// insert tab at start of selection
- cd.insert(cd.options.tab);
+ cd.insert(cd.options.tab, { moveToEnd: false });
- // reselect text
+ // restore pos in text
- sel.start += cd.options.tab.length;
- sel.end += cd.options.tab.length;
+ pos.start += cd.options.tab.length;
+ pos.end += cd.options.tab.length;
- cd.setSelection(sel.start, sel.end);
+ cd.setSelection(pos.start, pos.end);
}
From 13994bfb69e914ed32b96b194bbbf4e9ea59ffc9 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 16:56:55 +0200
Subject: [PATCH 03/85] Update codeit.js
---
lib/codeit.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 4c33e62ae9..5096e2175e 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -649,11 +649,7 @@ class CodeitElement extends HTMLElement {
cd.insert(cd.options.tab, { moveToEnd: false });
// restore pos in text
-
- pos.start += cd.options.tab.length;
- pos.end += cd.options.tab.length;
-
- cd.setSelection(pos.start, pos.end);
+ cd.setSelection(pos.start, pos.end + cd.options.tab.length);
}
From 9e0b757184936a03ac2e2bc96b781336e037f83f Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:00:33 +0200
Subject: [PATCH 04/85] Update codeit.js
---
lib/codeit.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 5096e2175e..29f9b1bd68 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -643,13 +643,16 @@ class CodeitElement extends HTMLElement {
// get caret pos in text
const pos = cd.getSelection();
- cd.setSelection(Math.min(pos.start, pos.end));
+ const start = Math.min(pos.start, pos.end);
+ const end = Math.max(pos.start, pos.end);
+
+ cd.setSelection(start);
// insert tab at start of selection
cd.insert(cd.options.tab, { moveToEnd: false });
// restore pos in text
- cd.setSelection(pos.start, pos.end + cd.options.tab.length);
+ cd.setSelection(start, end + cd.options.tab.length);
}
From 5919f7ccf4de76ad97ba01624fe3d9d5d21ceecb Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:06:53 +0200
Subject: [PATCH 05/85] Update codeit.js
---
lib/codeit.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 29f9b1bd68..b257b4e0a2 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -583,29 +583,34 @@ class CodeitElement extends HTMLElement {
if (event.shiftKey) {
+ // delete a tab from selection
+
const before = cd.beforeCursor();
// get padding of line
- let [padding, start] = getPadding(before);
+ let [linePadding, lineStartPos] = getPadding(before);
// get caret pos in text
- let pos = cd.getSelection();
+ const pos = cd.getSelection();
+ const startPos = Math.min(pos.start, pos.end);
+ const endPos = Math.max(pos.start, pos.end);
+
if (padding.length > 0) {
const tabLength = cd.options.tab.length;
- // remove full length tab
+ // delete a tab
- cd.setSelection(start + tabLength);
+ cd.setSelection(lineStartPos, lineStartPos + tabLength);
- for (let i = 0; i < tabLength; i++) cd.deleteCurrentSelection();
+ cd.deleteCurrentSelection();
pos.start -= tabLength;
pos.end -= tabLength;
// restore pos in text
- cd.setSelection(pos.start, pos.end);
+ cd.setSelection(startPos, endPos - tabLength);
}
From b5ee34825914678935e19900fa5fde21b4270d20 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:08:03 +0200
Subject: [PATCH 06/85] Update codeit.js
---
lib/codeit.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index b257b4e0a2..a5388b6eb7 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -596,19 +596,17 @@ class CodeitElement extends HTMLElement {
const startPos = Math.min(pos.start, pos.end);
const endPos = Math.max(pos.start, pos.end);
+ // if line has tabs
if (padding.length > 0) {
- const tabLength = cd.options.tab.length;
-
// delete a tab
+
+ const tabLength = cd.options.tab.length;
cd.setSelection(lineStartPos, lineStartPos + tabLength);
cd.deleteCurrentSelection();
- pos.start -= tabLength;
- pos.end -= tabLength;
-
// restore pos in text
cd.setSelection(startPos, endPos - tabLength);
From 6ba1679d45cbbe11238b6863eccdbe1118117f35 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:08:29 +0200
Subject: [PATCH 07/85] Update codeit.js
---
lib/codeit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index a5388b6eb7..d729941b81 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -597,7 +597,7 @@ class CodeitElement extends HTMLElement {
const endPos = Math.max(pos.start, pos.end);
// if line has tabs
- if (padding.length > 0) {
+ if (linePadding.length > 0) {
// delete a tab
From 4b4ab3c8f080b20448cccc343290055f9b175f90 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:09:39 +0200
Subject: [PATCH 08/85] Update codeit.js
---
lib/codeit.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index d729941b81..d649a09b48 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -606,9 +606,12 @@ class CodeitElement extends HTMLElement {
cd.setSelection(lineStartPos, lineStartPos + tabLength);
cd.deleteCurrentSelection();
-
+
+ startPos -= tabLength;
+ endPos -= tabLength;
+
// restore pos in text
- cd.setSelection(startPos, endPos - tabLength);
+ cd.setSelection(startPos, endPos);
}
From 58e9393a62889e9aefd5f6e0d5f4d7ee9df0080a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:10:08 +0200
Subject: [PATCH 09/85] Update codeit.js
---
lib/codeit.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index d649a09b48..c6a29594ee 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -593,8 +593,8 @@ class CodeitElement extends HTMLElement {
// get caret pos in text
const pos = cd.getSelection();
- const startPos = Math.min(pos.start, pos.end);
- const endPos = Math.max(pos.start, pos.end);
+ let startPos = Math.min(pos.start, pos.end);
+ let endPos = Math.max(pos.start, pos.end);
// if line has tabs
if (linePadding.length > 0) {
From 7f93c95c6f54a9516a3f7fae9d375d62eb01fc8c Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:16:52 +0200
Subject: [PATCH 10/85] Update codeit.js
---
lib/codeit.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index c6a29594ee..ba0d8ce863 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -602,16 +602,16 @@ class CodeitElement extends HTMLElement {
// delete a tab
const tabLength = cd.options.tab.length;
+
+ const tempEndPos = lineStartPos + linePadding.length;
+ const tempStartPos = tempEndPos - tabLength;
- cd.setSelection(lineStartPos, lineStartPos + tabLength);
+ cd.setSelection(tempStartPos, tempEndPos);
cd.deleteCurrentSelection();
- startPos -= tabLength;
- endPos -= tabLength;
-
// restore pos in text
- cd.setSelection(startPos, endPos);
+ cd.setSelection(tempStartPos, endPos - tabLength);
}
From 0ad66ea1fd270e6d6cdffd20e665635b3e913509 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:19:46 +0200
Subject: [PATCH 11/85] Update codeit.js
---
lib/codeit.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index ba0d8ce863..2d3e5d4d45 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -602,16 +602,13 @@ class CodeitElement extends HTMLElement {
// delete a tab
const tabLength = cd.options.tab.length;
-
- const tempEndPos = lineStartPos + linePadding.length;
- const tempStartPos = tempEndPos - tabLength;
- cd.setSelection(tempStartPos, tempEndPos);
+ cd.setSelection(lineStartPos, lineStartPos + tabLength);
cd.deleteCurrentSelection();
// restore pos in text
- cd.setSelection(tempStartPos, endPos - tabLength);
+ cd.setSelection(lineStartPos + linePadding.length - tabLength, endPos - tabLength);
}
From e7ca144e8dfec6d3f41adadf1cc5bd2260db475a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:20:18 +0200
Subject: [PATCH 12/85] Update codeit.js
---
lib/codeit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 2d3e5d4d45..565702dd5c 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -608,7 +608,7 @@ class CodeitElement extends HTMLElement {
cd.deleteCurrentSelection();
// restore pos in text
- cd.setSelection(lineStartPos + linePadding.length - tabLength, endPos - tabLength);
+ cd.setSelection(lineStartPos + linePadding.length, endPos - tabLength);
}
From e72e04229eea6afe0b0b02ed9d911d124160c5bd Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:52:59 +0200
Subject: [PATCH 13/85] Update codeit.js
---
lib/codeit.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 565702dd5c..1cf72cd852 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -608,8 +608,17 @@ class CodeitElement extends HTMLElement {
cd.deleteCurrentSelection();
// restore pos in text
- cd.setSelection(lineStartPos + linePadding.length, endPos - tabLength);
+ cd.setSelection(lineStartPos + linePadding.length - tabLength, endPos - tabLength);
+ const selectedTab = window.getSelection().toString().startsWith(cd.options.tab);
+
+ if (selectedTab) {
+
+ // restore pos in text
+ cd.setSelection(lineStartPos + linePadding.length, endPos - tabLength);
+
+ }
+
}
} else {
From aa15c2db5b82a12d23a74e3a4e9e1197a68058d7 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:55:53 +0200
Subject: [PATCH 14/85] Update codeit.js
---
lib/codeit.js | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 1cf72cd852..87b68d8d17 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -585,17 +585,21 @@ class CodeitElement extends HTMLElement {
// delete a tab from selection
- const before = cd.beforeCursor();
-
- // get padding of line
- let [linePadding, lineStartPos] = getPadding(before);
-
// get caret pos in text
const pos = cd.getSelection();
let startPos = Math.min(pos.start, pos.end);
let endPos = Math.max(pos.start, pos.end);
+ // get text before cursor
+
+ cd.setSelection(endPos);
+
+ const before = cd.beforeCursor();
+
+ // get padding of line
+ let [linePadding, lineStartPos] = getPadding(before);
+
// if line has tabs
if (linePadding.length > 0) {
From 6c483d0d2460979e31557f190ef6dcd5750e78a9 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 17:58:15 +0200
Subject: [PATCH 15/85] Update codeit.js
---
lib/codeit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index 87b68d8d17..dd75bb298c 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -1,7 +1,7 @@
/*
codeit.js
- v3.1.1
+ v3.1.2
MIT License
https://codeit.codes
From 6834dc1864403b9d5581a36271a5458a667d9761 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:02:15 +0200
Subject: [PATCH 16/85] Update filebrowser.js
---
filebrowser.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 365ec1959c..75eb1a0de1 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -3173,7 +3173,14 @@ function setupEditor() {
// beautify
beautifierOptions.indent_char = cd.options.tab[0];
- const beautifiedText = beautifyLang(selText, beautifierOptions);
+ let beautifiedText = beautifyLang(selText, beautifierOptions);
+
+ // prevent deleting ending newline when beautifying
+ if (selText.endsWith('\n') && !beautifiedText.endsWith('\n')) {
+
+ beautifiedText += '\n';
+
+ }
// compare current code with new code
// if the code is different, swap it
From 176944274167417c80428e1090d732ea1e0bbab5 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:06:08 +0200
Subject: [PATCH 17/85] Update filebrowser.js
---
filebrowser.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/filebrowser.js b/filebrowser.js
index 75eb1a0de1..ef179eab58 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -3163,6 +3163,7 @@ function setupEditor() {
// get selection language
let selLang = Prism.util.getLanguage(cursorEl);
if (selLang == 'javascript') selLang = 'js';
+ if (selLang == 'json') selLang = 'js';
if (selLang == 'markup') selLang = 'html';
// find syntax for language
From 2423993d62e4d07e0e1057701d01b3ed04902308 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:14:06 +0200
Subject: [PATCH 18/85] Update filebrowser.js
---
filebrowser.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index ef179eab58..30ab4ed276 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2801,7 +2801,9 @@ async function deleteModFileInHTML(fileEl) {
const fileSha = getAttr(fileEl, 'sha');
- deleteModFile(fileSha);
+ const modFile = getLatestVersion(modifiedFiles[fileSha]);
+
+ deleteModFile(modFile.sha);
fileEl.classList.remove('modified');
From 6dcef62f54b48470b6320476ac2659b72c8094cd Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:24:04 +0200
Subject: [PATCH 19/85] Update filebrowser.js
---
filebrowser.js | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 30ab4ed276..8105f7b62f 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2801,10 +2801,24 @@ async function deleteModFileInHTML(fileEl) {
const fileSha = getAttr(fileEl, 'sha');
- const modFile = getLatestVersion(modifiedFiles[fileSha]);
+ let modFile = modifiedFiles[fileSha];
+
+ // if file is eclipsed
+ if (fileSha !== modFile.sha) {
+
+ showMessage('Discarding changes...', -1);
+
+ if (pendingPromise) await pendingPromise;
+
+ hideMessage();
+
+ modFile = getLatestVersion(modFile);
+
+ }
deleteModFile(modFile.sha);
+
fileEl.classList.remove('modified');
if (fileEl.classList.contains('selected')) {
From 2ceb76c6aea74d86b900a5c891801c04f2caffb6 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:27:37 +0200
Subject: [PATCH 20/85] Update filebrowser.js
---
filebrowser.js | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 8105f7b62f..2185bad4b2 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2799,24 +2799,23 @@ function toggleSidebar(open) {
async function deleteModFileInHTML(fileEl) {
- const fileSha = getAttr(fileEl, 'sha');
-
- let modFile = modifiedFiles[fileSha];
-
- // if file is eclipsed
- if (fileSha !== modFile.sha) {
+ let fileSha = getAttr(fileEl, 'sha');
+
+ // if pushing file
+ if (pendingPromise) {
showMessage('Discarding changes...', -1);
- if (pendingPromise) await pendingPromise;
+ await pendingPromise;
hideMessage();
- modFile = getLatestVersion(modFile);
+ // get updated file sha
+ fileSha = getAttr(fileEl, 'sha');
}
- deleteModFile(modFile.sha);
+ deleteModFile(fileSha);
fileEl.classList.remove('modified');
From f1665ea12ad7f8be5acfdefee54fd336d3ab8c46 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:27:53 +0200
Subject: [PATCH 21/85] Update filebrowser.js
---
filebrowser.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/filebrowser.js b/filebrowser.js
index 2185bad4b2..9c14d19c48 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2806,6 +2806,7 @@ async function deleteModFileInHTML(fileEl) {
showMessage('Discarding changes...', -1);
+ // await pending promise
await pendingPromise;
hideMessage();
From 3d6338162f7c2e71baf3ceca8f550213d61c9cd1 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:45:13 +0200
Subject: [PATCH 22/85] Update gitapi.js
---
git/gitapi.js | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 8543f2b27b..39491a6724 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -1,19 +1,33 @@
// change pushing state
-let pendingPromise;
+let pendingPromises = {
+ createRepo: null,
+ pushFile: null,
+ fetchRepoObj: null
+};
-function changePushingState(to, pendingPromise) {
+function changePushingState(to, promiseType, promise) {
if (to === true) {
-
- pendingPromise = pendingPromise ?? null;
+
+ if (promiseType && promise) {
+
+ pendingPromises[promiseType] = promise;
+
+ }
window.addEventListener('beforeunload', beforeUnloadListener, {capture: true});
} else {
-
- pendingPromise = null;
+
+ // clear pending promise
+ if (promiseType &&
+ promise === pendingPromises[promiseType]) {
+
+ pendingPromises[promiseType] = null;
+
+ }
window.removeEventListener('beforeunload', beforeUnloadListener, {capture: true});
@@ -259,13 +273,13 @@ let git = {
// change pushing state
- changePushingState(true);
+ changePushingState(true, 'pushFile', postRequest);
// put the query
const resp = await axios.put(query, gitToken, commitData);
// change pushing state
- changePushingState(false);
+ changePushingState(false, 'pushFile', postRequest);
return resp.content.sha;
@@ -287,13 +301,13 @@ let git = {
const postRequest = axios.post(query, gitToken, repoData);
// change pushing state
- changePushingState(true, postRequest);
+ changePushingState(true, 'createRepo', postRequest);
// await the request
const resp = await postRequest;
// change pushing state
- changePushingState(false);
+ changePushingState(false, 'createRepo', postRequest);
return resp.full_name;
From 93867013343b6d1d6df8a7aa6e27035b49cf49c2 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:55:33 +0200
Subject: [PATCH 23/85] Update gitapi.js
---
git/gitapi.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 39491a6724..d10c912ad5 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -3,7 +3,8 @@
let pendingPromises = {
createRepo: null,
- pushFile: null,
+ latestPushFile: null,
+ newFiles: {},
fetchRepoObj: null
};
@@ -272,14 +273,14 @@ let git = {
}
- // change pushing state
- changePushingState(true, 'pushFile', postRequest);
+ // change pushing state and save latest push file
+ changePushingState(true, 'latestPushFile', postRequest);
// put the query
const resp = await axios.put(query, gitToken, commitData);
// change pushing state
- changePushingState(false, 'pushFile', postRequest);
+ changePushingState(false, 'latestPushFile', postRequest);
return resp.content.sha;
From e9b3db93e0045fc0584ddb1372840db8e0c061d0 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:57:34 +0200
Subject: [PATCH 24/85] Update gitapi.js
---
git/gitapi.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index d10c912ad5..0f3f630cda 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -4,7 +4,7 @@
let pendingPromises = {
createRepo: null,
latestPushFile: null,
- newFiles: {},
+ newFile: {},
fetchRepoObj: null
};
From 3885c2cd0573b1089e3ea903cffcee5416b52221 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 18:59:57 +0200
Subject: [PATCH 25/85] Update gitapi.js
---
git/gitapi.js | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 0f3f630cda..3b67ab2b45 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -3,9 +3,9 @@
let pendingPromises = {
createRepo: null,
- latestPushFile: null,
- newFile: {},
- fetchRepoObj: null
+ fetchRepoObj: null,
+ latestPushPendingFile: null,
+ newFile: {} // new file pending promises
};
function changePushingState(to, promiseType, promise) {
@@ -273,14 +273,15 @@ let git = {
}
- // change pushing state and save latest push file
- changePushingState(true, 'latestPushFile', postRequest);
+ // change pushing state
+ // and save latest push pending file
+ changePushingState(true, 'latestPushPendingFile', postRequest);
// put the query
const resp = await axios.put(query, gitToken, commitData);
// change pushing state
- changePushingState(false, 'latestPushFile', postRequest);
+ changePushingState(false, 'latestPushPendingFile', postRequest);
return resp.content.sha;
From 0e73fa0732824849d5e8177025acde07f83c8c98 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:00:58 +0200
Subject: [PATCH 26/85] Update gitapi.js
---
git/gitapi.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 3b67ab2b45..69b7ee5d59 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -5,7 +5,7 @@ let pendingPromises = {
createRepo: null,
fetchRepoObj: null,
latestPushPendingFile: null,
- newFile: {} // new file pending promises
+ newFile: {} // new file creation promises
};
function changePushingState(to, promiseType, promise) {
From 899867d863c59ef26d1cf1c1f87dac2d2c52ad69 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:06:13 +0200
Subject: [PATCH 27/85] Update gitapi.js
---
git/gitapi.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 69b7ee5d59..5e1089a5da 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -1,10 +1,10 @@
// change pushing state
-let pendingPromises = {
+let pendingPromise = {
createRepo: null,
fetchRepoObj: null,
- latestPushPendingFile: null,
+ latestPushedFile: null,
newFile: {} // new file creation promises
};
@@ -274,14 +274,14 @@ let git = {
// change pushing state
- // and save latest push pending file
- changePushingState(true, 'latestPushPendingFile', postRequest);
+ // and save pending file promise
+ changePushingState(true, 'latestPushedFile', postRequest);
// put the query
const resp = await axios.put(query, gitToken, commitData);
// change pushing state
- changePushingState(false, 'latestPushPendingFile', postRequest);
+ changePushingState(false, 'latestPushedFile', postRequest);
return resp.content.sha;
From 5811a0702b12f9d5b9c06f5c7f659cbfd96a3167 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:09:49 +0200
Subject: [PATCH 28/85] Update filebrowser.js
---
filebrowser.js | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 9c14d19c48..d137e4e411 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -1234,10 +1234,10 @@ async function pushFileFromHTML(fileEl, commitMessage) {
bottomFloat.classList.remove('modified');
- // if the current file hasn't been pushed yet,
- // await file creation
+ // if the current file hasn't been created yet,
+ // await its creation
- const newFilePendingPromise = newFilePendingPromises[getAttr(fileEl, 'sha')];
+ const newFilePendingPromise = pendingPromise.newFile[getAttr(fileEl, 'sha')];
if (newFilePendingPromise) {
@@ -1884,7 +1884,7 @@ sidebarTitle.addEventListener('click', (e) => {
// if there are no modified files
// and no pending promises
if (Object.values(modifiedFiles).length === 0
- && !pendingPromise && !repoPromise) {
+ && !pendingPromise) {
// enable logout
learnWrapper.classList.add('logout-enabled');
@@ -2253,8 +2253,6 @@ function createNewRepoInHTML() {
// create new file
// on click of button
-const newFilePendingPromises = {};
-
function createNewFileInHTML() {
// if not already adding new file
@@ -2482,11 +2480,11 @@ function createNewFileInHTML() {
}
- // if a pending promise exists,
- // await it
- if (pendingPromise) {
+ // if the current repository is being created,
+ // await its creation
+ if (pendingPromise.createRepo) {
- await pendingPromise;
+ await pendingPromise.createRepo;
}
@@ -2507,11 +2505,13 @@ function createNewFileInHTML() {
// push file asynchronously
- newFilePendingPromises[tempSHA] = git.push(commit);
+ // save new file creation promise in object
+ pendingPromise.newFile[tempSHA] = git.push(commit);
- const newSHA = await newFilePendingPromises[tempSHA];
+ const newSHA = await pendingPromise.newFile[tempSHA];
- delete newFilePendingPromises[tempSHA];
+ // remove file creation promise from object
+ delete pendingPromise.newFile[tempSHA];
// Git file is eclipsed (not updated) in browser private cache,
@@ -2802,12 +2802,12 @@ async function deleteModFileInHTML(fileEl) {
let fileSha = getAttr(fileEl, 'sha');
// if pushing file
- if (pendingPromise) {
+ if (pendingPromise.latestPushedFile) {
showMessage('Discarding changes...', -1);
// await pending promise
- await pendingPromise;
+ await pendingPromise.latestPushedFile;
hideMessage();
From 415e8d5a06f560d96b9a9995683b2d1d6b4e97ad Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:12:16 +0200
Subject: [PATCH 29/85] Update gitapi.js
---
git/gitapi.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index 5e1089a5da..da2cf535dd 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -3,7 +3,7 @@
let pendingPromise = {
createRepo: null,
- fetchRepoObj: null,
+ repoObjFetching: null,
latestPushedFile: null,
newFile: {} // new file creation promises
};
From f6b01725656204eb217f2b35e0d47668a2cf79a3 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:14:26 +0200
Subject: [PATCH 30/85] Update filebrowser.js
---
filebrowser.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index d137e4e411..c48f2fcba6 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -1083,11 +1083,11 @@ async function checkPushDialogs() {
if (!repoObj || repoObj.pushAccess === null) {
// await repo obj promise
- if (repoPromise) {
+ if (pendingPromise.repoObjFetch) {
showMessage('Just a sec..', -1);
- await repoPromise;
+ await pendingPromise.repoObjFetch;
repoObj = modifiedRepos[user + '/' + repoName];
@@ -1679,10 +1679,10 @@ async function renderBranchMenuHTML(renderAll) {
// if default branch isn't fetched yet
if (!repoObj.selBranch) {
-
+
// await fetch
- await repoPromise;
-
+ await pendingPromise.repoObjFetch;
+
repoObj = modifiedRepos[fullName];
}
From 39b98afbfd38833cdd6bd2d014bdb3e326775a0b Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:14:33 +0200
Subject: [PATCH 31/85] Update gitapi.js
---
git/gitapi.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git/gitapi.js b/git/gitapi.js
index da2cf535dd..73d360536d 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -3,7 +3,7 @@
let pendingPromise = {
createRepo: null,
- repoObjFetching: null,
+ repoObjFetch: null,
latestPushedFile: null,
newFile: {} // new file creation promises
};
From da4b0edf67928a1344d6c821a747376283e294cd Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 19:38:41 +0200
Subject: [PATCH 32/85] Update gitapi.js
---
git/gitapi.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/git/gitapi.js b/git/gitapi.js
index 73d360536d..e1781ec90b 100644
--- a/git/gitapi.js
+++ b/git/gitapi.js
@@ -447,3 +447,4 @@ let git = {
}
};
+
From 1f3346b0bc47dffe8b00ad9ef4afeaff9d2dea94 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:14:21 +0200
Subject: [PATCH 33/85] Update repos.js
---
repos.js | 316 +++++++++++++++++++++++++++++--------------------------
1 file changed, 165 insertions(+), 151 deletions(-)
diff --git a/repos.js b/repos.js
index ba3bcd4ec9..971d50e14d 100644
--- a/repos.js
+++ b/repos.js
@@ -23,168 +23,182 @@ function createRepoObj(fullName, selBranch, defaultBranch,
// modified repos
-function addRepoToModRepos(repoObj) {
-
- modifiedRepos[repoObj.fullName] = repoObj;
-
- updateModReposLS();
-
-}
-
-function deleteModRepo(fullName) {
-
- delete modifiedRepos[fullName];
-
- updateModReposLS();
-
-}
-
-function updateModRepoSelectedBranch(fullName, selBranch) {
-
- modifiedRepos[fullName].selBranch = selBranch;
-
- if (!isEmbed) {
- updateModReposLS();
- }
-
-}
-
-function updateModRepoDefaultBranch(fullName, defaultBranch) {
-
- modifiedRepos[fullName].defaultBranch = defaultBranch;
-
- updateModReposLS();
-
-}
-
-function updateModRepoPushAccess(fullName, pushAccess) {
-
- modifiedRepos[fullName].pushAccess = pushAccess;
-
- updateModReposLS();
-
-}
-
-function updateModRepoBranches(fullName, branches) {
-
- modifiedRepos[fullName].branches = branches;
-
- updateModReposLS();
-
-}
-
-function updateModRepoPrivateStatus(fullName, private) {
-
- modifiedRepos[fullName].private = private;
-
- updateModReposLS();
-
-}
-
-function updateModRepoEmptyStatus(fullName, empty) {
+let modRepos = {
- modifiedRepos[fullName].empty = empty;
-
- updateModReposLS();
-
-}
+ add: (repoObj) => {
-function updateModRepoDataExpiration(fullName, time) {
+ modifiedRepos[repoObj.fullName] = repoObj;
- modifiedRepos[fullName].repoDataExpiration = time;
-
- updateModReposLS();
-
-}
-
-function updateModRepoBranchExpiration(fullName, time) {
-
- modifiedRepos[fullName].branchExpiration = time;
-
- updateModReposLS();
-
-}
-
-
-
-// get repo obj from git
-// and save to modified repos
+ updateModReposLS();
-let repoPromise;
+ },
-async function fetchRepoAndSaveToModRepos(treeLoc) {
-
- // get full name of repository
- const fullName = treeLoc[0] + '/' + treeLoc[1].split(':')[0];
- const selBranch = treeLoc[1].split(':')[1];
-
-
- // create temporary repo object
- const tempRepoObj = createRepoObj(fullName, selBranch, null,
- null, null, null, null, null, 0, 0);
-
- // add temp repo object
- // to modified repos
- addRepoToModRepos(tempRepoObj);
+ remove: (fullName) => {
+
+ delete modifiedRepos[fullName];
+
+ updateModReposLS();
+ },
- // get repository from git
-
- // create promise
- repoPromise = git.getRepo(treeLoc);
-
- // await promise
- const repo = await repoPromise;
-
- // remove promise
- repoPromise = null;
-
+ updateRepo: (fullName) => {
+
+ return {
+
+ selBranchTo: (branch) => {
+
+ modifiedRepos[fullName].selBranch = branch;
+
+ if (!isEmbed) {
+ updateModReposLS();
+ }
+
+ },
+
+ defaultBranchTo: (branch) => {
+
+ modifiedRepos[fullName].defaultBranch = branch;
+
+ updateModReposLS();
+
+ },
+
+ pushAccessTo: (pushAccess) => {
+
+ modifiedRepos[fullName].pushAccess = pushAccess;
+
+ updateModReposLS();
+
+ },
+
+ branchesTo: (branches) => {
+
+ modifiedRepos[fullName].branches = branches;
+
+ updateModReposLS();
+
+ },
+
+ privateStatusTo: (privateStatus) => {
+
+ modifiedRepos[fullName].private = privateStatus;
+
+ updateModReposLS();
+
+ },
+
+ emptyStatusTo: (emptyStatus) => {
+
+ modifiedRepos[fullName].empty = emptyStatus;
+
+ updateModReposLS();
+
+ },
+
+ dataExpirationTo: (time) => {
+
+ modifiedRepos[fullName].repoDataExpiration = time;
+
+ updateModReposLS();
+
+ },
+
+ branchExpirationTo: (time) => {
+
+ modifiedRepos[fullName].branchExpiration = time;
+
+ updateModReposLS();
+
+ }
+
+ };
+
+ },
- // if didn't encounter an error
- if (!repo.message) {
-
- // check temp repo changed
- const tempRepo = modifiedRepos[fullName];
-
-
- // get repo data expiration time
- // (two months from now)
-
- let expirationDate = new Date();
- expirationDate.setDate(expirationDate.getDate() + (2 * 4 * 7));
-
- const twoMonthsTime = expirationDate.getTime();
-
-
- // create repo obj
- const repoObj = createRepoObj(fullName,
-
- (tempRepo.selBranch ?? repo.default_branch),
-
- repo.default_branch,
-
- (tempRepo.pushAccess ?? ((repo.permissions && repo.permissions.push) ?? false)),
-
- (tempRepo.branches ?? null),
-
- repo.private, repo.fork,
-
- (tempRepo.empty ?? false),
-
- twoMonthsTime,
-
- tempRepo.branchExpiration);
-
- // add repo object
+ // fetch repo obj from git
+ // and save to modified repos
+ fetchAndAddRepoObj: async (treeLoc) => {
+
+ // get full name of repository
+ const fullName = treeLoc[0] + '/' + treeLoc[1].split(':')[0];
+ const selBranch = treeLoc[1].split(':')[1];
+
+
+ // create temporary repo object
+ const tempRepoObj = createRepoObj(fullName, selBranch, null,
+ null, null, null, null, null, 0, 0);
+
+ // add temp repo object
// to modified repos
- addRepoToModRepos(repoObj);
+ modRepos.addRepo(tempRepoObj);
+
+
+ // get repository from git
+
+ // create promise
+ const repoPromise = git.getRepo(treeLoc);
+
+ // save promise in global object
+ pendingPromise.repoObjFetch = repoPromise;
- } else {
+ // await promise
+ const repo = await repoPromise;
- // remove temp repo object
- // from modified repos
- deleteModRepo(fullName);
+ // remove promise from global object
+ if (repoPromise === pendingPromise.repoObjFetch) {
+
+ pendingPromise.repoObjFetch = null;
+
+ }
+
+
+ // if didn't encounter an error
+ if (!repo.message) {
+
+ // get repo data expiration time
+ // (two months from now)
+
+ let expirationDate = new Date();
+ expirationDate.setDate(expirationDate.getDate() + (2 * 4 * 7));
+
+ const twoMonthsTime = expirationDate.getTime();
+
+
+ const tempRepo = modifiedRepos[fullName];
+
+ // create repo obj,
+ // while preserving changed properties from the temporary repo
+ const repoObj = createRepoObj(fullName,
+
+ (tempRepo.selBranch ?? repo.default_branch), // check if changed selected branch while fetching repo obj
+
+ repo.default_branch,
+
+ (tempRepo.pushAccess ?? ((repo.permissions && repo.permissions.push) ?? false)), // check for push access in repo
+
+ (tempRepo.branches ?? null), // check if finished fetching repo branches
+
+ repo.private, repo.fork,
+
+ (tempRepo.empty ?? false), // check if created file in empty repo while fetching repo obj
+
+ twoMonthsTime, // repo data expiration time
+
+ tempRepo.branchExpiration); // check if finished fetching repo branches
+
+ // add repo object
+ // to modified repos
+ modRepos.addRepo(repoObj);
+
+ } else { // if encountered an error
+
+ // remove temp repo object
+ // from modified repos
+ modRepos.removeRepo(fullName);
+
+ }
}
-}
+};
+
From d34bff5af6aa5a4923ebf85e70e64d1c8c3e65f0 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:16:28 +0200
Subject: [PATCH 34/85] Update filebrowser.js
---
filebrowser.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index c48f2fcba6..e6d2a87d1d 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -130,9 +130,9 @@ async function renderSidebarHTML() {
|| repoObj.repoDataExpiration === undefined || repoObj.branchExpiration === undefined
|| repoObj.repoDataExpiration < currentTime) {
- // get repo obj from git
+ // fetch repo obj from git
// and save to modified repos
- fetchRepoAndSaveToModRepos(treeLoc);
+ modRepos.fetchAndAddRepoObj(treeLoc);
}
From 6bfc048b0cfc1c9a441a8e6169dae80da99e2f04 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:16:55 +0200
Subject: [PATCH 35/85] Update filebrowser.js
---
filebrowser.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/filebrowser.js b/filebrowser.js
index e6d2a87d1d..59d8862721 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -126,6 +126,7 @@ async function renderSidebarHTML() {
const currentTime = new Date().getTime();
// if repo obj dosen't exist
+ // or data has expired
if (!repoObj || !repoObj.defaultBranch
|| repoObj.repoDataExpiration === undefined || repoObj.branchExpiration === undefined
|| repoObj.repoDataExpiration < currentTime) {
From 812bb7053c098a238682f1eb07993d983f6467e3 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:17:01 +0200
Subject: [PATCH 36/85] Update filebrowser.js
---
filebrowser.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 59d8862721..b9432c1247 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -126,7 +126,7 @@ async function renderSidebarHTML() {
const currentTime = new Date().getTime();
// if repo obj dosen't exist
- // or data has expired
+ // or repo data has expired
if (!repoObj || !repoObj.defaultBranch
|| repoObj.repoDataExpiration === undefined || repoObj.branchExpiration === undefined
|| repoObj.repoDataExpiration < currentTime) {
From d2c08da3923d593a7a8a2fe2b8551bae8e711542 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:17:07 +0200
Subject: [PATCH 37/85] Update filebrowser.js
---
filebrowser.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index b9432c1247..2f0aaebaad 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -126,7 +126,7 @@ async function renderSidebarHTML() {
const currentTime = new Date().getTime();
// if repo obj dosen't exist
- // or repo data has expired
+ // or repo obj data has expired
if (!repoObj || !repoObj.defaultBranch
|| repoObj.repoDataExpiration === undefined || repoObj.branchExpiration === undefined
|| repoObj.repoDataExpiration < currentTime) {
From 4b5b80d99aa50ae28dc4f6bb6eef78f67d45c651 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:17:58 +0200
Subject: [PATCH 38/85] Update repos.js
---
repos.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/repos.js b/repos.js
index 971d50e14d..82e6ea9cd2 100644
--- a/repos.js
+++ b/repos.js
@@ -25,7 +25,7 @@ function createRepoObj(fullName, selBranch, defaultBranch,
let modRepos = {
- add: (repoObj) => {
+ addRepo: (repoObj) => {
modifiedRepos[repoObj.fullName] = repoObj;
@@ -33,7 +33,7 @@ let modRepos = {
},
- remove: (fullName) => {
+ removeRepo: (fullName) => {
delete modifiedRepos[fullName];
From fe1db220933c4489448df4ba325d15e3adab76ec Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:20:34 +0200
Subject: [PATCH 39/85] Update filebrowser.js
---
filebrowser.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 2f0aaebaad..276b08abd6 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -868,7 +868,7 @@ function addHTMLItemListeners() {
if (getAttr(item, 'repoObj')) {
// add repo obj to modified repos
- addRepoToModRepos(repoObj);
+ modRepos.addRepo(repoObj);
}
@@ -2216,7 +2216,7 @@ function createNewRepoInHTML() {
true, null, repoPrivate, false, true, 0, 0);
// add repo obj to modified repos
- addRepoToModRepos(repoObj);
+ modRepos.addRepo(repoObj);
// wait for push animation to finish,
From 41e2b199ea2906c83f1c81aa3d907b27b5a73c63 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 3 Nov 2022 20:21:33 +0200
Subject: [PATCH 40/85] Update filebrowser.js
---
filebrowser.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 276b08abd6..4fd2af5b97 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -245,7 +245,7 @@ async function renderSidebarHTML() {
if (repoObj) {
// delete repo obj from modified repos
- deleteModRepo(user + '/' + repoName);
+ modRepos.removeRepo(user + '/' + repoName);
}
From 8bd6ddf4d0c081e80dc0c4dab72c449a53e8c951 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 07:07:33 +0200
Subject: [PATCH 41/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index 6cd8e1c1e0..01ecd17c82 100644
--- a/full.css
+++ b/full.css
@@ -1283,7 +1283,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
text-overflow: clip;
background: hsl(220deg 86% 64% / 9%);
box-shadow: 0 0 0 2px hsl(223deg 85% 66% / 70%);
- transition: .18s .04s var(--ease-function);
+ transition: .18s var(--ease-function);
transition-property: background, box-shadow;
}
From 5fb8d52109dde4ee7dae026360a72de3ddb7b1c9 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 07:21:09 +0200
Subject: [PATCH 42/85] Update full.css
---
full.css | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/full.css b/full.css
index 01ecd17c82..4bf11b10d4 100644
--- a/full.css
+++ b/full.css
@@ -1192,6 +1192,15 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
}
+.files .placeholder {
+ background-image: var(--file-placeholder);
+ height: calc(100% - 85px);
+ width: calc(100% - 1px);
+ position: absolute;
+ --file-placeholder: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNTAgNTQiPgogIDxwYXRoIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0iIzFhMWMyMyIgZD0iTTAgMGgzNTB2NTRIMHoiLz4KICA8ZyBvcGFjaXR5PSIuMyI+CiAgICA8cGF0aCBkPSJNMjMgMTguOTM4YTMuNzY4IDMuNzY4IDAgMCAxIDMuNzUtMy43NWgxMy4xMjVBMS4xMyAxLjEzIDAgMCAxIDQxIDE2LjMxMXYxOC43NWExLjEzIDEuMTMgMCAwIDEtMS4xMjUgMS4xMjZoLTMuNzVBMS4xMyAxLjEzIDAgMCAxIDM1IDM1LjA2MmExLjEzIDEuMTMgMCAwIDEgMS4xMjUtMS4xMjRoMi42MjV2LTNoLTEyYy0uODIzIDAtMS41LjY3Ny0xLjUgMS41IDAgLjM5MS4xNTQuNzcuNDI5IDEuMDVhMS4xMjQgMS4xMjQgMCAwIDEtLjgwNCAxLjkxM2MtLjMwMiAwLS41OTItLjEyMy0uODA0LS4zMzlBMy43NDQgMy43NDQgMCAwIDEgMjMgMzIuNDM4di0xMy41Wm0xNS43NS0xLjV2MTEuMjVoLTEyYy0uNTM0IDAtMS4wNDEuMTEtMS41LjMxMVYxOC45MzhjMC0uODIzLjY3Ny0xLjUgMS41LTEuNWgxMlpNMjcuNSAzMy41NjN2NC44NzRhLjM3Ni4zNzYgMCAwIDAgLjYuM2wyLjE3NS0xLjYzYy4xMzMtLjEuMzE3LS4xLjQ1IDBsMi4xNzUgMS42M2EuMzc2LjM3NiAwIDAgMCAuNi0uM3YtNC44NzRhLjM3Ni4zNzYgMCAwIDAtLjM3NS0uMzc2aC01LjI1YS4zNzYuMzc2IDAgMCAwLS4zNzUuMzc2WiIgZmlsbD0iIzgyODY4OSIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGQ9Ik0yMDEgMjIuMTI0YTQuODc4IDQuODc4IDAgMCAwLTQuODc1LTQuODc1SDU1Ljg3NWE0Ljg3NyA0Ljg3NyAwIDAgMC00Ljg3NCA0Ljg3NXY5Ljc1MWE0Ljg3NyA0Ljg3NyAwIDAgMCA0Ljg3NCA0Ljg3NWgxNDAuMjVBNC44NzggNC44NzggMCAwIDAgMjAxIDMxLjg3NXYtOS43NVoiIGZpbGw9IiNkNGQ1ZDciIGZpbGwtb3BhY2l0eT0iLjEiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIGQ9Ik0zMDYgMTVoMjR2MjRoLTI0eiIvPgogICAgPHBhdGggZD0iTTMxNS4yOSAyMS43MWEuOTk2Ljk5NiAwIDAgMCAwIDEuNDFsMy44OCAzLjg4LTMuODggMy44OGEuOTk2Ljk5NiAwIDEgMCAxLjQxIDEuNDFsNC41OS00LjU5YS45OTYuOTk2IDAgMCAwIDAtMS40MWwtNC41OS00LjU5Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDFaIiBmaWxsPSIjODI4Njg5Ii8+CiAgPC9nPgo8L3N2Zz4=');
+}
+
+
.sidebar .item {
display: flex;
align-items: center;
From 6ff716c7ab8915d1d9074f12799c6575bbf3e8a4 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 07:21:41 +0200
Subject: [PATCH 43/85] Update full.html
---
full.html | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/full.html b/full.html
index 8a922a2249..c982f61173 100644
--- a/full.html
+++ b/full.html
@@ -199,7 +199,9 @@
-
+
From 51bbf339756d8317657ca630aa60af20ec406024 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 15:29:48 +0200
Subject: [PATCH 44/85] Update full.html
---
full.html | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/full.html b/full.html
index c982f61173..8a922a2249 100644
--- a/full.html
+++ b/full.html
@@ -199,9 +199,7 @@
-
+
From 79695179c54232fb0ac608a25eee7e1f9f1470ef Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 15:30:45 +0200
Subject: [PATCH 45/85] Update full.css
---
full.css | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/full.css b/full.css
index 4bf11b10d4..bcf96262ef 100644
--- a/full.css
+++ b/full.css
@@ -1192,12 +1192,31 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
}
-.files .placeholder {
- background-image: var(--file-placeholder);
- height: calc(100% - 85px);
- width: calc(100% - 1px);
+.files.placeholder::before,
+.files.placeholder::after {
+ content: '';
position: absolute;
- --file-placeholder: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNTAgNTQiPgogIDxwYXRoIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0iIzFhMWMyMyIgZD0iTTAgMGgzNTB2NTRIMHoiLz4KICA8ZyBvcGFjaXR5PSIuMyI+CiAgICA8cGF0aCBkPSJNMjMgMTguOTM4YTMuNzY4IDMuNzY4IDAgMCAxIDMuNzUtMy43NWgxMy4xMjVBMS4xMyAxLjEzIDAgMCAxIDQxIDE2LjMxMXYxOC43NWExLjEzIDEuMTMgMCAwIDEtMS4xMjUgMS4xMjZoLTMuNzVBMS4xMyAxLjEzIDAgMCAxIDM1IDM1LjA2MmExLjEzIDEuMTMgMCAwIDEgMS4xMjUtMS4xMjRoMi42MjV2LTNoLTEyYy0uODIzIDAtMS41LjY3Ny0xLjUgMS41IDAgLjM5MS4xNTQuNzcuNDI5IDEuMDVhMS4xMjQgMS4xMjQgMCAwIDEtLjgwNCAxLjkxM2MtLjMwMiAwLS41OTItLjEyMy0uODA0LS4zMzlBMy43NDQgMy43NDQgMCAwIDEgMjMgMzIuNDM4di0xMy41Wm0xNS43NS0xLjV2MTEuMjVoLTEyYy0uNTM0IDAtMS4wNDEuMTEtMS41LjMxMVYxOC45MzhjMC0uODIzLjY3Ny0xLjUgMS41LTEuNWgxMlpNMjcuNSAzMy41NjN2NC44NzRhLjM3Ni4zNzYgMCAwIDAgLjYuM2wyLjE3NS0xLjYzYy4xMzMtLjEuMzE3LS4xLjQ1IDBsMi4xNzUgMS42M2EuMzc2LjM3NiAwIDAgMCAuNi0uM3YtNC44NzRhLjM3Ni4zNzYgMCAwIDAtLjM3NS0uMzc2aC01LjI1YS4zNzYuMzc2IDAgMCAwLS4zNzUuMzc2WiIgZmlsbD0iIzgyODY4OSIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGQ9Ik0yMDEgMjIuMTI0YTQuODc4IDQuODc4IDAgMCAwLTQuODc1LTQuODc1SDU1Ljg3NWE0Ljg3NyA0Ljg3NyAwIDAgMC00Ljg3NCA0Ljg3NXY5Ljc1MWE0Ljg3NyA0Ljg3NyAwIDAgMCA0Ljg3NCA0Ljg3NWgxNDAuMjVBNC44NzggNC44NzggMCAwIDAgMjAxIDMxLjg3NXYtOS43NVoiIGZpbGw9IiNkNGQ1ZDciIGZpbGwtb3BhY2l0eT0iLjEiLz4KICAgIDxwYXRoIGZpbGw9Im5vbmUiIGQ9Ik0zMDYgMTVoMjR2MjRoLTI0eiIvPgogICAgPHBhdGggZD0iTTMxNS4yOSAyMS43MWEuOTk2Ljk5NiAwIDAgMCAwIDEuNDFsMy44OCAzLjg4LTMuODggMy44OGEuOTk2Ljk5NiAwIDEgMCAxLjQxIDEuNDFsNC41OS00LjU5YS45OTYuOTk2IDAgMCAwIDAtMS40MWwtNC41OS00LjU5Yy0uMzgtLjM4LTEuMDItLjM4LTEuNDEuMDFaIiBmaWxsPSIjODI4Njg5Ii8+CiAgPC9nPgo8L3N2Zz4=');
+ height: calc(100% - 85px);
+ pointer-events: none;
+ z-index: 1;
+}
+
+.files.placeholder::before {
+ background-image: var(--repo-placeholder);
+ background-image: var(--file-placeholder);
+ background-size: 201px 54px;
+ width: 201px;
+ left: 0;
+ --repo-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M23%2018.94a3.787%203.787%200%200%201%203.75-3.752h13.125A1.136%201.136%200%200%201%2041%2016.311v18.756a1.135%201.135%200%200%201-1.125%201.126h-3.75A1.136%201.136%200%200%201%2035%2035.068a1.135%201.135%200%200%201%201.125-1.124h2.625v-3.001h-12c-.823%200-1.5.677-1.5%201.5%200%20.391.154.77.429%201.05a1.125%201.125%200%200%201-.801%201.914h-.003c-.302%200-.592-.123-.804-.339A3.744%203.744%200%200%201%2023%2032.443V18.94Zm15.75-1.501v11.253h-12c-.534%200-1.041.11-1.5.311V18.94c0-.823.677-1.5%201.5-1.5h12ZM27.5%2033.569v4.875a.377.377%200%200%200%20.6.3l2.175-1.63c.133-.1.317-.1.45%200l2.175%201.63a.376.376%200%200%200%20.6-.3v-4.875a.378.378%200%200%200-.375-.377h-5.25a.378.378%200%200%200-.375.377Z%22%20fill-rule%3D%22evenodd%22%2F%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
+ --file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
+}
+
+.files.placeholder::after {
+ background-image: var(--arrow-placeholder);
+ background-size: 44px 54px;
+ width: 44px;
+ right: 0;
+ --arrow-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h44v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M0%2015h24v24H0z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M9.29%2021.71a.998.998%200%200%200%200%201.41L13.17%2027l-3.88%203.88a.998.998%200%200%200%201.41%201.41l4.59-4.59a.998.998%200%200%200%200-1.41L10.7%2021.7c-.38-.38-1.02-.38-1.41.01Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
From c7e7069bd8c2c2963259f998d26c27c357609b82 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 15:33:54 +0200
Subject: [PATCH 46/85] Update full.css
---
full.css | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/full.css b/full.css
index bcf96262ef..06599bf7ca 100644
--- a/full.css
+++ b/full.css
@@ -1192,8 +1192,8 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
}
-.files.placeholder::before,
-.files.placeholder::after {
+.sidebar .files::before,
+.sidebar .files::after {
content: '';
position: absolute;
height: calc(100% - 85px);
@@ -1201,17 +1201,20 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
z-index: 1;
}
-.files.placeholder::before {
- background-image: var(--repo-placeholder);
+.sidebar .files::before {
background-image: var(--file-placeholder);
background-size: 201px 54px;
width: 201px;
left: 0;
- --repo-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M23%2018.94a3.787%203.787%200%200%201%203.75-3.752h13.125A1.136%201.136%200%200%201%2041%2016.311v18.756a1.135%201.135%200%200%201-1.125%201.126h-3.75A1.136%201.136%200%200%201%2035%2035.068a1.135%201.135%200%200%201%201.125-1.124h2.625v-3.001h-12c-.823%200-1.5.677-1.5%201.5%200%20.391.154.77.429%201.05a1.125%201.125%200%200%201-.801%201.914h-.003c-.302%200-.592-.123-.804-.339A3.744%203.744%200%200%201%2023%2032.443V18.94Zm15.75-1.501v11.253h-12c-.534%200-1.041.11-1.5.311V18.94c0-.823.677-1.5%201.5-1.5h12ZM27.5%2033.569v4.875a.377.377%200%200%200%20.6.3l2.175-1.63c.133-.1.317-.1.45%200l2.175%201.63a.376.376%200%200%200%20.6-.3v-4.875a.378.378%200%200%200-.375-.377h-5.25a.378.378%200%200%200-.375.377Z%22%20fill-rule%3D%22evenodd%22%2F%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
--file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
-.files.placeholder::after {
+.sidebar .header.out-of-repo + .files::before {
+ background-image: var(--repo-placeholder);
+ --repo-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M23%2018.94a3.787%203.787%200%200%201%203.75-3.752h13.125A1.136%201.136%200%200%201%2041%2016.311v18.756a1.135%201.135%200%200%201-1.125%201.126h-3.75A1.136%201.136%200%200%201%2035%2035.068a1.135%201.135%200%200%201%201.125-1.124h2.625v-3.001h-12c-.823%200-1.5.677-1.5%201.5%200%20.391.154.77.429%201.05a1.125%201.125%200%200%201-.801%201.914h-.003c-.302%200-.592-.123-.804-.339A3.744%203.744%200%200%201%2023%2032.443V18.94Zm15.75-1.501v11.253h-12c-.534%200-1.041.11-1.5.311V18.94c0-.823.677-1.5%201.5-1.5h12ZM27.5%2033.569v4.875a.377.377%200%200%200%20.6.3l2.175-1.63c.133-.1.317-.1.45%200l2.175%201.63a.376.376%200%200%200%20.6-.3v-4.875a.378.378%200%200%200-.375-.377h-5.25a.378.378%200%200%200-.375.377Z%22%20fill-rule%3D%22evenodd%22%2F%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
+}
+
+.sidebar .files::after {
background-image: var(--arrow-placeholder);
background-size: 44px 54px;
width: 44px;
@@ -1219,6 +1222,10 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
--arrow-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h44v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M0%2015h24v24H0z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M9.29%2021.71a.998.998%200%200%200%200%201.41L13.17%2027l-3.88%203.88a.998.998%200%200%200%201.41%201.41l4.59-4.59a.998.998%200%200%200%200-1.41L10.7%2021.7c-.38-.38-1.02-.38-1.41.01Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
+.sidebar .header.out-of-repo + .files::after {
+ content: unset;
+}
+
.sidebar .item {
display: flex;
From 9ef3c01a9a104a5f0a0860a09a0e9129862d5ebf Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:01:25 +0200
Subject: [PATCH 47/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index 06599bf7ca..1841500dd1 100644
--- a/full.css
+++ b/full.css
@@ -1222,7 +1222,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
--arrow-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h44v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M0%2015h24v24H0z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M9.29%2021.71a.998.998%200%200%200%200%201.41L13.17%2027l-3.88%203.88a.998.998%200%200%200%201.41%201.41l4.59-4.59a.998.998%200%200%200%200-1.41L10.7%2021.7c-.38-.38-1.02-.38-1.41.01Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
-.sidebar .header.out-of-repo + .files::after {
+.sidebar .header:not(.out-of-repo) + .files::after {
content: unset;
}
From 304babb54a51cdc7c6e29815d17cb7442ac618ed Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:05:28 +0200
Subject: [PATCH 48/85] Update filebrowser.js
---
filebrowser.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 4fd2af5b97..d1518b40a7 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -145,7 +145,7 @@ async function renderSidebarHTML() {
// if sidebar title is empty
- if (sidebarLogo.innerText === '') {
+ if (/* sidebarLogo.innerText === '' */ true) {
if (contents != '') {
@@ -175,6 +175,10 @@ async function renderSidebarHTML() {
onNextFrame(() => {
sidebarLogo.classList.remove('notransition');
});
+
+
+ // change header options
+ header.classList.remove('out-of-repo');
} else if (repo != '') {
@@ -201,6 +205,10 @@ async function renderSidebarHTML() {
onNextFrame(() => {
sidebarLogo.classList.remove('notransition');
});
+
+
+ // change header options
+ header.classList.remove('out-of-repo');
} else {
@@ -220,6 +228,10 @@ async function renderSidebarHTML() {
onNextFrame(() => {
sidebarLogo.classList.remove('notransition');
});
+
+
+ // change header options
+ header.classList.add('out-of-repo');
}
From f28b7c5b2d66fb8850cd38459082e6d6bf7d008d Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:06:52 +0200
Subject: [PATCH 49/85] Update full.css
---
full.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/full.css b/full.css
index 1841500dd1..60aba0cea4 100644
--- a/full.css
+++ b/full.css
@@ -1192,8 +1192,8 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
}
-.sidebar .files::before,
-.sidebar .files::after {
+.sidebar.loading .files::before,
+.sidebar.loading .files::after {
content: '';
position: absolute;
height: calc(100% - 85px);
From 03183c92a768373f406c2fb9b0ed17efaee19097 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:07:42 +0200
Subject: [PATCH 50/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index 60aba0cea4..c65c2bf8e1 100644
--- a/full.css
+++ b/full.css
@@ -1205,7 +1205,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
background-image: var(--file-placeholder);
background-size: 201px 54px;
width: 201px;
- left: 0;
+ left: 1px;
--file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
From ac3fa953f3f9d86fd522c01a874b5405ea0cad8c Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:09:39 +0200
Subject: [PATCH 51/85] Update full.css
---
full.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/full.css b/full.css
index c65c2bf8e1..09c92f7b12 100644
--- a/full.css
+++ b/full.css
@@ -1205,7 +1205,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
background-image: var(--file-placeholder);
background-size: 201px 54px;
width: 201px;
- left: 1px;
+ left: 0;
--file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
@@ -1218,7 +1218,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
background-image: var(--arrow-placeholder);
background-size: 44px 54px;
width: 44px;
- right: 0;
+ right: 1px;
--arrow-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2044%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h44v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M0%2015h24v24H0z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M9.29%2021.71a.998.998%200%200%200%200%201.41L13.17%2027l-3.88%203.88a.998.998%200%200%200%201.41%201.41l4.59-4.59a.998.998%200%200%200%200-1.41L10.7%2021.7c-.38-.38-1.02-.38-1.41.01Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
From ece989703bd4a5f9146e76957b64bcf4725f3422 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:11:35 +0200
Subject: [PATCH 52/85] Update filebrowser.js
---
filebrowser.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index d1518b40a7..9a9a827895 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -53,6 +53,9 @@ async function renderSidebarHTML() {
if (loader.style.opacity != '1') {
startLoading();
}
+
+ // clear sidebar items
+ fileWrapper.innerHTML = '';
// hide search screen
header.classList.remove('searching');
From c1b13b3d80f5072ec0083b5c592d593acb2146a9 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Fri, 4 Nov 2022 16:15:10 +0200
Subject: [PATCH 53/85] Update client-channel.js
---
worker/client-channel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/worker/client-channel.js b/worker/client-channel.js
index d83788b65e..4b4f1cd398 100644
--- a/worker/client-channel.js
+++ b/worker/client-channel.js
@@ -4,7 +4,7 @@
// update worker name when updating worker
-const WORKER_NAME = 'codeit-worker-v606';
+const WORKER_NAME = 'codeit-worker-v607';
// internal paths
From 960d85ed1416284b5b526c450da0f30a172bb508 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Tue, 8 Nov 2022 09:25:43 +0200
Subject: [PATCH 54/85] Update codeit-autocomplete.js
---
lib/plugins/codeit-autocomplete.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/plugins/codeit-autocomplete.js b/lib/plugins/codeit-autocomplete.js
index e7a3506e03..e6e8310a8d 100644
--- a/lib/plugins/codeit-autocomplete.js
+++ b/lib/plugins/codeit-autocomplete.js
@@ -31,6 +31,7 @@ CSSProps.push('flex');
CSSProps.push('grid');
CSSProps.push('gap');
CSSProps.push('background');
+CSSProps.push('overflow');
CSSProps.push('-webkit-user-select');
const maxChar = 0;//4;
From 24f72f8ab1ec10750d40abc9ad3b17a58952836a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 11:45:33 +0200
Subject: [PATCH 55/85] Update bottomfloat.js
---
bottomfloat.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/bottomfloat.js b/bottomfloat.js
index a0eaae3d5d..262caf0a42 100644
--- a/bottomfloat.js
+++ b/bottomfloat.js
@@ -116,6 +116,12 @@ if (isMobile) {
});
+ cd.on('focus', () => {
+
+ bottomWrapper.classList.add('hidden');
+
+ });
+
// update on screen resize
From 7d71a18d33a721bd61e1b62072fa372083d8e1ad Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 11:45:43 +0200
Subject: [PATCH 56/85] Update client-channel.js
---
worker/client-channel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/worker/client-channel.js b/worker/client-channel.js
index 4b4f1cd398..746e952c3d 100644
--- a/worker/client-channel.js
+++ b/worker/client-channel.js
@@ -4,7 +4,7 @@
// update worker name when updating worker
-const WORKER_NAME = 'codeit-worker-v607';
+const WORKER_NAME = 'codeit-worker-v608';
// internal paths
From 98a386b7e7bd636cb5892c79d27b3d7422ceab2a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 19:53:52 +0200
Subject: [PATCH 57/85] Update bottomfloat.js
---
bottomfloat.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bottomfloat.js b/bottomfloat.js
index 262caf0a42..cd00aad937 100644
--- a/bottomfloat.js
+++ b/bottomfloat.js
@@ -107,7 +107,7 @@ floatDownload.addEventListener('click', downloadSelFile);
// if on mobile
if (isMobile) {
-
+
cd.on('scroll', checkBottomFloat, false);
cd.on('blur', () => {
@@ -176,7 +176,7 @@ function checkBottomFloat() {
}
- } else { // if scrolled up
+ } else if (document.activeElement !== cd) { // if scrolled up
// if passed threshold
if ((lastScrollTop - st) > 20) {
From 92f7ff6f148311b189d3f9b4399f668d73ff5c6a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:01:40 +0200
Subject: [PATCH 58/85] Update filebrowser.js
---
filebrowser.js | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 9a9a827895..d325df043a 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -54,8 +54,8 @@ async function renderSidebarHTML() {
startLoading();
}
- // clear sidebar items
- fileWrapper.innerHTML = '';
+ // show placeholder items
+ fileWrapper.classList.add('placeholder');
// hide search screen
header.classList.remove('searching');
@@ -94,6 +94,9 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
+
+ // hide placeholder items
+ fileWrapper.classList.remove('placeholder');
// show intro screen
fileWrapper.innerHTML = fileIntroScreen;
@@ -252,6 +255,9 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
+ // hide placeholder items
+ fileWrapper.classList.remove('placeholder');
+
// get repo obj from local storage
const repoObj = modifiedRepos[user + '/' + repoName];
@@ -307,6 +313,9 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
+
+ // hide placeholder items
+ fileWrapper.classList.add('placeholder');
// get repo obj from local storage
@@ -822,6 +831,9 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
+
+ // hide placeholder items
+ fileWrapper.classList.remove('placeholder');
// add item event listeners
addHTMLItemListeners();
From 89516d214354f55b74a07304d296fec5c25071b0 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:03:15 +0200
Subject: [PATCH 59/85] Update filebrowser.js
---
filebrowser.js | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index d325df043a..0141f31319 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -95,8 +95,8 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
- // hide placeholder items
- fileWrapper.classList.remove('placeholder');
+ // hide loading items
+ fileWrapper.classList.remove('loading-items');
// show intro screen
fileWrapper.innerHTML = fileIntroScreen;
@@ -255,8 +255,8 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
- // hide placeholder items
- fileWrapper.classList.remove('placeholder');
+ // hide loading items
+ fileWrapper.classList.remove('loading-items');
// get repo obj from local storage
@@ -314,8 +314,8 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
- // hide placeholder items
- fileWrapper.classList.add('placeholder');
+ // hide loading items
+ fileWrapper.classList.add('loading-items');
// get repo obj from local storage
@@ -832,8 +832,8 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
- // hide placeholder items
- fileWrapper.classList.remove('placeholder');
+ // hide loading items
+ fileWrapper.classList.remove('loading-items');
// add item event listeners
addHTMLItemListeners();
From 31775b62206a6181d7b0a59a089ad43331c1befd Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:03:52 +0200
Subject: [PATCH 60/85] Update full.css
---
full.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/full.css b/full.css
index 09c92f7b12..a2632066e3 100644
--- a/full.css
+++ b/full.css
@@ -1192,8 +1192,8 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
}
-.sidebar.loading .files::before,
-.sidebar.loading .files::after {
+.sidebar .files.loading-items::before,
+.sidebar .files.loading-items::after {
content: '';
position: absolute;
height: calc(100% - 85px);
From b82ad2180880a3057291dd5b799e12495a7d06a3 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:05:29 +0200
Subject: [PATCH 61/85] Update full.css
---
full.css | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/full.css b/full.css
index a2632066e3..c4164e448a 100644
--- a/full.css
+++ b/full.css
@@ -1197,6 +1197,8 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
content: '';
position: absolute;
height: calc(100% - 85px);
+ background-color: #1a1c24;
+ background-repeat-x: no-repeat;
pointer-events: none;
z-index: 1;
}
@@ -1204,7 +1206,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
.sidebar .files::before {
background-image: var(--file-placeholder);
background-size: 201px 54px;
- width: 201px;
+ width: 100%;
left: 0;
--file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
From 2e37d1567a901dc64e86f97c81d30ec0cb162530 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:08:36 +0200
Subject: [PATCH 62/85] Update filebrowser.js
---
filebrowser.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 0141f31319..db3d07e431 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -54,8 +54,8 @@ async function renderSidebarHTML() {
startLoading();
}
- // show placeholder items
- fileWrapper.classList.add('placeholder');
+ // show loading items
+ fileWrapper.classList.add('loading-items');
// hide search screen
header.classList.remove('searching');
From 00c1c8cca9e7a2ec62c83021411737d1cf9e9929 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:09:01 +0200
Subject: [PATCH 63/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index c4164e448a..ce42219e9c 100644
--- a/full.css
+++ b/full.css
@@ -1206,7 +1206,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
.sidebar .files::before {
background-image: var(--file-placeholder);
background-size: 201px 54px;
- width: 100%;
+ width: calc(100% - 1px);
left: 0;
--file-placeholder: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20201%2054%22%3E%20%3Cpath%20fill%3D%22%231a1c23%22%20d%3D%22M0%200h201v54H0z%22%2F%3E%20%3Cg%20opacity%3D%22.3%22%3E%20%3Cpath%20fill%3D%22%23d4d5d7%22%20fill-opacity%3D%22.1%22%20d%3D%22M201%2022.124c-.002-2.674-2.201-4.873-4.875-4.875H55.875c-2.674.002-4.873%202.201-4.874%204.875v9.751c.001%202.674%202.2%204.873%204.874%204.875h140.25c2.674-.002%204.873-2.201%204.875-4.875v-9.751Z%22%2F%3E%20%3Cpath%20fill%3D%22none%22%20d%3D%22M20%2015.029h24v24H20z%22%2F%3E%20%3Cpath%20fill%3D%22%23828689%22%20d%3D%22M34.59%2017.619c-.38-.38-.89-.59-1.42-.59H26c-1.1%200-2%20.9-2%202v16c0%201.1.89%202%201.99%202H38c1.1%200%202-.9%202-2v-11.17c0-.53-.21-1.04-.59-1.41l-4.82-4.83Zm.41%2015.41h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm0-4h-6c-.55%200-1-.45-1-1s.45-1%201-1h6c.55%200%201%20.45%201%201s-.45%201-1%201Zm-2-6v-4.5l5.5%205.5H34c-.55%200-1-.45-1-1Z%22%2F%3E%20%3C%2Fg%3E%20%3C%2Fsvg%3E');
}
From a8532e825492ee3bd5f2dc74cec48173b4deb6a5 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:14:47 +0200
Subject: [PATCH 64/85] Update filebrowser.js
---
filebrowser.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index db3d07e431..a11d22bbed 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -247,6 +247,15 @@ async function renderSidebarHTML() {
// get items in current tree from git
resp = await git.getItems(treeLoc);
+
+ // if switched directory while loading, return
+ if (user !== treeLoc[0] || repo !== treeLoc[1] ||
+ contents !== treeLoc[2]) {
+
+ return;
+
+ }
+
if (resp.message && resp.message == 'Not Found') {
From 06bfcdfa84ab4a0dd5bec2c1b1e62c20fa23fc8e Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:17:48 +0200
Subject: [PATCH 65/85] Update full.css
---
full.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/full.css b/full.css
index ce42219e9c..2126523c3a 100644
--- a/full.css
+++ b/full.css
@@ -1196,6 +1196,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
.sidebar .files.loading-items::after {
content: '';
position: absolute;
+ top: 85px;
height: calc(100% - 85px);
background-color: #1a1c24;
background-repeat-x: no-repeat;
From ecc48a52a6b127c379cef601197eaa01f69394b8 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:18:05 +0200
Subject: [PATCH 66/85] Update full.css
---
full.css | 1 -
1 file changed, 1 deletion(-)
diff --git a/full.css b/full.css
index 2126523c3a..8d78a28ce0 100644
--- a/full.css
+++ b/full.css
@@ -1200,7 +1200,6 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
height: calc(100% - 85px);
background-color: #1a1c24;
background-repeat-x: no-repeat;
- pointer-events: none;
z-index: 1;
}
From 43e7168106eeffe6db1cad5cd7a8951412869bbe Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:24:20 +0200
Subject: [PATCH 67/85] Update full.css
---
full.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/full.css b/full.css
index 8d78a28ce0..a6c2100c41 100644
--- a/full.css
+++ b/full.css
@@ -761,6 +761,10 @@ body.notransition .sidebar {
transition: none;
}
+.sidebar:has(> .files.loading-items) {
+ overflow-y: hidden;
+}
+
.sidebar .wrapper {
width: 100%;
height: max-content;
From 30827ea78c6c3293cc775b732cc30c61da1d3a3c Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:25:04 +0200
Subject: [PATCH 68/85] Update filebrowser.js
---
filebrowser.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index a11d22bbed..58e90ecb9c 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -56,6 +56,8 @@ async function renderSidebarHTML() {
// show loading items
fileWrapper.classList.add('loading-items');
+
+ fileWrapper.style.setProperty('--scroll-top', sidebar.scrollTop + 'px');
// hide search screen
header.classList.remove('searching');
From 44e6fb4c1b855651aac9fd7004d82b148cc34dfd Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:27:02 +0200
Subject: [PATCH 69/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index a6c2100c41..5d47fb887e 100644
--- a/full.css
+++ b/full.css
@@ -761,7 +761,7 @@ body.notransition .sidebar {
transition: none;
}
-.sidebar:has(> .files.loading-items) {
+.sidebar.loading:has(> .content-wrapper .files.loading-items) {
overflow-y: hidden;
}
From 67f65a4bc0bebe6e4bede45b35ff9b3485b58b6b Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:34:07 +0200
Subject: [PATCH 70/85] Update full.css
---
full.css | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/full.css b/full.css
index 5d47fb887e..d49dbb8e55 100644
--- a/full.css
+++ b/full.css
@@ -1200,10 +1200,11 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
.sidebar .files.loading-items::after {
content: '';
position: absolute;
- top: 85px;
- height: calc(100% - 85px);
+ top: calc(85px - 11px + var(--scroll-top, 0px));
+ height: calc(100% - 85px + 11px);
background-color: #1a1c24;
background-repeat-x: no-repeat;
+ background-position-y: 11px;
z-index: 1;
}
From 8cc1539cc8c8c889038d0ff7255e26257dd92822 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:34:15 +0200
Subject: [PATCH 71/85] Update full.css
---
full.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/full.css b/full.css
index d49dbb8e55..db91d1588e 100644
--- a/full.css
+++ b/full.css
@@ -1202,9 +1202,9 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
position: absolute;
top: calc(85px - 11px + var(--scroll-top, 0px));
height: calc(100% - 85px + 11px);
+ background-position-y: 11px;
background-color: #1a1c24;
background-repeat-x: no-repeat;
- background-position-y: 11px;
z-index: 1;
}
From 200f17b7c164a1dbb79a86ac8a9611fdf1a59103 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:49:58 +0200
Subject: [PATCH 72/85] Update filebrowser.js
---
filebrowser.js | 50 +++++++++++++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 17 deletions(-)
diff --git a/filebrowser.js b/filebrowser.js
index 58e90ecb9c..41b9be7bcd 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -266,8 +266,32 @@ async function renderSidebarHTML() {
// stop loading
stopLoading();
- // hide loading items
- fileWrapper.classList.remove('loading-items');
+ // change location
+ treeLoc[1] = '';
+ treeLoc[2] = '';
+ saveTreeLocLS(treeLoc);
+
+
+ // if already viewing repositories page
+ if (fileWrapper.querySelector('.item.repo')) {
+
+ // hide loading items
+ fileWrapper.classList.remove('loading-items');
+
+ // change sidebar title
+ sidebarLogo.innerText = 'Repositories';
+
+ // hide branch button
+ sidebarBranch.classList.remove('visible');
+
+ // scroll to start of repo name
+ sidebarLogo.scrollTo(0, 0);
+ scrolledSidebarTitle();
+
+ // change header options
+ header.classList.add('out-of-repo');
+
+ }
// get repo obj from local storage
@@ -297,22 +321,14 @@ async function renderSidebarHTML() {
}
- // change location
- treeLoc[1] = '';
- treeLoc[2] = '';
- saveTreeLocLS(treeLoc);
-
- // change sidebar title
- sidebarLogo.innerText = 'Repositories';
-
- // hide branch button
- sidebarBranch.classList.remove('visible');
-
- // scroll to start of repo name
- sidebarLogo.scrollTo(0, 0);
- scrolledSidebarTitle();
+ // if not viewing repositories page
+ if (!fileWrapper.querySelector('.item.repo')) {
+
+ // render sidebar
+ renderSidebarHTML();
+
+ }
- renderSidebarHTML();
return;
From 709089d7b51a3cfe58df3073ad424df7287ca966 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 20:57:09 +0200
Subject: [PATCH 73/85] Update filebrowser.js
---
filebrowser.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 41b9be7bcd..31afc260b4 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -251,7 +251,8 @@ async function renderSidebarHTML() {
// if switched directory while loading, return
- if (user !== treeLoc[0] || repo !== treeLoc[1] ||
+ if (user !== treeLoc[0] ||
+ repoName !== treeLoc[1].split(':')[0] ||
contents !== treeLoc[2]) {
return;
From 009f1f6681c0595eb1264549d67b357fb6fde7d0 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 21:07:32 +0200
Subject: [PATCH 74/85] Update filebrowser.js
---
filebrowser.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index 31afc260b4..b453c75c27 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -279,6 +279,12 @@ async function renderSidebarHTML() {
// hide loading items
fileWrapper.classList.remove('loading-items');
+ // remove nonexistent repo
+ const nonExistentRepo = fileWrapper.querySelector('.item.repo[fullname="'+ (user + '/' + repoName) +'"], ' +
+ '.item.repo[repoobj^="%7B%22fullName%22:%22' + (user + '/' + repoName) + '%22"]');
+
+ nonExistentRepo.remove();
+
// change sidebar title
sidebarLogo.innerText = 'Repositories';
From dd0683b2798910a8983d0273671b83d68c24cca1 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 21:07:34 +0200
Subject: [PATCH 75/85] Update filebrowser.js
---
filebrowser.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index b453c75c27..71814be293 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -279,12 +279,14 @@ async function renderSidebarHTML() {
// hide loading items
fileWrapper.classList.remove('loading-items');
+
// remove nonexistent repo
const nonExistentRepo = fileWrapper.querySelector('.item.repo[fullname="'+ (user + '/' + repoName) +'"], ' +
'.item.repo[repoobj^="%7B%22fullName%22:%22' + (user + '/' + repoName) + '%22"]');
nonExistentRepo.remove();
+
// change sidebar title
sidebarLogo.innerText = 'Repositories';
From 18e210bca69bbe90b33a733e3e54f23b36678c95 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Thu, 10 Nov 2022 22:18:51 +0200
Subject: [PATCH 76/85] Update filebrowser.js
---
filebrowser.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/filebrowser.js b/filebrowser.js
index 71814be293..c4e439d02a 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -284,7 +284,7 @@ async function renderSidebarHTML() {
const nonExistentRepo = fileWrapper.querySelector('.item.repo[fullname="'+ (user + '/' + repoName) +'"], ' +
'.item.repo[repoobj^="%7B%22fullName%22:%22' + (user + '/' + repoName) + '%22"]');
- nonExistentRepo.remove();
+ if (nonExistentRepo) nonExistentRepo.remove();
// change sidebar title
From 6eb0b98822667c8e6179a33010422eeee3bb6c27 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 12 Nov 2022 11:23:21 +0200
Subject: [PATCH 77/85] Update client-channel.js
---
worker/client-channel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/worker/client-channel.js b/worker/client-channel.js
index 746e952c3d..90308a9d5a 100644
--- a/worker/client-channel.js
+++ b/worker/client-channel.js
@@ -4,7 +4,7 @@
// update worker name when updating worker
-const WORKER_NAME = 'codeit-worker-v608';
+const WORKER_NAME = 'codeit-worker-v609';
// internal paths
From 4e8bd211aed3abc80a3e2c73ce147fa2b8be7663 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sun, 13 Nov 2022 20:30:11 +0200
Subject: [PATCH 78/85] Update full.css
---
full.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/full.css b/full.css
index db91d1588e..7770e80bb5 100644
--- a/full.css
+++ b/full.css
@@ -1179,6 +1179,7 @@ body:not(.mobile) .sidebar .header .title .branch-icon:active {
.sidebar .header.searching .logo {
padding-left: 7px;
+ overflow-x: hidden;
max-width: calc(var(--sidebar-width) - 140px - 16px - 7px - 7px - 7px);
}
From a5f1499221321a4ee506d1c94a9c896db561e309 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sun, 13 Nov 2022 21:47:25 +0200
Subject: [PATCH 79/85] Update filebrowser.js
---
filebrowser.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index c4e439d02a..3f785edc1b 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2493,7 +2493,21 @@ function createNewFileInHTML() {
// change selected file
changeSelectedFile(treeLoc.join(), tempSHA, fileName, encodeUnicode('\r\n'), getFileLang(fileName),
[0, 0], [0, 0], true);
+
+ // close file view if open
+ if (liveView.classList.contains('file-open')) {
+
+ liveView.classList.add('notransition');
+ liveView.classList.remove('file-open');
+
+ onNextFrame(() => {
+
+ liveView.classList.remove('notransition');
+ });
+
+ }
+
// if on mobile device
if (isMobile) {
From 77c2d0f3ce672d8a5688032b148e8b22885a0c5c Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sun, 13 Nov 2022 21:48:16 +0200
Subject: [PATCH 80/85] Update filebrowser.js
---
filebrowser.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/filebrowser.js b/filebrowser.js
index 3f785edc1b..d2d229c25a 100644
--- a/filebrowser.js
+++ b/filebrowser.js
@@ -2506,6 +2506,18 @@ function createNewFileInHTML() {
});
+ // if on mobile device
+ if (isMobile) {
+
+ // update bottom float
+ bottomFloat.classList.remove('file-open');
+
+ } else {
+
+ liveToggle.classList.remove('file-open');
+
+ }
+
}
// if on mobile device
From f19463eb451e0910152fe6879f449597e2637789 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:34:44 +0200
Subject: [PATCH 81/85] Restore codeit.js
---
lib/codeit.js | 79 ++++++++++++++++++---------------------------------
1 file changed, 27 insertions(+), 52 deletions(-)
diff --git a/lib/codeit.js b/lib/codeit.js
index dd75bb298c..b45128d790 100644
--- a/lib/codeit.js
+++ b/lib/codeit.js
@@ -1,7 +1,7 @@
/*
codeit.js
- v3.1.2
+ v3.1.1
MIT License
https://codeit.codes
@@ -583,46 +583,30 @@ class CodeitElement extends HTMLElement {
if (event.shiftKey) {
- // delete a tab from selection
-
- // get caret pos in text
- const pos = cd.getSelection();
-
- let startPos = Math.min(pos.start, pos.end);
- let endPos = Math.max(pos.start, pos.end);
-
- // get text before cursor
-
- cd.setSelection(endPos);
-
const before = cd.beforeCursor();
// get padding of line
- let [linePadding, lineStartPos] = getPadding(before);
-
- // if line has tabs
- if (linePadding.length > 0) {
+ let [padding, start] = getPadding(before);
+
+ // get caret pos in text
+ let pos = cd.getSelection();
+
+ if (padding.length > 0) {
- // delete a tab
-
const tabLength = cd.options.tab.length;
- cd.setSelection(lineStartPos, lineStartPos + tabLength);
+ // remove full length tab
+
+ cd.setSelection(start + tabLength);
+
+ for (let i = 0; i < tabLength; i++) cd.deleteCurrentSelection();
+
+ pos.start -= tabLength;
+ pos.end -= tabLength;
- cd.deleteCurrentSelection();
-
// restore pos in text
- cd.setSelection(lineStartPos + linePadding.length - tabLength, endPos - tabLength);
+ cd.setSelection(pos.start, pos.end);
- const selectedTab = window.getSelection().toString().startsWith(cd.options.tab);
-
- if (selectedTab) {
-
- // restore pos in text
- cd.setSelection(lineStartPos + linePadding.length, endPos - tabLength);
-
- }
-
}
} else {
@@ -637,38 +621,29 @@ class CodeitElement extends HTMLElement {
if (selContents.includes('\n')) {
- // add tabs to selection string
+ // tab lines in selection
selContents = cd.options.tab + selContents.split('\n').join('\n' + cd.options.tab);
- // delete selection
- cd.deleteCurrentSelection();
-
// insert tabbed selection
- cd.insert(selContents, { moveToEnd: false });
-
- // get caret pos in text
- const pos = cd.getSelection();
-
- // restore pos in text
- cd.setSelection(pos.start, (pos.start + selContents.length));
+ cd.deleteCurrentSelection();
+ cd.insert(selContents);
} else {
// tab selection
+ const sel = cd.getSelection();
- // get caret pos in text
- const pos = cd.getSelection();
+ cd.setSelection(Math.min(sel.start, sel.end));
- const start = Math.min(pos.start, pos.end);
- const end = Math.max(pos.start, pos.end);
+ // insert tab at start of selection
+ cd.insert(cd.options.tab);
- cd.setSelection(start);
+ // reselect text
- // insert tab at start of selection
- cd.insert(cd.options.tab, { moveToEnd: false });
+ sel.start += cd.options.tab.length;
+ sel.end += cd.options.tab.length;
- // restore pos in text
- cd.setSelection(start, end + cd.options.tab.length);
+ cd.setSelection(sel.start, sel.end);
}
From 2ae6596fe16dd243dbf8af5002fa7a29464be83a Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:34:52 +0200
Subject: [PATCH 82/85] Restore codeit.js
From 244c9a7dffc462a66547f97dffe2159d0e6903b9 Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:35:35 +0200
Subject: [PATCH 83/85] Restore client-channel.js
---
worker/client-channel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/worker/client-channel.js b/worker/client-channel.js
index 90308a9d5a..d83788b65e 100644
--- a/worker/client-channel.js
+++ b/worker/client-channel.js
@@ -4,7 +4,7 @@
// update worker name when updating worker
-const WORKER_NAME = 'codeit-worker-v609';
+const WORKER_NAME = 'codeit-worker-v606';
// internal paths
From e9c714c05a47b52931ac5f4ad33195d42577803b Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:35:49 +0200
Subject: [PATCH 84/85] Restore codeit-autocomplete.js
---
lib/plugins/codeit-autocomplete.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/plugins/codeit-autocomplete.js b/lib/plugins/codeit-autocomplete.js
index e6e8310a8d..e7a3506e03 100644
--- a/lib/plugins/codeit-autocomplete.js
+++ b/lib/plugins/codeit-autocomplete.js
@@ -31,7 +31,6 @@ CSSProps.push('flex');
CSSProps.push('grid');
CSSProps.push('gap');
CSSProps.push('background');
-CSSProps.push('overflow');
CSSProps.push('-webkit-user-select');
const maxChar = 0;//4;
From 553f407e914ace2fbb8dc7002d6b535d3566b4ae Mon Sep 17 00:00:00 2001
From: Bar Hatsor <34835685+barhatsor@users.noreply.github.com>
Date: Sat, 26 Nov 2022 14:38:40 +0200
Subject: [PATCH 85/85] Restore bottomfloat.js
---
bottomfloat.js | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/bottomfloat.js b/bottomfloat.js
index cd00aad937..a0eaae3d5d 100644
--- a/bottomfloat.js
+++ b/bottomfloat.js
@@ -107,7 +107,7 @@ floatDownload.addEventListener('click', downloadSelFile);
// if on mobile
if (isMobile) {
-
+
cd.on('scroll', checkBottomFloat, false);
cd.on('blur', () => {
@@ -116,12 +116,6 @@ if (isMobile) {
});
- cd.on('focus', () => {
-
- bottomWrapper.classList.add('hidden');
-
- });
-
// update on screen resize
@@ -176,7 +170,7 @@ function checkBottomFloat() {
}
- } else if (document.activeElement !== cd) { // if scrolled up
+ } else { // if scrolled up
// if passed threshold
if ((lastScrollTop - st) > 20) {