Skip to content

Commit b9cde15

Browse files
authored
Merge pull request #436 from ssavi-ict/v2.1.0
[v2.1.0] Bug Fix
2 parents 4b8dca6 + ce65db3 commit b9cde15

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

chrome/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ <h2 id="companyInfoHeaderText" class="company_info_header">Filtered by Company</
6868
<br><br>
6969
<div class="tab-container">
7070
<!-- Tab buttons -->
71-
<div class="tab-buttons">
71+
<!-- <div class="tab-buttons">
7272
<button onclick="openTab('companyQuestions', 'Filtered by Company')" class="active">Company Based Filtering</button>
7373
<button onclick="openTab('companyTable', 'Filtered by Problems')">Problem Based Filtering</button>
74+
</div> -->
75+
<div class="tab-buttons">
76+
<button id="companyQuestionsTab" class="active">Company Specific Question List</button>
77+
<button id="interviewQuestionsTab">Interview Questions</button>
7478
</div>
7579

7680
<!-- Tab content -->

chrome/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "CrackTech-LeetCode Company Tag, DSA Prep",
33
"version": "2.0.1",
44
"homepage_url":"https://github.com/ssavi-ict/LeetCode-Which-Company",
5-
"description": "An extension that can help candidate to prepare for a Company specific DSA interview.",
5+
"description": "Extension that can help candidate to prepare for a Company specific DSA interview.",
66
"manifest_version": 3,
77
"author": "Avik Sarkar",
88
"action":{
@@ -25,7 +25,7 @@
2525
"content_scripts": [
2626
{
2727
"matches": ["https://leetcode.com/"],
28-
"js": ["script/analyze_profile.js", "script/sde_sheet_script.js"],
28+
"js": ["script/analyze_profile.js", "script/sde_sheet_script.js", "script/tabsim.script.js"],
2929
"resources": ["ext_data/sheets.json"]
3030
}
3131
]

chrome/script/tabsim.script.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
document.addEventListener("DOMContentLoaded", () => {
2-
loadCompanyNames(); // Load company names when the page loads
2+
// loadCompanyNames(); // Load company names when the page loads
3+
loadCompanyNames();
4+
bindTabEvents();
35
});
46

57
let companyInfo = {}; // To store parsed company_info.json
8+
let selectedRow = null; // To track the currently selected row
69

7-
async function openTab(tabName, headerText) {
10+
function bindTabEvents() {
11+
const companyTab = document.getElementById('companyQuestionsTab');
12+
const interviewTab = document.getElementById('interviewQuestionsTab');
13+
14+
companyTab.addEventListener('click', () => openTab('companyQuestions', 'Filtered by Company', companyTab));
15+
interviewTab.addEventListener('click', () => openTab('companyTable', 'Filtered by Problems', interviewTab));
16+
}
17+
18+
async function openTab(tabName, headerText, tabElement) {
819
document.getElementById('companyInfoHeaderText').innerText = headerText;
920

1021
const contents = document.getElementsByClassName('tab-content');
@@ -18,13 +29,13 @@ async function openTab(tabName, headerText) {
1829
}
1930

2031
document.getElementById(tabName).classList.add('active');
21-
event.target.classList.add('active');
32+
tabElement.classList.add('active');
2233

2334
// Check if company names are already loaded
24-
const tbody = document.getElementById('companyNameTable').querySelector('tbody');
35+
/*const tbody = document.getElementById('companyNameTable').querySelector('tbody');
2536
if (tabName === 'companyQuestions' && tbody.children.length === 0) {
2637
await loadCompanyNames();
27-
}
38+
} */
2839
}
2940

3041

0 commit comments

Comments
 (0)