Skip to content

Commit 0067340

Browse files
authored
Update gitauth.js
1 parent 315ae8e commit 0067340

File tree

1 file changed

+0
-69
lines changed

1 file changed

+0
-69
lines changed

git/gitauth.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -17,75 +17,6 @@ window.onload = async () => {
1717

1818
treeLoc = getStorage('tree') ? getStorage('tree').split(',') : ['', '', ''];
1919

20-
const url = new URL(window.location.href);
21-
const urlQuery = url.searchParams.get('q');
22-
23-
window.history.pushState(window.location.origin, 'Codeit', window.location.origin + '/full');
24-
25-
if (urlQuery) {
26-
27-
toggleSidebar(false);
28-
saveSidebarStateLS();
29-
30-
treeLoc = urlQuery.split('+')[0].split(',');
31-
32-
const fileName = urlQuery.split('+')[1].split(',')[0];
33-
const fileSha = urlQuery.split('+')[1].split(',')[1];
34-
35-
// change selected file
36-
changeSelectedFile(treeLoc.join(), fileSha, fileName, '\n\r', getFileLang(fileName),
37-
[0, 0], [0, 0], false);
38-
39-
// start loading
40-
startLoading();
41-
42-
// get file from git
43-
const resp = await git.getFile(treeLoc, fileName);
44-
45-
// change selected file
46-
changeSelectedFile(treeLoc.join(), fileSha, fileName, resp.content, getFileLang(fileName),
47-
[0, 0], [0, 0], false);
48-
49-
// stop loading
50-
stopLoading();
51-
52-
// expand bottom float
53-
bottomWrapper.classList.add('expanded');
54-
toggleLiveView(selectedFile);
55-
56-
// show file content in codeit
57-
cd.textContent = decodeUnicode(selectedFile.content);
58-
59-
// change codeit lang
60-
cd.lang = selectedFile.lang;
61-
62-
// set caret pos in codeit
63-
cd.setSelection(selectedFile.caretPos[0], selectedFile.caretPos[1]);
64-
65-
// set scroll pos in codeit
66-
cd.scrollTo(selectedFile.scrollPos[0], selectedFile.scrollPos[1]);
67-
68-
// clear codeit history
69-
cd.history = [];
70-
71-
// update line numbers
72-
updateLineNumbersHTML();
73-
74-
// if on mobile device
75-
if (isMobile) {
76-
77-
// update bottom float
78-
updateFloat();
79-
80-
} else { // if on desktop
81-
82-
// check codeit scrollbar
83-
checkScrollbarArrow();
84-
85-
}
86-
87-
}
88-
8920
loginButton.addEventListener('click', () => {
9021

9122
window.open('https://github.com/login/oauth/authorize?client_id='+ clientId +'&scope=repo,write:org', 'Login with Github', 'height=575,width=575');

0 commit comments

Comments
 (0)