Spaces:
Running
Running
Add 2 files
Browse files- index.html +39 -5
index.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
| 32 |
button.small { padding: 6px 12px; font-size: 13px; }
|
| 33 |
.form-group { margin-bottom: 10px; }
|
| 34 |
.filter-group { display: flex; gap: 15px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
|
| 35 |
-
.filter-group > div { flex: 1; min-width:
|
| 36 |
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 15px; }
|
| 37 |
th { background: #007bff; color: white; padding: 14px; text-align: left; }
|
| 38 |
td { padding: 12px; border-bottom: 1px solid #dee2e6; vertical-align: top; }
|
|
@@ -99,16 +99,22 @@
|
|
| 99 |
<div class="filter-group">
|
| 100 |
<div>
|
| 101 |
<label>Filter Jenis</label>
|
| 102 |
-
<select id="filterJenis" onchange="terapkanFilter()">
|
| 103 |
<option value="">Semua Jenis</option>
|
| 104 |
</select>
|
| 105 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
<div>
|
| 107 |
<label>Filter Kata Kunci</label>
|
| 108 |
<input type="text" id="filterKata" list="suggestions" placeholder="Ketik untuk mencari..." oninput="terapkanFilter()">
|
| 109 |
<datalist id="suggestions"></datalist>
|
| 110 |
</div>
|
| 111 |
-
<div>
|
| 112 |
<button onclick="terapkanFilter()">Terapkan Filter</button>
|
| 113 |
<button class="secondary" onclick="resetFilter()">Reset Filter</button>
|
| 114 |
</div>
|
|
@@ -206,6 +212,24 @@
|
|
| 206 |
indicatorSelect.add(new Option('--- Tambah Sub Bab Baru ---', 'new'));
|
| 207 |
}
|
| 208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
function updateAutocompleteSuggestions() {
|
| 210 |
const datalist = document.getElementById('suggestions');
|
| 211 |
datalist.innerHTML = '';
|
|
@@ -272,6 +296,7 @@
|
|
| 272 |
buildSubBabMapping();
|
| 273 |
updateJenisDropdown();
|
| 274 |
updateIndicatorDropdown();
|
|
|
|
| 275 |
updateAutocompleteSuggestions();
|
| 276 |
resetForm();
|
| 277 |
alert(editIndex === -1 ? 'Data berhasil disimpan!' : 'Data berhasil diperbarui!');
|
|
@@ -327,6 +352,7 @@
|
|
| 327 |
buildSubBabMapping();
|
| 328 |
updateJenisDropdown();
|
| 329 |
updateIndicatorDropdown();
|
|
|
|
| 330 |
updateAutocompleteSuggestions();
|
| 331 |
tampilkanData();
|
| 332 |
alert('Data berhasil dihapus!');
|
|
@@ -335,6 +361,7 @@
|
|
| 335 |
|
| 336 |
function tampilkanData() {
|
| 337 |
const filterJenis = document.getElementById('filterJenis').value;
|
|
|
|
| 338 |
const filterKata = document.getElementById('filterKata').value.toLowerCase().trim();
|
| 339 |
|
| 340 |
const tbody = document.querySelector('#tabelPembelajaran tbody');
|
|
@@ -342,12 +369,14 @@
|
|
| 342 |
|
| 343 |
let filtered = dataPembelajaran;
|
| 344 |
|
| 345 |
-
// Terapkan filter jenis terlebih dahulu
|
| 346 |
if (filterJenis) {
|
| 347 |
filtered = filtered.filter(d => d.jenis === filterJenis);
|
| 348 |
}
|
| 349 |
|
| 350 |
-
|
|
|
|
|
|
|
|
|
|
| 351 |
if (filterKata) {
|
| 352 |
filtered = filtered.filter(d =>
|
| 353 |
d.hasil.toLowerCase().includes(filterKata) ||
|
|
@@ -380,10 +409,12 @@
|
|
| 380 |
|
| 381 |
function resetFilter() {
|
| 382 |
document.getElementById('filterJenis').value = '';
|
|
|
|
| 383 |
document.getElementById('filterKata').value = '';
|
| 384 |
tampilkanData();
|
| 385 |
}
|
| 386 |
|
|
|
|
| 387 |
function importExcel() {
|
| 388 |
const fileInput = document.getElementById('importFile');
|
| 389 |
const file = fileInput.files[0];
|
|
@@ -417,6 +448,7 @@
|
|
| 417 |
buildSubBabMapping();
|
| 418 |
updateJenisDropdown();
|
| 419 |
updateIndicatorDropdown();
|
|
|
|
| 420 |
updateAutocompleteSuggestions();
|
| 421 |
tampilkanData();
|
| 422 |
alert(`Berhasil mengimport ${imported} data!`);
|
|
@@ -470,6 +502,7 @@
|
|
| 470 |
|
| 471 |
if (tabName === 'Daftar') {
|
| 472 |
updateJenisDropdown();
|
|
|
|
| 473 |
updateAutocompleteSuggestions();
|
| 474 |
tampilkanData();
|
| 475 |
}
|
|
@@ -479,6 +512,7 @@
|
|
| 479 |
buildSubBabMapping();
|
| 480 |
updateJenisDropdown();
|
| 481 |
updateIndicatorDropdown();
|
|
|
|
| 482 |
updateAutocompleteSuggestions();
|
| 483 |
</script>
|
| 484 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=alterzick/notepad-v1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
|
| 32 |
button.small { padding: 6px 12px; font-size: 13px; }
|
| 33 |
.form-group { margin-bottom: 10px; }
|
| 34 |
.filter-group { display: flex; gap: 15px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
|
| 35 |
+
.filter-group > div { flex: 1; min-width: 180px; }
|
| 36 |
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 15px; }
|
| 37 |
th { background: #007bff; color: white; padding: 14px; text-align: left; }
|
| 38 |
td { padding: 12px; border-bottom: 1px solid #dee2e6; vertical-align: top; }
|
|
|
|
| 99 |
<div class="filter-group">
|
| 100 |
<div>
|
| 101 |
<label>Filter Jenis</label>
|
| 102 |
+
<select id="filterJenis" onchange="updateFilterIndicator(); terapkanFilter()">
|
| 103 |
<option value="">Semua Jenis</option>
|
| 104 |
</select>
|
| 105 |
</div>
|
| 106 |
+
<div>
|
| 107 |
+
<label>Filter Indicator (Sub Bab)</label>
|
| 108 |
+
<select id="filterIndicator" onchange="terapkanFilter()">
|
| 109 |
+
<option value="">Semua Sub Bab</option>
|
| 110 |
+
</select>
|
| 111 |
+
</div>
|
| 112 |
<div>
|
| 113 |
<label>Filter Kata Kunci</label>
|
| 114 |
<input type="text" id="filterKata" list="suggestions" placeholder="Ketik untuk mencari..." oninput="terapkanFilter()">
|
| 115 |
<datalist id="suggestions"></datalist>
|
| 116 |
</div>
|
| 117 |
+
<div style="align-self: end;">
|
| 118 |
<button onclick="terapkanFilter()">Terapkan Filter</button>
|
| 119 |
<button class="secondary" onclick="resetFilter()">Reset Filter</button>
|
| 120 |
</div>
|
|
|
|
| 212 |
indicatorSelect.add(new Option('--- Tambah Sub Bab Baru ---', 'new'));
|
| 213 |
}
|
| 214 |
|
| 215 |
+
// Update dropdown filter indicator berdasarkan filter jenis yang dipilih
|
| 216 |
+
function updateFilterIndicator() {
|
| 217 |
+
const selectedJenis = document.getElementById('filterJenis').value;
|
| 218 |
+
const filterIndicator = document.getElementById('filterIndicator');
|
| 219 |
+
|
| 220 |
+
filterIndicator.innerHTML = '<option value="">Semua Sub Bab</option>';
|
| 221 |
+
|
| 222 |
+
if (!selectedJenis) {
|
| 223 |
+
// Jika tidak ada filter jenis, tampilkan semua sub bab unik
|
| 224 |
+
const allIndicators = [...new Set(dataPembelajaran.map(d => d.indikator))].sort();
|
| 225 |
+
allIndicators.forEach(ind => filterIndicator.add(new Option(ind, ind)));
|
| 226 |
+
} else {
|
| 227 |
+
// Hanya tampilkan sub bab dari jenis yang difilter
|
| 228 |
+
const subBabList = subBabByJenis[selectedJenis] || [];
|
| 229 |
+
subBabList.forEach(ind => filterIndicator.add(new Option(ind, ind)));
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
function updateAutocompleteSuggestions() {
|
| 234 |
const datalist = document.getElementById('suggestions');
|
| 235 |
datalist.innerHTML = '';
|
|
|
|
| 296 |
buildSubBabMapping();
|
| 297 |
updateJenisDropdown();
|
| 298 |
updateIndicatorDropdown();
|
| 299 |
+
updateFilterIndicator();
|
| 300 |
updateAutocompleteSuggestions();
|
| 301 |
resetForm();
|
| 302 |
alert(editIndex === -1 ? 'Data berhasil disimpan!' : 'Data berhasil diperbarui!');
|
|
|
|
| 352 |
buildSubBabMapping();
|
| 353 |
updateJenisDropdown();
|
| 354 |
updateIndicatorDropdown();
|
| 355 |
+
updateFilterIndicator();
|
| 356 |
updateAutocompleteSuggestions();
|
| 357 |
tampilkanData();
|
| 358 |
alert('Data berhasil dihapus!');
|
|
|
|
| 361 |
|
| 362 |
function tampilkanData() {
|
| 363 |
const filterJenis = document.getElementById('filterJenis').value;
|
| 364 |
+
const filterIndicatorVal = document.getElementById('filterIndicator').value;
|
| 365 |
const filterKata = document.getElementById('filterKata').value.toLowerCase().trim();
|
| 366 |
|
| 367 |
const tbody = document.querySelector('#tabelPembelajaran tbody');
|
|
|
|
| 369 |
|
| 370 |
let filtered = dataPembelajaran;
|
| 371 |
|
|
|
|
| 372 |
if (filterJenis) {
|
| 373 |
filtered = filtered.filter(d => d.jenis === filterJenis);
|
| 374 |
}
|
| 375 |
|
| 376 |
+
if (filterIndicatorVal) {
|
| 377 |
+
filtered = filtered.filter(d => d.indikator === filterIndicatorVal);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
if (filterKata) {
|
| 381 |
filtered = filtered.filter(d =>
|
| 382 |
d.hasil.toLowerCase().includes(filterKata) ||
|
|
|
|
| 409 |
|
| 410 |
function resetFilter() {
|
| 411 |
document.getElementById('filterJenis').value = '';
|
| 412 |
+
document.getElementById('filterIndicator').innerHTML = '<option value="">Semua Sub Bab</option>';
|
| 413 |
document.getElementById('filterKata').value = '';
|
| 414 |
tampilkanData();
|
| 415 |
}
|
| 416 |
|
| 417 |
+
// Import, Export, dan fungsi lainnya tetap sama seperti sebelumnya
|
| 418 |
function importExcel() {
|
| 419 |
const fileInput = document.getElementById('importFile');
|
| 420 |
const file = fileInput.files[0];
|
|
|
|
| 448 |
buildSubBabMapping();
|
| 449 |
updateJenisDropdown();
|
| 450 |
updateIndicatorDropdown();
|
| 451 |
+
updateFilterIndicator();
|
| 452 |
updateAutocompleteSuggestions();
|
| 453 |
tampilkanData();
|
| 454 |
alert(`Berhasil mengimport ${imported} data!`);
|
|
|
|
| 502 |
|
| 503 |
if (tabName === 'Daftar') {
|
| 504 |
updateJenisDropdown();
|
| 505 |
+
updateFilterIndicator();
|
| 506 |
updateAutocompleteSuggestions();
|
| 507 |
tampilkanData();
|
| 508 |
}
|
|
|
|
| 512 |
buildSubBabMapping();
|
| 513 |
updateJenisDropdown();
|
| 514 |
updateIndicatorDropdown();
|
| 515 |
+
updateFilterIndicator();
|
| 516 |
updateAutocompleteSuggestions();
|
| 517 |
</script>
|
| 518 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=alterzick/notepad-v1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|