Fix gitea env + proposer modal + favicon/nginx — 2026-01-31
This commit is contained in:
@@ -160,15 +160,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
// ✅ Ouvre EN NOUVEL ONGLET sans jamais remplacer l’onglet courant
|
||||
// ✅ Ouvre EN NOUVEL ONGLET : stratégie unique (anchor click) => jamais 2 onglets
|
||||
const openInNewTab = (url) => {
|
||||
// 1) tente window.open
|
||||
try {
|
||||
const w = window.open(url, "_blank", "noopener,noreferrer");
|
||||
if (w) return true;
|
||||
} catch {}
|
||||
|
||||
// 2) fallback "anchor click" (souvent mieux toléré)
|
||||
try {
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
@@ -181,7 +174,7 @@
|
||||
return true;
|
||||
} catch {}
|
||||
|
||||
// 3) dernier recours: on ne quitte PAS la page
|
||||
// dernier recours
|
||||
window.prompt("Popup bloquée. Copiez ce lien pour ouvrir le ticket :", url);
|
||||
return false;
|
||||
};
|
||||
@@ -200,7 +193,7 @@
|
||||
if (!a) return;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
const rawUrl = a.dataset.url || a.getAttribute("href") || "";
|
||||
if (!rawUrl || rawUrl === "#") return;
|
||||
@@ -210,10 +203,8 @@
|
||||
try {
|
||||
const u = new URL(rawUrl);
|
||||
|
||||
// Option B.1 : copie presse-papier du texte complet (si dispo)
|
||||
if (full) {
|
||||
try { await navigator.clipboard.writeText(full); } catch {}
|
||||
// Option B.2 : upgrade du body (si l'URL reste raisonnable)
|
||||
tryUpgradeBodyWithFull(u, full);
|
||||
}
|
||||
|
||||
@@ -221,7 +212,7 @@
|
||||
} catch {
|
||||
openInNewTab(rawUrl);
|
||||
}
|
||||
});
|
||||
}, { capture: true });
|
||||
|
||||
// Step 1: type
|
||||
dlg.addEventListener("click", (e) => {
|
||||
|
||||
@@ -497,27 +497,17 @@ const GITEA_REPO = import.meta.env.PUBLIC_GITEA_REPO ?? "";
|
||||
const excerpt = raw.length > 420 ? (raw.slice(0, 420) + "…") : raw;
|
||||
|
||||
const issueUrl = buildIssueURL(p.id, raw, excerpt);
|
||||
|
||||
// Lien fallback (si JS casse totalement)
|
||||
propose.href = issueUrl;
|
||||
|
||||
// 🔥 indispensables pour réactiver ProposeModal (les 2 filtres)
|
||||
// ✅ Marqueurs pour ProposeModal (interception 2 étapes)
|
||||
propose.dataset.propose = "1";
|
||||
propose.dataset.url = issueUrl;
|
||||
|
||||
// optionnel mais top : permet à ProposeModal de copier le texte complet
|
||||
propose.dataset.full = raw;
|
||||
|
||||
// ✅ CRUCIAL : permet à ProposeModal d’intercepter le clic (2 étapes)
|
||||
propose.setAttribute("data-propose", "1");
|
||||
propose.setAttribute("data-url", issueUrl);
|
||||
|
||||
// ✅ Bonus : ProposeModal peut copier/upgrade avec le texte complet si dispo
|
||||
// (tu peux commenter si tu veux éviter de stocker le texte en attribut)
|
||||
propose.setAttribute("data-full", raw);
|
||||
|
||||
// ✅ Fallback si JS casse : on ouvre quand même le lien (idéalement en nouvel onglet)
|
||||
propose.href = issueUrl;
|
||||
propose.target = "_blank";
|
||||
propose.rel = "noopener noreferrer";
|
||||
// ❌ PAS de target=_blank ici
|
||||
// ❌ PAS de rel noopener ici
|
||||
|
||||
row.appendChild(propose);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user