Skip to content

Commit c83873c

Browse files
committed
[v1.0.8] Recent company information | Bug fixes
1 parent 654788c commit c83873c

File tree

9 files changed

+42
-26
lines changed

9 files changed

+42
-26
lines changed
-405 KB
Binary file not shown.
381 KB
Binary file not shown.

chrome/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ <h2 style="font-family: 'Playfair'; font-style: italic; font-weight: bold; borde
7171
</div>
7272
<br><br>
7373
<div id = "company_table">
74+
<h4 style="font-family: 'Playfair'; font-style: italic;"><sup>&#10031;</sup> - <i> Asked in recent interviews</i></h4>
7475
<table id="dtBasicExample" class="table table-striped table-bordered table-sm" cellspacing="0" width="100%" style="font-family: Segoe UI;">
7576
</table>
7677
</div>

chrome/leetcoder.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h2 style="text-align: center; font-family: Segoe UI;">Quick Access Panel</h2>
149149
</div>
150150
</div>
151151
<hr>
152-
<div class="preparation-container">
152+
<div class="preparation-container" id="cracktech-preparation-container">
153153
<div class = "preparation-header-content" style="border-radius: 1px; margin: 30px 0px 30px; border: 3px solid; border-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);border-image-slice: 1;">
154154
<h3 id = "heading-line"></h3>
155155
</div>

chrome/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CrackTech - Find LeetCode Company Tags",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"homepage_url":"https://github.com/ssavi-ict/LC-Which-Company",
55
"description": "An extension that can help candidate to prepare for a Company specific DSA interview.",
66
"manifest_version": 3,
@@ -24,7 +24,7 @@
2424
],
2525
"content_scripts": [
2626
{
27-
"matches": ["<all_urls>"],
27+
"matches": ["https://leetcode.com/"],
2828
"js": ["script/analyze_profile.js"]
2929
}
3030
]

chrome/popup.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
<body>
4747
<div id = "main-content" class="newdiv" style="width: 400px; min-height: 250px; border: 1px solid; border-image: linear-gradient(to right, red,green, blue);border-image-slice: 1; font-size: small;">
4848

49+
</div>
50+
<div id="note-content" style="margin-top: -10px; margin-bottom: -10px;">
51+
<p><sup>&#10031;</sup> - <i>Asked in recent interviews</i></p>
4952
</div>
5053
<div class="footer_content" id="footer_content_1">
5154
<table>
@@ -62,7 +65,9 @@
6265
<div class="footer">
6366
[<a href="https://github.com/ssavi-ict/LeetCode-Which-Company/issues/4" target="_blank" style="text-decoration: none;">contribute</a>]
6467
&nbsp;|&nbsp;
65-
[&copy;<a href="https://www.linkedin.com/in/ssavi-ict/" style="text-decoration: none;">ssavi</a>]
68+
[ <a href="https://ssavi-ict.github.io/LeetCode-Which-Company/" style="text-decoration: none;" target="_blank">unable to view company information</a> ]
69+
&nbsp;|&nbsp;
70+
[&copy;<a href="https://www.linkedin.com/in/ssavi-ict/" style="text-decoration: none;" target="_blank">ssavi</a>]
6671
</div>
6772
</body>
6873
<script type="text/javascript" src="popup.js"></script>

chrome/popup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,23 @@ async function leetcode_company(){
3535

3636
if(json_response [theReformedURL]){
3737
const company_list_elem = json_response[theReformedURL];
38-
const sorted = company_list_elem.slice(1).sort((a, b) => a.length - b.length);
38+
const sorted = company_list_elem.slice(1); // .sort((a, b) => a.length - b.length);
3939
const companies = [company_list_elem[0]].concat(sorted);
40+
4041

4142
let length = companies.length;
4243
let problem_name = ("<h3 style='text-align:center;border-bottom: 2px solid black;background-image: linear-gradient(45deg, red, orange, green, blue, indigo, violet); -webkit-background-clip: text; -webkit-text-fill-color: transparent;'>Problem Name : ");
4344
let text = "<center><p>";
44-
let char_len = 0;
45+
4546
for (let i=0; i<length; i++){
4647
if(i === 0){
4748
problem_name += companies[i] + "</h3>";
4849
}
4950
else{
5051
text += "<p style='display: inline-block; border-radius: 2px; margin-bottom:5px;border: 1px solid; border-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet);border-image-slice: 1;'>&nbsp;<b>" + companies[i];
52+
if(i <= 5) {
53+
text += " <sup>&#10031;</sup>";
54+
}
5155
text += "&nbsp; </b></p>&nbsp;";
5256
}
5357
}

chrome/script/analyze_profile.js

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -350,23 +350,28 @@ async function fetchLeetCodeData(locator_param) {
350350
});
351351
}
352352

353-
// Example usage: Fetch data and use it
354-
fetchLeetCodeData(0);
355-
356-
const easy_button = document.getElementById("easy_button");
357-
const mid_button = document.getElementById("mid_button");
358-
const hard_button = document.getElementById("hard_button");
359-
360-
// Add onclick event handlers for each button
361-
easy_button.onclick = function() {
362-
fetchLeetCodeData(1);
363-
};
364-
365-
mid_button.onclick = function() {
366-
fetchLeetCodeData(2);
367-
};
368-
369-
hard_button.onclick = function() {
370-
fetchLeetCodeData(3);
371-
};
353+
document.addEventListener('DOMContentLoaded', function () {
354+
if (window.location.href.includes('leetcoder.html')) {
355+
// Example usage: Fetch data and use it
356+
fetchLeetCodeData(0);
357+
358+
const easy_button = document.getElementById("easy_button");
359+
const mid_button = document.getElementById("mid_button");
360+
const hard_button = document.getElementById("hard_button");
361+
362+
// Add onclick event handlers for each button
363+
if(!easy_button && !mid_button && !hard_button) return;
364+
easy_button.onclick = function() {
365+
fetchLeetCodeData(1);
366+
};
367+
368+
mid_button.onclick = function() {
369+
fetchLeetCodeData(2);
370+
};
371+
372+
hard_button.onclick = function() {
373+
fetchLeetCodeData(3);
374+
};
375+
}
376+
});
372377

chrome/script/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ fetch('https://raw.githubusercontent.com/ssavi-ict/LC-Which-Company/main/data/co
1313
let plink = key, pname = data[key][0];
1414
tableContent += "<tr>";
1515
tableContent += "<td><a href = '" + plink + "' target='_blank'>" + pname +"</a></td>";
16-
tableContent += "<td style='background-image: linear-gradient(45deg, red, orange, green, blue, indigo, violet); -webkit-background-clip: text; -webkit-text-fill-color: transparent;'>";
16+
tableContent += "<td style='background-image: linear-gradient(45deg, red, orange, green, blue, indigo, violet); -webkit-background-clip: text; -webkit-text-fill-color: inherit;'>";
1717
for(let i=1; i<data[key].length; i++){
1818
if(i > 1){
1919
tableContent += ', ';
2020
}
2121
tableContent += data[key][i];
22+
if(i <= 5) tableContent += "<sup>&#10031;</sup>";
2223
}
2324
tableContent += "</td>";
2425
tableContent += "<td></td>";

0 commit comments

Comments
 (0)