Spaces:
Running
Running
Add 3 files
Browse files- README.md +6 -4
- index.html +447 -19
- prompts.txt +0 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: notepad-v1
|
| 3 |
+
emoji: ⚛️
|
| 4 |
+
colorFrom: purple
|
| 5 |
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- QwenSite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,447 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="id">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Aplikasi Catatan Pembelajaran</title>
|
| 7 |
+
<!-- jsPDF + autoTable untuk PDF berkualitas tinggi -->
|
| 8 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
| 9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.8.2/jspdf.plugin.autotable.min.js"></script>
|
| 10 |
+
<!-- SheetJS untuk Excel -->
|
| 11 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
| 12 |
+
<style>
|
| 13 |
+
body { font-family: 'Segoe UI', Arial, sans-serif; margin: 0; background: #f0f2f5; }
|
| 14 |
+
h1 { text-align: center; color: #1a1a1a; margin: 20px 0; }
|
| 15 |
+
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
|
| 16 |
+
.card { background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); overflow: hidden; }
|
| 17 |
+
.tabs { display: flex; background: #f8f9fa; border-bottom: 1px solid #dee2e6; }
|
| 18 |
+
.tablink { flex: 1; padding: 16px; text-align: center; font-size: 18px; font-weight: 600; cursor: pointer; border: none; background: transparent; }
|
| 19 |
+
.tablink:hover { background: #e9ecef; }
|
| 20 |
+
.tablink.active { background: #007bff; color: white; }
|
| 21 |
+
.tabcontent { padding: 30px; display: none; }
|
| 22 |
+
.tabcontent.active { display: block; }
|
| 23 |
+
label { display: block; margin: 15px 0 8px; font-weight: 600; color: #333; }
|
| 24 |
+
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ced4da; border-radius: 8px; box-sizing: border-box; font-size: 16px; }
|
| 25 |
+
textarea { resize: vertical; min-height: 120px; }
|
| 26 |
+
button { padding: 10px 20px; background: #007bff; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; margin: 5px; }
|
| 27 |
+
button:hover { background: #0056b3; }
|
| 28 |
+
button.secondary { background: #6c757d; }
|
| 29 |
+
button.secondary:hover { background: #545b62; }
|
| 30 |
+
button.danger { background: #dc3545; }
|
| 31 |
+
button.danger:hover { background: #c82333; }
|
| 32 |
+
button.small { padding: 6px 12px; font-size: 14px; }
|
| 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: 200px; }
|
| 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; }
|
| 39 |
+
tr:hover { background: #f8f9fa; }
|
| 40 |
+
.text-wrap { white-space: pre-wrap; word-wrap: break-word; }
|
| 41 |
+
.actions { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
|
| 42 |
+
.edit-mode { background: #fff3cd; padding: 10px; border-radius: 8px; margin-bottom: 20px; }
|
| 43 |
+
@media (max-width: 768px) {
|
| 44 |
+
.filter-group { flex-direction: column; }
|
| 45 |
+
.tablink { font-size: 16px; padding: 12px; }
|
| 46 |
+
table { font-size: 14px; }
|
| 47 |
+
td, th { padding: 8px; }
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
</head>
|
| 51 |
+
<body>
|
| 52 |
+
<div class="container">
|
| 53 |
+
<h1>Aplikasi Catatan Pembelajaran</h1>
|
| 54 |
+
|
| 55 |
+
<div class="card">
|
| 56 |
+
<div class="tabs">
|
| 57 |
+
<button class="tablink active" onclick="openTab(event, 'Input')">Input Pembelajaran</button>
|
| 58 |
+
<button class="tablink" onclick="openTab(event, 'Daftar')">Daftar Pembelajaran</button>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<!-- Tab Input -->
|
| 62 |
+
<div id="Input" class="tabcontent active">
|
| 63 |
+
<h2 style="margin-top:0; color:#333;">Input Data Pembelajaran</h2>
|
| 64 |
+
|
| 65 |
+
<div id="editModeInfo" class="edit-mode" style="display:none;">
|
| 66 |
+
<strong>Sedang mengedit entri #<span id="editIndex"></span></strong>
|
| 67 |
+
<button class="secondary small" onclick="batalEdit()">Batal Edit</button>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<label>Jenis Pembelajaran</label>
|
| 71 |
+
<select id="jenisSelect"></select>
|
| 72 |
+
|
| 73 |
+
<div id="manualJenisInput" class="form-group" style="display:none;">
|
| 74 |
+
<label>Tambah Jenis Baru</label>
|
| 75 |
+
<input type="text" id="jenisManual" placeholder="Contoh: Pemrograman, Fisika, dll.">
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<label>Indicator (Sub Bab yang Dibahas)</label>
|
| 79 |
+
<select id="indicatorSelect"></select>
|
| 80 |
+
|
| 81 |
+
<div id="manualIndicatorInput" class="form-group" style="display:none;">
|
| 82 |
+
<label>Tambah Sub Bab Baru</label>
|
| 83 |
+
<input type="text" id="indicatorManual" placeholder="Contoh: Aljabar, HTML Dasar">
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<label>Hasil Pembelajaran</label>
|
| 87 |
+
<textarea id="hasil" placeholder="Tuliskan detail apa yang telah Anda pelajari..."></textarea>
|
| 88 |
+
|
| 89 |
+
<label>Kesimpulan</label>
|
| 90 |
+
<textarea id="kesimpulan" placeholder="Tuliskan poin penting atau kesimpulan..."></textarea>
|
| 91 |
+
|
| 92 |
+
<div>
|
| 93 |
+
<button onclick="simpanData()">Simpan Pembelajaran</button>
|
| 94 |
+
<button class="secondary" onclick="resetForm()">Reset Form</button>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<!-- Tab Daftar -->
|
| 99 |
+
<div id="Daftar" class="tabcontent">
|
| 100 |
+
<h2 style="margin-top:0; color:#333;">Daftar Semua Pembelajaran</h2>
|
| 101 |
+
|
| 102 |
+
<div class="filter-group">
|
| 103 |
+
<div>
|
| 104 |
+
<label>Filter Jenis</label>
|
| 105 |
+
<select id="filterJenis"><option value="">Semua Jenis</option></select>
|
| 106 |
+
</div>
|
| 107 |
+
<div>
|
| 108 |
+
<label>Filter Kata Kunci</label>
|
| 109 |
+
<input type="text" id="filterKata" placeholder="Cari di hasil atau kesimpulan...">
|
| 110 |
+
</div>
|
| 111 |
+
<div>
|
| 112 |
+
<button onclick="terapkanFilter()">Terapkan Filter</button>
|
| 113 |
+
<button class="secondary" onclick="resetFilter()">Reset Filter</button>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<div class="actions">
|
| 118 |
+
<div>
|
| 119 |
+
<label style="display:inline-block; margin-right:10px;">Import dari Excel:</label>
|
| 120 |
+
<input type="file" id="importFile" accept=".xlsx, .xls" style="display:inline-block; width:auto;">
|
| 121 |
+
<button onclick="importExcel()">Import Data</button>
|
| 122 |
+
</div>
|
| 123 |
+
<div>
|
| 124 |
+
<button onclick="exportExcel()">Export ke Excel</button>
|
| 125 |
+
<button onclick="exportPDF()">Export ke PDF</button>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<table id="tabelPembelajaran">
|
| 130 |
+
<thead>
|
| 131 |
+
<tr>
|
| 132 |
+
<th style="width:5%;">No</th>
|
| 133 |
+
<th style="width:15%;">Tanggal</th>
|
| 134 |
+
<th style="width:12%;">Jenis</th>
|
| 135 |
+
<th style="width:15%;">Indicator</th>
|
| 136 |
+
<th style="width:25%;">Hasil Pembelajaran</th>
|
| 137 |
+
<th style="width:23%;">Kesimpulan</th>
|
| 138 |
+
<th style="width:10%;">Aksi</th>
|
| 139 |
+
</tr>
|
| 140 |
+
</thead>
|
| 141 |
+
<tbody></tbody>
|
| 142 |
+
</table>
|
| 143 |
+
</div>
|
| 144 |
+
</div>
|
| 145 |
+
</div>
|
| 146 |
+
|
| 147 |
+
<script>
|
| 148 |
+
const { jsPDF } = window.jspdf;
|
| 149 |
+
|
| 150 |
+
let dataPembelajaran = JSON.parse(localStorage.getItem('pembelajaran')) || [];
|
| 151 |
+
let jenisList = [...new Set(dataPembelajaran.map(d => d.jenis))].sort();
|
| 152 |
+
if (jenisList.length === 0) jenisList = ["Matematika", "Bahasa", "Sains"];
|
| 153 |
+
let indicatorList = [...new Set(dataPembelajaran.map(d => d.indikator))].sort();
|
| 154 |
+
if (indicatorList.length === 0) indicatorList = ["Dasar", "Menengah", "Lanjutan"];
|
| 155 |
+
|
| 156 |
+
let editIndex = -1; // -1 = tambah baru, >=0 = edit entri
|
| 157 |
+
|
| 158 |
+
function updateDropdowns() {
|
| 159 |
+
const jenisSelect = document.getElementById('jenisSelect');
|
| 160 |
+
const filterJenis = document.getElementById('filterJenis');
|
| 161 |
+
const indicatorSelect = document.getElementById('indicatorSelect');
|
| 162 |
+
|
| 163 |
+
jenisSelect.innerHTML = '';
|
| 164 |
+
filterJenis.innerHTML = '<option value="">Semua Jenis</option>';
|
| 165 |
+
jenisList.forEach(j => {
|
| 166 |
+
jenisSelect.add(new Option(j, j));
|
| 167 |
+
filterJenis.add(new Option(j, j));
|
| 168 |
+
});
|
| 169 |
+
jenisSelect.add(new Option('--- Tambah Jenis Baru ---', 'new'));
|
| 170 |
+
|
| 171 |
+
indicatorSelect.innerHTML = '';
|
| 172 |
+
indicatorList.forEach(i => indicatorSelect.add(new Option(i, i)));
|
| 173 |
+
indicatorSelect.add(new Option('--- Tambah Sub Bab Baru ---', 'new'));
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
document.getElementById('jenisSelect').addEventListener('change', function() {
|
| 177 |
+
document.getElementById('manualJenisInput').style.display = this.value === 'new' ? 'block' : 'none';
|
| 178 |
+
});
|
| 179 |
+
|
| 180 |
+
document.getElementById('indicatorSelect').addEventListener('change', function() {
|
| 181 |
+
document.getElementById('manualIndicatorInput').style.display = this.value === 'new' ? 'block' : 'none';
|
| 182 |
+
});
|
| 183 |
+
|
| 184 |
+
function simpanData() {
|
| 185 |
+
let jenis = document.getElementById('jenisSelect').value;
|
| 186 |
+
if (jenis === 'new') {
|
| 187 |
+
jenis = document.getElementById('jenisManual').value.trim();
|
| 188 |
+
if (!jenis) return alert('Masukkan nama jenis baru!');
|
| 189 |
+
if (!jenisList.includes(jenis)) {
|
| 190 |
+
jenisList.push(jenis);
|
| 191 |
+
jenisList.sort();
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
let indikator = document.getElementById('indicatorSelect').value;
|
| 196 |
+
if (indikator === 'new') {
|
| 197 |
+
indikator = document.getElementById('indicatorManual').value.trim();
|
| 198 |
+
if (!indikator) return alert('Masukkan nama sub bab baru!');
|
| 199 |
+
if (!indicatorList.includes(indikator)) {
|
| 200 |
+
indicatorList.push(indikator);
|
| 201 |
+
indicatorList.sort();
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
const hasil = document.getElementById('hasil').value.trim();
|
| 206 |
+
const kesimpulan = document.getElementById('kesimpulan').value.trim();
|
| 207 |
+
|
| 208 |
+
if (!jenis || !indikator || !hasil || !kesimpulan) {
|
| 209 |
+
return alert('Semua field wajib diisi!');
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
const entry = {
|
| 213 |
+
tanggal: editIndex === -1 ? new Date().toLocaleString('id-ID') : dataPembelajaran[editIndex].tanggal,
|
| 214 |
+
jenis,
|
| 215 |
+
indikator,
|
| 216 |
+
hasil,
|
| 217 |
+
kesimpulan
|
| 218 |
+
};
|
| 219 |
+
|
| 220 |
+
if (editIndex === -1) {
|
| 221 |
+
dataPembelajaran.push(entry);
|
| 222 |
+
alert('Data pembelajaran berhasil disimpan!');
|
| 223 |
+
} else {
|
| 224 |
+
dataPembelajaran[editIndex] = entry;
|
| 225 |
+
alert('Data pembelajaran berhasil diperbarui!');
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
localStorage.setItem('pembelajaran', JSON.stringify(dataPembelajaran));
|
| 229 |
+
updateDropdowns();
|
| 230 |
+
resetForm();
|
| 231 |
+
if (document.getElementById('Daftar').classList.contains('active')) tampilkanData();
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
function resetForm() {
|
| 235 |
+
editIndex = -1;
|
| 236 |
+
document.getElementById('editModeInfo').style.display = 'none';
|
| 237 |
+
document.getElementById('jenisSelect').value = jenisList[0] || '';
|
| 238 |
+
document.getElementById('manualJenisInput').style.display = 'none';
|
| 239 |
+
document.getElementById('jenisManual').value = '';
|
| 240 |
+
document.getElementById('indicatorSelect').value = indicatorList[0] || '';
|
| 241 |
+
document.getElementById('manualIndicatorInput').style.display = 'none';
|
| 242 |
+
document.getElementById('indicatorManual').value = '';
|
| 243 |
+
document.getElementById('hasil').value = '';
|
| 244 |
+
document.getElementById('kesimpulan').value = '';
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
function batalEdit() {
|
| 248 |
+
resetForm();
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
function editEntri(index) {
|
| 252 |
+
const entry = dataPembelajaran[index];
|
| 253 |
+
editIndex = index;
|
| 254 |
+
|
| 255 |
+
// Pindah ke tab Input
|
| 256 |
+
openTab(null, 'Input');
|
| 257 |
+
|
| 258 |
+
document.getElementById('editModeInfo').style.display = 'block';
|
| 259 |
+
document.getElementById('editIndex').textContent = index + 1;
|
| 260 |
+
|
| 261 |
+
// Set nilai form
|
| 262 |
+
let jenisSelect = document.getElementById('jenisSelect');
|
| 263 |
+
if (jenisList.includes(entry.jenis)) {
|
| 264 |
+
jenisSelect.value = entry.jenis;
|
| 265 |
+
document.getElementById('manualJenisInput').style.display = 'none';
|
| 266 |
+
} else {
|
| 267 |
+
jenisSelect.value = 'new';
|
| 268 |
+
document.getElementById('manualJenisInput').style.display = 'block';
|
| 269 |
+
document.getElementById('jenisManual').value = entry.jenis;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
let indicatorSelect = document.getElementById('indicatorSelect');
|
| 273 |
+
if (indicatorList.includes(entry.indikator)) {
|
| 274 |
+
indicatorSelect.value = entry.indikator;
|
| 275 |
+
document.getElementById('manualIndicatorInput').style.display = 'none';
|
| 276 |
+
} else {
|
| 277 |
+
indicatorSelect.value = 'new';
|
| 278 |
+
document.getElementById('manualIndicatorInput').style.display = 'block';
|
| 279 |
+
document.getElementById('indicatorManual').value = entry.indikator;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
document.getElementById('hasil').value = entry.hasil;
|
| 283 |
+
document.getElementById('kesimpulan').value = entry.kesimpulan;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
function hapusEntri(index) {
|
| 287 |
+
if (confirm('Yakin ingin menghapus entri ini?')) {
|
| 288 |
+
dataPembelajaran.splice(index, 1);
|
| 289 |
+
localStorage.setItem('pembelajaran', JSON.stringify(dataPembelajaran));
|
| 290 |
+
tampilkanData();
|
| 291 |
+
alert('Data berhasil dihapus!');
|
| 292 |
+
}
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
function tampilkanData(filterJenis = '', filterKata = '') {
|
| 296 |
+
const tbody = document.querySelector('#tabelPembelajaran tbody');
|
| 297 |
+
tbody.innerHTML = '';
|
| 298 |
+
|
| 299 |
+
let filtered = dataPembelajaran;
|
| 300 |
+
if (filterJenis) filtered = filtered.filter(d => d.jenis === filterJenis);
|
| 301 |
+
if (filterKata) {
|
| 302 |
+
const kata = filterKata.toLowerCase();
|
| 303 |
+
filtered = filtered.filter(d =>
|
| 304 |
+
d.hasil.toLowerCase().includes(kata) || d.kesimpulan.toLowerCase().includes(kata)
|
| 305 |
+
);
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
filtered.forEach((d, i) => {
|
| 309 |
+
const actualIndex = dataPembelajaran.indexOf(d);
|
| 310 |
+
const row = tbody.insertRow();
|
| 311 |
+
row.insertCell(0).textContent = i + 1;
|
| 312 |
+
row.insertCell(1).textContent = d.tanggal;
|
| 313 |
+
row.insertCell(2).textContent = d.jenis;
|
| 314 |
+
row.insertCell(3).textContent = d.indikator;
|
| 315 |
+
row.insertCell(4).innerHTML = '<div class="text-wrap">' + d.hasil.replace(/\n/g, '<br>') + '</div>';
|
| 316 |
+
row.insertCell(5).innerHTML = '<div class="text-wrap">' + d.kesimpulan.replace(/\n/g, '<br>') + '</div>';
|
| 317 |
+
|
| 318 |
+
const cellAksi = row.insertCell(6);
|
| 319 |
+
cellAksi.innerHTML = `
|
| 320 |
+
<button class="secondary small" onclick="editEntri(${actualIndex})">Edit</button>
|
| 321 |
+
<button class="danger small" onclick="hapusEntri(${actualIndex})">Hapus</button>
|
| 322 |
+
`;
|
| 323 |
+
});
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
function terapkanFilter() {
|
| 327 |
+
const filterJenis = document.getElementById('filterJenis').value;
|
| 328 |
+
const filterKata = document.getElementById('filterKata').value;
|
| 329 |
+
tampilkanData(filterJenis, filterKata);
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
function resetFilter() {
|
| 333 |
+
document.getElementById('filterJenis').value = '';
|
| 334 |
+
document.getElementById('filterKata').value = '';
|
| 335 |
+
tampilkanData();
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
// Import dan Export tetap sama (dipertahankan dari versi sebelumnya)
|
| 339 |
+
function importExcel() {
|
| 340 |
+
const fileInput = document.getElementById('importFile');
|
| 341 |
+
const file = fileInput.files[0];
|
| 342 |
+
if (!file) return alert('Pilih file Excel terlebih dahulu!');
|
| 343 |
+
|
| 344 |
+
const reader = new FileReader();
|
| 345 |
+
reader.onload = function(e) {
|
| 346 |
+
try {
|
| 347 |
+
const data = new Uint8Array(e.target.result);
|
| 348 |
+
const workbook = XLSX.read(data, { type: 'array' });
|
| 349 |
+
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
| 350 |
+
const rows = XLSX.utils.sheet_to_json(sheet);
|
| 351 |
+
|
| 352 |
+
let imported = 0;
|
| 353 |
+
rows.forEach(row => {
|
| 354 |
+
const entry = {
|
| 355 |
+
tanggal: row['Tanggal'] || row['tanggal'] || new Date().toLocaleString('id-ID'),
|
| 356 |
+
jenis: row['Jenis'] || row['jenis'] || '',
|
| 357 |
+
indikator: row['Indicator (Sub Bab)'] || row['Indikator'] || row['indicator'] || row['sub bab'] || '',
|
| 358 |
+
hasil: row['Hasil Pembelajaran'] || row['Hasil'] || row['hasil'] || '',
|
| 359 |
+
kesimpulan: row['Kesimpulan'] || row['kesimpulan'] || ''
|
| 360 |
+
};
|
| 361 |
+
|
| 362 |
+
if (entry.jenis && entry.indikator && entry.hasil && entry.kesimpulan) {
|
| 363 |
+
dataPembelajaran.push(entry);
|
| 364 |
+
if (!jenisList.includes(entry.jenis)) jenisList.push(entry.jenis);
|
| 365 |
+
if (!indicatorList.includes(entry.indikator)) indicatorList.push(entry.indikator);
|
| 366 |
+
imported++;
|
| 367 |
+
}
|
| 368 |
+
});
|
| 369 |
+
|
| 370 |
+
jenisList = [...new Set(jenisList)].sort();
|
| 371 |
+
indicatorList = [...new Set(indicatorList)].sort();
|
| 372 |
+
localStorage.setItem('pembelajaran', JSON.stringify(dataPembelajaran));
|
| 373 |
+
updateDropdowns();
|
| 374 |
+
tampilkanData();
|
| 375 |
+
alert(`Berhasil mengimport ${imported} data pembelajaran!`);
|
| 376 |
+
fileInput.value = '';
|
| 377 |
+
} catch (err) {
|
| 378 |
+
alert('Gagal membaca file: ' + err.message);
|
| 379 |
+
}
|
| 380 |
+
};
|
| 381 |
+
reader.readAsArrayBuffer(file);
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
function exportExcel() {
|
| 385 |
+
if (dataPembelajaran.length === 0) return alert('Tidak ada data untuk diekspor!');
|
| 386 |
+
const ws = XLSX.utils.json_to_sheet(dataPembelajaran);
|
| 387 |
+
const wb = XLSX.utils.book_new();
|
| 388 |
+
XLSX.utils.book_append_sheet(wb, ws, "Pembelajaran");
|
| 389 |
+
XLSX.writeFile(wb, "Catatan_Pembelajaran_" + new Date().toISOString().slice(0,10) + ".xlsx");
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
function exportPDF() {
|
| 393 |
+
if (dataPembelajaran.length === 0) return alert('Tidak ada data untuk diekspor!');
|
| 394 |
+
|
| 395 |
+
const doc = new jsPDF('l', 'mm', 'a4');
|
| 396 |
+
doc.setFontSize(18);
|
| 397 |
+
doc.text("Laporan Catatan Pembelajaran", 14, 20);
|
| 398 |
+
doc.setFontSize(11);
|
| 399 |
+
doc.text("Dicetak pada: " + new Date().toLocaleString('id-ID'), 14, 30);
|
| 400 |
+
|
| 401 |
+
const tableData = dataPembelajaran.map((d, i) => [
|
| 402 |
+
i + 1,
|
| 403 |
+
d.tanggal,
|
| 404 |
+
d.jenis,
|
| 405 |
+
d.indikator,
|
| 406 |
+
d.hasil.length > 80 ? d.hasil.substring(0,80) + '...' : d.hasil,
|
| 407 |
+
d.kesimpulan.length > 80 ? d.kesimpulan.substring(0,80) + '...' : d.kesimpulan
|
| 408 |
+
]);
|
| 409 |
+
|
| 410 |
+
doc.autoTable({
|
| 411 |
+
head: [['No', 'Tanggal', 'Jenis', 'Indicator', 'Hasil Pembelajaran', 'Kesimpulan']],
|
| 412 |
+
body: tableData,
|
| 413 |
+
startY: 40,
|
| 414 |
+
styles: { fontSize: 10, cellPadding: 3 },
|
| 415 |
+
headStyles: { fillColor: [0, 123, 255] },
|
| 416 |
+
alternateRowStyles: { fillColor: [245, 248, 255] },
|
| 417 |
+
columnStyles: {
|
| 418 |
+
0: { cellWidth: 15 },
|
| 419 |
+
1: { cellWidth: 35 },
|
| 420 |
+
2: { cellWidth: 35 },
|
| 421 |
+
3: { cellWidth: 40 },
|
| 422 |
+
4: { cellWidth: 70 },
|
| 423 |
+
5: { cellWidth: 70 }
|
| 424 |
+
}
|
| 425 |
+
});
|
| 426 |
+
|
| 427 |
+
doc.save("Catatan_Pembelajaran_" + new Date().toISOString().slice(0,10) + ".pdf");
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
function openTab(evt, tabName) {
|
| 431 |
+
document.querySelectorAll(".tabcontent").forEach(el => el.classList.remove("active"));
|
| 432 |
+
document.querySelectorAll(".tablink").forEach(el => el.classList.remove("active"));
|
| 433 |
+
document.getElementById(tabName).classList.add("active");
|
| 434 |
+
if (evt) evt.currentTarget.classList.add("active");
|
| 435 |
+
|
| 436 |
+
if (tabName === 'Daftar') {
|
| 437 |
+
updateDropdowns();
|
| 438 |
+
tampilkanData();
|
| 439 |
+
}
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
// Inisialisasi
|
| 443 |
+
updateDropdowns();
|
| 444 |
+
tampilkanData(); // jika langsung buka tab daftar
|
| 445 |
+
</script>
|
| 446 |
+
<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>
|
| 447 |
+
</html>
|
prompts.txt
ADDED
|
File without changes
|