first commit

This commit is contained in:
Patrick
2026-05-01 20:02:13 +02:00
commit 75fb753fc0
77 changed files with 4793 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// ═══════════════════════════════════════════════════════
// Diff Checker
// ═══════════════════════════════════════════════════════
function computeDiff() {
const a = document.getElementById('diffA').value.split('\n');
const b = document.getElementById('diffB').value.split('\n');
const max = Math.max(a.length, b.length);
let html = '';
for (let i = 0; i < max; i++) {
const la = a[i] !== undefined ? a[i] : null;
const lb = b[i] !== undefined ? b[i] : null;
const esc = s => s.replace(/[<>&]/g, c => ({'<':'&lt;','>':'&gt;','&':'&amp;'}[c]));
if (la === null) html += `<div class="diff-line diff-add">+ ${esc(lb)}</div>`;
else if (lb === null) html += `<div class="diff-line diff-del">- ${esc(la)}</div>`;
else if (la === lb) html += `<div class="diff-line diff-same"> ${esc(la)}</div>`;
else {
html += `<div class="diff-line diff-del">- ${esc(la)}</div>`;
html += `<div class="diff-line diff-add">+ ${esc(lb)}</div>`;
}
}
document.getElementById('diffOutput').innerHTML = html || '<span style="color:var(--text-muted);">Texts are identical.</span>';
}