From bd8d0c8e04bc87efc7774d3be9622cf1fd1c8309 Mon Sep 17 00:00:00 2001 From: "marcimat@rezo.net" <> Date: Thu, 8 Sep 2011 22:52:13 +0000 Subject: [PATCH] =?UTF-8?q?Coquilles=20encore=20dans=20la=20gestion=20mult?= =?UTF-8?q?iligne.=20On=20remet=20forceMultiligne=20en=20options=20des=20l?= =?UTF-8?q?istes=20pour=20que=20les=20fonctions=20de=20remplacement=20soie?= =?UTF-8?q?nt=20appel=C3=A9es=20sur=20chaque=20ligne=20et=20non=20pour=20t?= =?UTF-8?q?oute=20la=20s=C3=A9lection.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- barre_outils/edition.php | 8 ++++---- javascript/jquery.markitup_pour_spip.js | 6 ++++-- paquet.xml | 2 +- porte_plume_fonctions.php | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/barre_outils/edition.php b/barre_outils/edition.php index 2ca7f30..7e29714 100644 --- a/barre_outils/edition.php +++ b/barre_outils/edition.php @@ -77,7 +77,7 @@ function barre_outils_edition(){ "replaceWith" => "function(h){ return outil_liste(h, '*');}", "display" => true, "selectionType" => "line", - "multiline" => true, + "forceMultiline" => true, "dropMenu" => array( // liste -# array( @@ -87,7 +87,7 @@ function barre_outils_edition(){ "replaceWith" => "function(h){ return outil_liste(h, '#');}", "display" => true, "selectionType" => "line", - "multiline" => true, + "forceMultiline" => true, ), // desindenter array( @@ -97,7 +97,7 @@ function barre_outils_edition(){ "replaceWith" => "function(h){return outil_desindenter(h);}", "display" => true, "selectionType" => "line", - "multiline" => true, + "forceMultiline" => true, ), // indenter array( @@ -107,7 +107,7 @@ function barre_outils_edition(){ "replaceWith" => "function(h){return outil_indenter(h);}", "display" => true, "selectionType" => "line", - "multiline" => true, + "forceMultiline" => true, ), ), ), diff --git a/javascript/jquery.markitup_pour_spip.js b/javascript/jquery.markitup_pour_spip.js index b54eba7..ca524d6 100644 --- a/javascript/jquery.markitup_pour_spip.js +++ b/javascript/jquery.markitup_pour_spip.js @@ -284,7 +284,7 @@ block = openWith + replaceWith + closeWith; } else if (selection === '' && placeHolder !== '') { block = openWith + placeHolder + closeWith; - } else { + } else if (multiline === true) { string = string || selection; var lines = selection.split(/\r?\n/), blocks = []; @@ -300,6 +300,8 @@ } block = blocks.join("\n"); + } else { + block = openWith + (string || selection) + closeWith; } block = openBlockWith + block + closeBlockWith; @@ -462,7 +464,7 @@ } $.extend(hash, { line:1 }); - if ((ctrlKey === true && shiftKey === true) || button.multiline === true) { + if ((ctrlKey === true && shiftKey === true) || button.forceMultiline === true) { lines = selection.split(/\r?\n/); for (j = 0, n = lines.length, i = 0; i < n; i++) { // si une seule ligne, on se fiche de savoir qu'elle est vide, diff --git a/paquet.xml b/paquet.xml index 8f332ef..c6dd4e5 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@