Skip to content
Extraits de code Groupes Projets
Valider 741e8a47 rédigé par ARNO*'s avatar ARNO*
Parcourir les fichiers

Comportement plus intelligent raccourcis (Mozilla)

parent 658bbd8a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -120,10 +120,20 @@ function mozWrap(txtarea, open, close) ...@@ -120,10 +120,20 @@ function mozWrap(txtarea, open, close)
var selEnd = txtarea.selectionEnd; var selEnd = txtarea.selectionEnd;
if (selEnd == 1 || selEnd == 2) if (selEnd == 1 || selEnd == 2)
selEnd = selLength; selEnd = selLength;
// Raccourcir la selection par double-clic si dernier caractere est espace
if ((txtarea.value).substring(selEnd-1,selEnd) == ' ') selEnd = selEnd-1;
var s1 = (txtarea.value).substring(0,selStart); var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd) var s2 = (txtarea.value).substring(selStart, selEnd)
var s3 = (txtarea.value).substring(selEnd, selLength); var s3 = (txtarea.value).substring(selEnd, selLength);
// Eviter melange bold-italic
if ((txtarea.value).substring(selEnd,selEnd+1) == '}' && close.substring(0,1) == "}") close = close + " ";
if ((txtarea.value).substring(selStart-1,selStart) == '{' && open.substring(0,1) == "{") open = " " + open;
txtarea.value = s1 + open + s2 + close + s3; txtarea.value = s1 + open + s2 + close + s3;
return; return;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter