Skip to content

Commit 6e93194

Browse files
committed
Refactor content.js for improved readability and consistency; update manifest.json to correct icon path; add marked.min.js for Markdown parsing; enhance popup.js to utilize marked for rendering AI responses; introduce new styles in popup.css for Markdown content; add new icon assets.
1 parent b18fcea commit 6e93194

File tree

9 files changed

+665
-365
lines changed

9 files changed

+665
-365
lines changed

assets/icon128.png

1.49 KB
Loading

assets/icon16.png

-524 Bytes
Loading

assets/icon48.png

-713 Bytes
Loading

content.js

+193-116
Large diffs are not rendered by default.

manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"default_icon": {
1616
"16": "assets/icon16.png",
1717
"48": "assets/icon48.png",
18-
"128": "assets/icon48.png"
18+
"128": "assets/icon128.png"
1919
}
2020
},
2121
"content_scripts": [
@@ -30,6 +30,6 @@
3030
"icons": {
3131
"16": "assets/icon16.png",
3232
"48": "assets/icon48.png",
33-
"128": "assets/icon48.png"
33+
"128": "assets/icon128.png"
3434
}
3535
}

marked.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

popup.css

+34
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,40 @@ button:disabled {
110110
font-size: 13px;
111111
}
112112

113+
/* Styles for Markdown content */
114+
.response ul,
115+
.response ol {
116+
padding-left: 20px;
117+
margin-top: 5px;
118+
margin-bottom: 10px;
119+
}
120+
121+
.response li {
122+
margin-bottom: 5px;
123+
}
124+
125+
.response strong {
126+
font-weight: bold;
127+
}
128+
129+
.response em {
130+
font-style: italic;
131+
}
132+
133+
.response h1,
134+
.response h2,
135+
.response h3,
136+
.response h4 {
137+
margin-top: 10px;
138+
margin-bottom: 5px;
139+
color: #2c3e50;
140+
}
141+
142+
.response h1 { font-size: 1.2em; }
143+
.response h2 { font-size: 1.1em; }
144+
.response h3 { font-size: 1.0em; }
145+
.response h4 { font-size: 0.9em; }
146+
113147
.hidden {
114148
display: none;
115149
}

popup.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</head>
77
<body>
88
<div class="container">
9-
<h1>LeetCode AI Assistant</h1>
9+
<h1>LeetCode AI Assistant <button id="settings-toggle" class="icon-button" title="Settings"><img src="assets/icon16.png" alt="Settings"></button></h1>
1010

1111
<div class="section">
1212
<h2>Problem Details</h2>
@@ -15,7 +15,7 @@ <h2>Problem Details</h2>
1515
</div>
1616
</div>
1717

18-
<div class="section">
18+
<div id="settings-section" class="section hidden">
1919
<h2>AI Settings</h2>
2020
<div class="settings">
2121
<div class="setting-item">
@@ -69,6 +69,7 @@ <h2>AI Assistant</h2>
6969
</div>
7070
</div>
7171

72+
<script src="marked.min.js"></script>
7273
<script src="popup.js"></script>
7374
</body>
7475
</html>

0 commit comments

Comments
 (0)