在选项栏下面增加file filter ,template
Browse files- index.html +8 -3
- script.js +11 -0
index.html
CHANGED
|
@@ -26,12 +26,16 @@
|
|
| 26 |
<button id="fetch-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-r-lg transition duration-200 flex items-center">
|
| 27 |
<i data-feather="download" class="mr-2"></i> Fetch
|
| 28 |
</button>
|
| 29 |
-
</div>
|
| 30 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 32 |
<div>
|
| 33 |
<label class="block text-sm font-medium text-gray-700 mb-2">File Filter</label>
|
| 34 |
-
|
| 35 |
<option value="all">All Files (*.*)</option>
|
| 36 |
<option value="code">Code Only (.js, .ts, .py, .java, .cpp, .c, .h, .cs, .go, .rb, .php, .swift, .kt, .rs, .sh)</option>
|
| 37 |
<option value="docs">Documentation Only (.md, .txt, .rst, .adoc, .tex)</option>
|
|
@@ -39,8 +43,9 @@
|
|
| 39 |
<option value="tests">Test Files (_test.js, .spec.js, test_*.py, *_test.go)</option>
|
| 40 |
<option value="styles">Styles (.css, .scss, .sass, .less)</option>
|
| 41 |
<option value="assets">Assets (.png, .jpg, .svg, .gif, .mp4, .woff, .ttf)</option>
|
|
|
|
| 42 |
</select>
|
| 43 |
-
|
| 44 |
|
| 45 |
<div>
|
| 46 |
<label class="block text-sm font-medium text-gray-700 mb-2">Template</label>
|
|
|
|
| 26 |
<button id="fetch-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-r-lg transition duration-200 flex items-center">
|
| 27 |
<i data-feather="download" class="mr-2"></i> Fetch
|
| 28 |
</button>
|
|
|
|
| 29 |
</div>
|
| 30 |
+
<div id="custom-filter-section" class="hidden">
|
| 31 |
+
<label for="custom-file-types" class="block text-sm font-medium text-gray-700 mb-2">Custom File Extensions (comma separated)</label>
|
| 32 |
+
<input type="text" id="custom-file-types" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" placeholder=".ext1, .ext2, .ext3">
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 36 |
<div>
|
| 37 |
<label class="block text-sm font-medium text-gray-700 mb-2">File Filter</label>
|
| 38 |
+
<select id="file-filter" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
| 39 |
<option value="all">All Files (*.*)</option>
|
| 40 |
<option value="code">Code Only (.js, .ts, .py, .java, .cpp, .c, .h, .cs, .go, .rb, .php, .swift, .kt, .rs, .sh)</option>
|
| 41 |
<option value="docs">Documentation Only (.md, .txt, .rst, .adoc, .tex)</option>
|
|
|
|
| 43 |
<option value="tests">Test Files (_test.js, .spec.js, test_*.py, *_test.go)</option>
|
| 44 |
<option value="styles">Styles (.css, .scss, .sass, .less)</option>
|
| 45 |
<option value="assets">Assets (.png, .jpg, .svg, .gif, .mp4, .woff, .ttf)</option>
|
| 46 |
+
<option value="custom">Custom File Types</option>
|
| 47 |
</select>
|
| 48 |
+
</div>
|
| 49 |
|
| 50 |
<div>
|
| 51 |
<label class="block text-sm font-medium text-gray-700 mb-2">Template</label>
|
script.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
| 1 |
|
| 2 |
document.addEventListener('DOMContentLoaded', function() {
|
| 3 |
const fetchBtn = document.getElementById('fetch-btn');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
const repoUrlInput = document.getElementById('repo-url');
|
| 5 |
const fileFilterSelect = document.getElementById('file-filter');
|
| 6 |
const templateSelect = document.getElementById('template');
|
|
|
|
| 1 |
|
| 2 |
document.addEventListener('DOMContentLoaded', function() {
|
| 3 |
const fetchBtn = document.getElementById('fetch-btn');
|
| 4 |
+
const fileFilterSelect = document.getElementById('file-filter');
|
| 5 |
+
const customFilterSection = document.getElementById('custom-filter-section');
|
| 6 |
+
|
| 7 |
+
// Show/hide custom file types input based on selection
|
| 8 |
+
fileFilterSelect.addEventListener('change', function() {
|
| 9 |
+
if (this.value === 'custom') {
|
| 10 |
+
customFilterSection.classList.remove('hidden');
|
| 11 |
+
} else {
|
| 12 |
+
customFilterSection.classList.add('hidden');
|
| 13 |
+
}
|
| 14 |
+
});
|
| 15 |
const repoUrlInput = document.getElementById('repo-url');
|
| 16 |
const fileFilterSelect = document.getElementById('file-filter');
|
| 17 |
const templateSelect = document.getElementById('template');
|