- Copia integral de ampmInsights_V1/ (docs/ + sql/), que o usuário confirma ser exatamente o que foi usado para construir e implementar ampmInsights_V1_Cliente no cliente. - Traz docs/10-carga-cmdb-vulnerabilidades.html de V1_Cliente (existia lá, faltava em V1 — gap de conteúdo, não só de tom). - Rebrand mecânico 'Documentação V1' -> 'Documentação V2' nas 10 páginas de docs + link de navegação para o capítulo 10 adicionado onde faltava. - ampmInsights_V1/ e ampmInsights_V1_Cliente/ ficam congelados a partir de agora (réplica validada, já implementada no cliente) — todo o trabalho de v2.0.0 (schema aditivo: ALTER/MERGE, sem DROP) acontece nesta pasta. - Adiciona TASKS.md e CHANGELOG.md próprios desta geração. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
document.addEventListener('DOMContentLoaded', function () {
|
|
var btn = document.querySelector('.menu-toggle');
|
|
var sidebar = document.querySelector('.sidebar');
|
|
if (btn && sidebar) {
|
|
btn.addEventListener('click', function () {
|
|
sidebar.classList.toggle('open');
|
|
});
|
|
}
|
|
|
|
document.querySelectorAll('.copy-btn').forEach(function (button) {
|
|
button.addEventListener('click', function () {
|
|
var block = button.closest('.code-block');
|
|
var code = block ? block.querySelector('pre code, pre') : null;
|
|
if (!code) return;
|
|
var text = code.textContent;
|
|
|
|
function showCopied() {
|
|
var original = button.textContent;
|
|
button.textContent = 'Copiado!';
|
|
button.classList.add('copied');
|
|
setTimeout(function () {
|
|
button.textContent = original;
|
|
button.classList.remove('copied');
|
|
}, 1800);
|
|
}
|
|
|
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
navigator.clipboard.writeText(text).then(showCopied, function () {
|
|
fallbackCopy(text, showCopied);
|
|
});
|
|
} else {
|
|
fallbackCopy(text, showCopied);
|
|
}
|
|
});
|
|
});
|
|
|
|
function fallbackCopy(text, done) {
|
|
var ta = document.createElement('textarea');
|
|
ta.value = text;
|
|
ta.style.position = 'fixed';
|
|
ta.style.opacity = '0';
|
|
document.body.appendChild(ta);
|
|
ta.focus();
|
|
ta.select();
|
|
try { document.execCommand('copy'); } catch (e) { /* no-op */ }
|
|
document.body.removeChild(ta);
|
|
done();
|
|
}
|
|
});
|