Changeset 9974 in spip-zone
- Timestamp:
- Feb 28, 2007, 6:34:41 PM (14 years ago)
- Location:
- _plugins_/_stable_/barre_typo_enrichie/1_9_1
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_stable_/barre_typo_enrichie/1_9_1/inc/barre.php
r9946 r9974 50 50 } 51 51 52 // sert aconstruire les sousbarre52 // sert à construire les sousbarre 53 53 function produceWharf($id, $title = '', $sb = '') { 54 54 $visible = ($changer_virtuel || $virtuel); … … 178 178 } 179 179 180 // pour les caract eres180 // pour les caractères 181 181 function afficher_caracteres($champ, $spip_lang, $champhelp) { 182 182 … … 228 228 } 229 229 230 // pour les caract eres230 // pour les caractères 231 231 function afficher_boutonsavances($champ, $champhelp) { 232 232 … … 238 238 $reta .= bouton_barre_racc ("barre_raccourci('[(',')]',$champ)", _DIR_PLUGIN_BARRETYPOENRICHIE.'/img_pack/icones_barre/cadretexte.png', _T('bartypenr:barre_encadrer'), $champhelp); 239 239 $reta .= bouton_barre_racc ("barre_raccourci('<poesie>','</poesie>',$champ)", _DIR_PLUGIN_BARRETYPOENRICHIE."/img_pack/icones_barre/poesie.png", _T('bartypenr:barre_poesie'), $champhelp); 240 ////////////////////////////241 //MODIFICATION242 ///////////////////////////243 global $spip_lang;244 $params = array($champ,$champhelp,$spip_lang);245 $add = pipeline("BarreTypoEnrichie_boutonsavances",array($champ,$champhelp,$spip_lang));246 if ($params!=$add)247 $reta .= $add;248 ///////////////////////////249 240 250 241 $reta .= ' '; … … 280 271 281 272 282 // Pr egeneration des toolzbox.. (wharfing)273 // Prégénération des toolzbox.. (wharfing) 283 274 $toolbox .= afficher_boutonsavances($champ, $champhelp); 284 275 $toolbox .= afficher_caracteres($champ, $spip_lang, $champhelp); … … 287 278 $toolbox .= afficher_gestion_ancre($champ); 288 279 $toolbox .= afficher_gestion_remplacer($champ, $champhelp); 289 ////////////////////////////290 //MODIFICATION291 ///////////////////////////292 //un pipeline pour ajouter une toolbox293 $params=array($champ,$champhelp,$spip_lang);294 $add=pipeline("BarreTypoEnrichie_toolbox",$params);295 if ($params!=$add)296 $toolbox .= $add;297 ///////////////////////////298 280 // 299 281 … … 306 288 $ret .= bouton_barre_racc ("barre_raccourci('{','}',$champ)", _DIR_IMG_ICONES_BARRE."italique.png", _T('barre_italic'), $champhelp); 307 289 $ret .= bouton_barre_racc ("barre_raccourci('{{','}}',$champ)", _DIR_IMG_ICONES_BARRE."gras.png", _T('barre_gras'), $champhelp); 308 ////////////////////////////309 //MODIFICATION310 ///////////////////////////311 $params = array($champ,$champhelp,$spip_lang);312 $add = pipeline("BarreTypoEnrichie_tous",array($champ,$champhelp,$spip_lang));313 if ($params!=$add)314 $ret .= $add;315 ///////////////////////////316 317 290 if ($options == "avancees") { 318 291 $ret .= bouton_barre_racc ("barre_raccourci('[*','*]',$champ)", _DIR_PLUGIN_BARRETYPOENRICHIE.'/img_pack/icones_barre/miseenevidence.png', _T('bartypenr:barre_miseenevidence'), $champhelp); 319 292 $ret .= bouton_barre_racc ("barre_raccourci('<sup>','</sup>',$champ)", _DIR_PLUGIN_BARRETYPOENRICHIE.'/img_pack/icones_barre/exposant.png', _T('bartypenr:barre_exposant'), $champhelp); 320 293 $ret .= bouton_barre_racc ("barre_raccourci('<sc>','</sc>',$champ)", _DIR_PLUGIN_BARRETYPOENRICHIE.'/img_pack/icones_barre/petitescapitales.png', _T('bartypenr:barre_petitescapitales'), $champhelp); 321 ////////////////////////////322 //MODIFICATION323 ///////////////////////////324 $params = array($champ,$champhelp,$spip_lang);325 $add = pipeline("BarreTypoEnrichie_avancees",array($champ,$champhelp,$spip_lang));326 if ($params!=$add)327 $ret .= $add;328 ///////////////////////////329 294 } 330 295 if (!$forum) { 331 ////////////////////////////332 //MODIFICATION333 ///////////////////////////334 $params = array($champ,$champhelp,$spip_lang);335 $add = pipeline("BarreTypoEnrichie_ecrire",array($champ,$champhelp,$spip_lang));336 if ($params!=$add)337 $ret .= $add;338 ///////////////////////////339 296 $ret .= " "; 340 297 $ret .= bouton_barre_racc ("barre_raccourci('\n\n{{{','}}}\n\n',$champ)", _DIR_IMG_ICONES_BARRE."intertitre.png", _T('barre_intertitre'), $champhelp); … … 357 314 } 358 315 if ($forum) { 359 ////////////////////////////360 //MODIFICATION361 ///////////////////////////362 $params = array($champ,$champhelp,$spip_lang);363 $add = pipeline("BarreTypoEnrichie_forum",array($champ,$champhelp,$spip_lang));364 if ($params!=$add)365 $ret .= $add;366 ///////////////////////////367 316 $ret .= " </td>\n<td style='text-align: $spip_lang_left;' valign='middle'>"; 368 317 $col ++; -
_plugins_/_stable_/barre_typo_enrichie/1_9_1/plugin.xml
r9946 r9974 5 5 <auteur><!-- Auteur du plugin --> 6 6 [Jacques->http://www.spip-contrib.net/_Jacques-PYRAT_] à partir des raccourcis mis en place par [François->http://www.spip-contrib.net/_Francois-Schreuer_] 7 _ Bill (Stephane LAURENT - spipcarto@gmail.com) : pipelines pour l'extensibilité8 7 _ Prévisualisation : [->http://www.spip-contrib.net/Previsualisation-dynamique-d] 9 8 _ Editeur de tableaux : [Christian Quentin->http://www.spip-contrib.net/_quentic_] à partir du travail de [Courcy->http://www.spip-contrib.net/_courcy_] dans l'[article->http://www.spip-contrib.net/Editeur-de-tableau-pour-la-1-7] pour l'éditeur de tableau … … 13 12 -* pour intégrer les éléments HTML titre et résumé de tableau 14 13 15 © 2006 - Distribué sous licence GNU/GPL14 _ © 2006 - Distribué sous licence GNU/GPL 16 15 </auteur> 17 16 <lien>[Exemple d'utilisation->http://www.pyrat.net/Raccourcis-Typographiques-de-SPIP.html]</lien> 18 17 <version> 19 1. 518 1.42 20 19 </version> 21 20 <etat> -
_plugins_/_stable_/barre_typo_enrichie/1_9_1/typo_enrichie.php
r9946 r9974 2 2 3 3 /* 4 * Ce plugin rajoute des raccourcis typographique et am eliore les possibilites de la barre typographique pour les redacteurs4 * Ce plugin rajoute des raccourcis typographique et améliore les possibilités de la barre typographique pour les rédacteurs 5 5 */ 6 6 7 7 /* 8 8 * Fonctions de ces filtres : 9 * Ils rajoutent quelques racourcis typo aSPIP9 * Ils rajoutent quelques racourcis typo à SPIP 10 10 * 11 11 * Syntaxe des raccourcis : 12 * [/texte/] : aligner le texte adroite12 * [/texte/] : aligner le texte à droite 13 13 * [|texte|] : centrer le texte 14 * [(texte)] : encadrer le texte (occupe toute la largeur de la page, amettre autour d'un paragraphe)15 * [*texte*] : encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)16 * [**texte*] : variante encadrer/surligner le texte (une partie a l'interieur d'un paragraphe)17 * <sup>texte</sup> : mettre en exposant le texte s electionne14 * [(texte)] : encadrer le texte (occupe toute la largeur de la page, à mettre autour d'un paragraphe) 15 * [*texte*] : encadrer/surligner le texte (une partie à l'intérieur d'un paragraphe) 16 * [**texte*] : variante encadrer/surligner le texte (une partie à l'intérieur d'un paragraphe) 17 * <sup>texte</sup> : mettre en exposant le texte sélectionné 18 18 * 19 * Styles pour les encadrements arajouter dans votre feuille de style :19 * Styles pour les encadrements à rajouter dans votre feuille de style : 20 20 * .texteencadre-spip { 21 21 * background: #FFE; … … 34 34 35 35 function BarreTypoEnrichie_pre_propre($texte) { 36 // remplace les fausses listes apuce par de vraies37 // (recherche en d ebut de lignes - suivi d'un ou plusieurs caracteres blancs, en mode multiligne)36 // remplace les fausses listes à puce par de vraies 37 // (recherche en début de lignes - suivi d'un ou plusieurs caractères blancs, en mode multiligne) 38 38 // Mettre $GLOBALS['barre_typo_preserve_puces'] = true; dans mes_options.php pour ne pas avoir ce comportement 39 39 if ($GLOBALS['barre_typo_pas_de_fausses_puces'] === true) … … 43 43 // pour etre pris en charge par paragrapher 44 44 45 // Definition des diff erents intertitres possibles, si pas deja definies45 // Definition des différents intertitres possibles, si pas deja definies 46 46 tester_variable('debut_intertitre', '<h3 class="spip">'); 47 47 tester_variable('fin_intertitre', '</h3>'); … … 61 61 global $debut_intertitre_5, $fin_intertitre_5; 62 62 63 /////////////////////////// 64 //MODIFICATION 65 ////////////////////////// 66 $chercher_raccourcis=array(); 67 $remplacer_raccourcis=array(); 68 global $BarreTypoEnrichie; 69 if (is_array($BarreTypoEnrichie)) 70 foreach($BarreTypoEnrichie as $item) { 71 $chercher_raccourcis[]=$item['chercher']; 72 $remplacer_raccourcis[]=$item['remplacer']; 73 } 74 75 /* 1 */ $chercher_raccourcis[]="/(^|[^{])[{][{][{]/S"; 76 /* 2 */ $chercher_raccourcis[]="/[}][}][}]($|[^}])/S"; 77 /* 3 */ $chercher_raccourcis[]="/(^|[^{])\{1\{/S"; 78 /* 4 */ $chercher_raccourcis[]="/\}1\}($|[^}])/S"; 79 /* 5 */ $chercher_raccourcis[]="/(^|[^{])\{2\{/S"; 80 /* 6 */ $chercher_raccourcis[]="/\}2\}($|[^}])/S"; 81 /* 7 */ $chercher_raccourcis[]="/(^|[^{])\{3\{/S"; 82 /* 8 */ $chercher_raccourcis[]="/\}3\}($|[^}])/S"; 83 /* 9 */ $chercher_raccourcis[]="/(^|[^{])\{4\{/S"; 84 /* 10 */ $chercher_raccourcis[]="/\}4\}($|[^}])/S"; 85 /* 9b */ $chercher_raccourcis[]="/(^|[^{])\{5\{/S"; 86 /* 10b */ $chercher_raccourcis[]="/\}5\}($|[^}])/S"; 87 /* 11 */ $chercher_raccourcis[]="/\{(§|§)\{/S"; # § Pour gerer l'unicode aussi ! 88 /* 12 */ $chercher_raccourcis[]="/\}(§|§)\}/S"; 89 /* 13 */ $chercher_raccourcis[]="/<-->/S"; 90 /* 14 */ $chercher_raccourcis[]="/-->/S"; 91 /* 15 */ $chercher_raccourcis[]="/<--/S"; 92 /* 16 */ $chercher_raccourcis[]="/<==>/S"; 93 /* 17 */ $chercher_raccourcis[]="/==>/S"; 94 /* 18 */ $chercher_raccourcis[]="/<==/S"; 95 /* 19 */ $chercher_raccourcis[]="/\([cC]\)/S"; 96 /* 20 */ $chercher_raccourcis[]="/\([rR]\)/S"; 97 /* 21 */ $chercher_raccourcis[]="/\([tT][mM]\)/S"; 98 /* 22 */ $chercher_raccourcis[]="/\.\.\./S"; 99 /* 23 */ $chercher_raccourcis[]="/\[([^|?][^][]*)\|((?:[^][](?!->))*)\]/S"; 100 101 /* 1 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre"; 102 /* 2 */ $remplacer_raccourcis[]="$fin_intertitre\n\n\$1"; 103 /* 3 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre"; 104 /* 4 */ $remplacer_raccourcis[]="$fin_intertitre\n\n\$1"; 105 /* 5 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_2"; 106 /* 6 */ $remplacer_raccourcis[]="$fin_intertitre_2\n\n\$1"; 107 /* 7 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_3"; 108 /* 8 */ $remplacer_raccourcis[]="$fin_intertitre_3\n\n\$1"; 109 /* 9 */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_4"; 110 /* 10 */ $remplacer_raccourcis[]="$fin_intertitre_4\n\n\$1"; 111 /* 9b */ $remplacer_raccourcis[]="\$1\n\n$debut_intertitre_5"; 112 /* 10b */ $remplacer_raccourcis[]="$fin_intertitre_5\n\n\$1"; 113 /* 11 */ $remplacer_raccourcis[]="<span style=\"font-variant: small-caps\">"; 114 /* 12 */ $remplacer_raccourcis[]="</span>"; 115 /* 13 */ $remplacer_raccourcis[]="↔"; 116 /* 14 */ $remplacer_raccourcis[]="→"; 117 /* 15 */ $remplacer_raccourcis[]="←"; 118 /* 16 */ $remplacer_raccourcis[]="⇔"; 119 /* 17 */ $remplacer_raccourcis[]="⇒"; 120 /* 18 */ $remplacer_raccourcis[]="⇐"; 121 /* 19 */ $remplacer_raccourcis[]="©"; 122 /* 20 */ $remplacer_raccourcis[]="®"; 123 /* 21 */ $remplacer_raccourcis[]="™"; 124 /* 22 */ $remplacer_raccourcis[]="…"; 125 /* 23 */ $remplacer_raccourcis[]="@@acro@@$2@@$1@@acro@@"; 63 $chercher_raccourcis = array( 64 /* 1 */ "/(^|[^{])[{][{][{]/S", 65 /* 2 */ "/[}][}][}]($|[^}])/S", 66 /* 3 */ "/(^|[^{])\{1\{/S", 67 /* 4 */ "/\}1\}($|[^}])/S", 68 /* 5 */ "/(^|[^{])\{2\{/S", 69 /* 6 */ "/\}2\}($|[^}])/S", 70 /* 7 */ "/(^|[^{])\{3\{/S", 71 /* 8 */ "/\}3\}($|[^}])/S", 72 /* 9 */ "/(^|[^{])\{4\{/S", 73 /* 10 */ "/\}4\}($|[^}])/S", 74 /* 9b */ "/(^|[^{])\{5\{/S", 75 /* 10b */ "/\}5\}($|[^}])/S", 76 /* 11 */ "/\{(§|§)\{/S", # § Pour gérer l'unicode aussi ! 77 /* 12 */ "/\}(§|§)\}/S", 78 /* 13 */ "/<-->/S", 79 /* 14 */ "/-->/S", 80 /* 15 */ "/<--/S", 81 /* 16 */ "/<==>/S", 82 /* 17 */ "/==>/S", 83 /* 18 */ "/<==/S", 84 /* 19 */ "/\([cC]\)/S", 85 /* 20 */ "/\([rR]\)/S", 86 /* 21 */ "/\([tT][mM]\)/S", 87 /* 22 */ "/\.\.\./S", 88 /* 23 */ "/\[([^|?][^][]*)\|((?:[^][](?!->))*)\]/S" 89 ); 90 91 $remplacer_raccourcis = array( 92 /* 1 */ "\$1\n\n$debut_intertitre", 93 /* 2 */ "$fin_intertitre\n\n\$1", 94 /* 3 */ "\$1\n\n$debut_intertitre", 95 /* 4 */ "$fin_intertitre\n\n\$1", 96 /* 5 */ "\$1\n\n$debut_intertitre_2", 97 /* 6 */ "$fin_intertitre_2\n\n\$1", 98 /* 7 */ "\$1\n\n$debut_intertitre_3", 99 /* 8 */ "$fin_intertitre_3\n\n\$1", 100 /* 9 */ "\$1\n\n$debut_intertitre_4", 101 /* 10 */ "$fin_intertitre_4\n\n\$1", 102 /* 9b */ "\$1\n\n$debut_intertitre_5", 103 /* 10b */ "$fin_intertitre_5\n\n\$1", 104 /* 11 */ "<span style=\"font-variant: small-caps\">", 105 /* 12 */ "</span>", 106 /* 13 */ "↔", 107 /* 14 */ "→", 108 /* 15 */ "←", 109 /* 16 */ "⇔", 110 /* 17 */ "⇒", 111 /* 18 */ "⇐", 112 /* 19 */ "©", 113 /* 20 */ "®", 114 /* 21 */ "™", 115 /* 22 */ "…", 116 /* 23 */ "@@acro@@$2@@$1@@acro@@" 117 ); 126 118 127 119 $texte = preg_replace($chercher_raccourcis, $remplacer_raccourcis, $texte); 128 120 129 // remplace les fausses listes apuce par de vraies130 // (recherche en d ebut de lignes - suivi d'un ou plusieurs caracteres blancs, en mode multiligne)121 // remplace les fausses listes à puce par de vraies 122 // (recherche en début de lignes - suivi d'un ou plusieurs caractères blancs, en mode multiligne) 131 123 // $texte = preg_replace('/^-\s+/m','-* ',$texte); # deja fait dans post_propre 132 124 … … 136 128 function BarreTypoEnrichie_post_propre($texte) { 137 129 138 # Le remplacement des intertitres de premier niveau a d eja ete effectuedans inc/texte.php139 140 # Intertitre de deuxi eme niveau130 # Le remplacement des intertitres de premier niveau a déjà été effectué dans inc/texte.php 131 132 # Intertitre de deuxième niveau 141 133 /*global $debut_intertitre_2, $fin_intertitre_2; 142 134 $texte = ereg_replace('(<p class="spip">)?[[:space:]]*@@SPIP_debut_intertitre_2@@', $debut_intertitre_2, $texte); 143 135 $texte = ereg_replace('@@SPIP_fin_intertitre_2@@[[:space:]]*(</p>)?', $fin_intertitre_2, $texte);*/ 144 136 145 # Intertitre de troisi eme niveau137 # Intertitre de troisième niveau 146 138 /*global $debut_intertitre_3, $fin_intertitre_3; 147 139 $texte = ereg_replace('(<p class="spip">)?[[:space:]]*@@SPIP_debut_intertitre_3@@', $debut_intertitre_3, $texte); 148 140 $texte = ereg_replace('@@SPIP_fin_intertitre_3@@[[:space:]]*(</p>)?', $fin_intertitre_3, $texte);*/ 149 141 150 # Intertitre de quatri eme niveau142 # Intertitre de quatrième niveau 151 143 /*global $debut_intertitre_4, $fin_intertitre_4; 152 144 $texte = ereg_replace('(<p class="spip">)?[[:space:]]*@@SPIP_debut_intertitre_4@@', $debut_intertitre_4, $texte); 153 145 $texte = ereg_replace('@@SPIP_fin_intertitre_4@@[[:space:]]*(</p>)?', $fin_intertitre_4, $texte);*/ 154 146 155 # Intertitre de cinqui eme niveau147 # Intertitre de cinquième niveau 156 148 /*global $debut_intertitre_5, $fin_intertitre_5; 157 149 $texte = ereg_replace('(<p class="spip">)?[[:space:]]*@@SPIP_debut_intertitre_5@@', $debut_intertitre_5, $texte); … … 248 240 $texte = preg_replace('/@@acro@@([^@]*)@@([^@]*)@@acro@@/S',"<acronym title='$1' class='spip_acronym spip'>$2</acronym>",$texte); 249 241 // Correction des & en & 250 $texte = preg_replace('/&([A-Za-z#0-9]*);/','@@@amp:\1:amp@@@',$texte); // echapement des entites html deja presentes242 $texte = preg_replace('/&([A-Za-z#0-9]*);/','@@@amp:\1:amp@@@',$texte); // échapement des entités html déjà présentes 251 243 $texte = str_replace('&','&',$texte); 252 244 $texte = preg_replace('/@@@amp:([A-Za-z#0-9]*):amp@@@/','&\1;',$texte);
Note: See TracChangeset
for help on using the changeset viewer.