From fd44f77dc16fd9abd65e0eaf7cb60a89e56355fe Mon Sep 17 00:00:00 2001 From: Jules Dubois Date: Thu, 25 Jun 2026 18:58:48 +0200 Subject: [PATCH] fix: remplacer app.alert nType:3 par app.response pour Livret Les alertes multiples sont bloquees dans Acrobat 2026 depuis un cExec menu. app.response avec saisie I/D fonctionne comme premiere et unique interaction modale. Co-Authored-By: Claude Opus 4.6 --- acrobat-plugin/src/Imposition-02-Livret.js | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/acrobat-plugin/src/Imposition-02-Livret.js b/acrobat-plugin/src/Imposition-02-Livret.js index 1c2ab6b..a130965 100755 --- a/acrobat-plugin/src/Imposition-02-Livret.js +++ b/acrobat-plugin/src/Imposition-02-Livret.js @@ -240,29 +240,27 @@ CDImp.Livret.delivretiser = function (doc) { // Point d'entree du module (appele depuis le panneau principal, Module 1) // ----------------------------------------------------------------------- CDImp.Livret.lancer = function (doc) { - app.alert("DEBUG 1: entree dans lancer"); try { doc = CDImp.Util.getDocActif(doc); } catch (e) { - app.alert("DEBUG: pas de doc - " + e); + app.alert("Veuillez ouvrir un document PDF."); return; } - app.alert("DEBUG 2: doc ok, numPages=" + doc.numPages); - var choix = app.alert({ - cMsg: "Que souhaitez-vous faire ?\n\nOui = Creer un livret (imposition)\nNon = Delivretiser (revenir a l'ordre de lecture)", + var choix = app.response({ + cQuestion: "Tapez I pour Imposer (creer un livret)\nou D pour Delivretiser (revenir a l'ordre de lecture) :", cTitle: "Livret / Delivretiser", - nIcon: 2, - nType: 3 + cDefault: "I" }); - app.alert("DEBUG 3: choix=" + choix); - // 4=Oui, 3=Non, 2=Annuler - if (choix === 2) { + if (!choix) return; + choix = choix.toUpperCase(); + + if (choix === "D") { + CDImp.Livret.delivretiser(doc); return; } - - if (choix === 3) { - CDImp.Livret.delivretiser(doc); + if (choix !== "I") { + app.alert("Choix non reconnu. Tapez I ou D."); return; }