feat & fix : intégration IA éditeur + onglet admin IA + corrections CSP (v1.6.24-25)
- #96 : boutons IA sidebar éditeur (analyse critique / réécriture) via Anthropic API - #97 : onglet admin /admin/ia — provider anthropic/claude_code, modèle, procédure CLI - #95 : extraction scripts inline vers fichiers JS (comments.js, post_confirm.js, admin.js) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var maxAge = 365 * 24 * 3600;
|
||||
function getCookie(name) {
|
||||
var m = document.cookie.match('(?:^|; )' + name + '=([^;]*)');
|
||||
return m ? decodeURIComponent(m[1]) : '';
|
||||
}
|
||||
function setCookie(name, value) {
|
||||
document.cookie = name + '=' + encodeURIComponent(value) + ';max-age=' + maxAge + ';path=/;SameSite=Lax';
|
||||
}
|
||||
var nameEl = document.getElementById('comment-name');
|
||||
var emailEl = document.getElementById('comment-email');
|
||||
if (!nameEl || !emailEl) { return; }
|
||||
var savedName = getCookie('cmt_name');
|
||||
var savedEmail = getCookie('cmt_email');
|
||||
if (savedName) { nameEl.value = savedName; }
|
||||
if (savedEmail) { emailEl.value = savedEmail; }
|
||||
var form = document.getElementById('comment-form');
|
||||
if (form) {
|
||||
form.addEventListener('submit', function () {
|
||||
if (nameEl.value.trim()) { setCookie('cmt_name', nameEl.value.trim()); }
|
||||
if (emailEl.value.trim()) { setCookie('cmt_email', emailEl.value.trim()); }
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user