From 3609bcda2a90cffbd227f8655be052c35493bfb9 Mon Sep 17 00:00:00 2001 From: "rastapopoulos@spip.org" <> Date: Sun, 27 Mar 2016 15:57:26 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20du=20bug=20de=20fullscreen,=20qui?= =?UTF-8?q?=20fermait=20le=20fullscreen=20en=20m=C3=AAme=20temps=20de=20fe?= =?UTF-8?q?rmer=20la=20fen=C3=AAtre=20de=20lien,=20si=20on=20utilisait=20l?= =?UTF-8?q?a=20touche=20=C3=89chap.=20On=20utilise=20une=20variable=20glob?= =?UTF-8?q?ale,=20dans=20laquelle=20on=20indique=20qu'un=20prompt=20est=20?= =?UTF-8?q?ouvert.=20Quand=20ce=20dernier=20se=20ferme,=20on=20re-pr=C3=A9?= =?UTF-8?q?vient=20qu'il=20est=20ferm=C3=A9.=20Et=20on=20ne=20ferme=20alor?= =?UTF-8?q?s=20le=20fullscreen=20qui=20si=20un=20prompt=20n'est=20PAS=20ou?= =?UTF-8?q?vert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/jquery.markitup_pour_spip.js | 12 +++++++++++- javascript/jquery.previsu_spip.js | 2 +- paquet.xml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/javascript/jquery.markitup_pour_spip.js b/javascript/jquery.markitup_pour_spip.js index c3424e2..4c42814 100644 --- a/javascript/jquery.markitup_pour_spip.js +++ b/javascript/jquery.markitup_pour_spip.js @@ -54,7 +54,8 @@ ;(function($) { $.fn.markItUp = function(settings, extraSettings) { var method, params, options, ctrlKey, shiftKey, altKey; ctrlKey = shiftKey = altKey = false; - + markitup_prompt = false; // variable volontairement globale + if (typeof settings == 'string') { method = settings; params = extraSettings; @@ -304,10 +305,19 @@ if (abort === true) { return false; } + + // On prévient qu'un prompt s'ouvre + markitup_prompt = true; + value = prompt(b[0], (b[1]) ? b[1] : ''); if (value === null) { abort = true; } + + // On attend un peu avant de dire que le prompt est fermé + // pour ne pas que ça soit pris en compte en même temps que la fermeture du prompt + setTimeout(function(){markitup_prompt = false;}, 500); + return value; } ); diff --git a/javascript/jquery.previsu_spip.js b/javascript/jquery.previsu_spip.js index 3e47845..c35b13f 100644 --- a/javascript/jquery.previsu_spip.js +++ b/javascript/jquery.previsu_spip.js @@ -70,7 +70,7 @@ $(window).bind('keyup',function(e){ if (is_full_screen) { // Touche Echap pour sortir du mode fullscreen - if (e.type=='keyup' && e.keyCode==27){ + if (e.type=='keyup' && e.keyCode==27 && !markitup_prompt){ mark.removeClass('fullscreen'); is_full_screen = false; } diff --git a/paquet.xml b/paquet.xml index f0676f8..12beefe 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@