[PLUGINS] +crayons et enluminures
[ptitvelo/web/www.git] / www / plugins / enluminures_typographiques_v3 / enluminures_typo_pipelines.php
1 <?php
2 if (!defined("_ECRIRE_INC_VERSION")) return;
3 function typoenluminee_porte_plume_barre_pre_charger($barres){
4 $barre = &$barres['edition'];
5
6 $barre->cacher('stroke_through');
7
8 $module_barre = "barre_outils";
9 if (intval($GLOBALS['spip_version_branche'])>2)
10 $module_barre = "barreoutils";
11
12 $barre->set('header1', array(
13 // groupe formatage paragraphe
14 "dropMenu" => array(
15 // bouton <cadre>
16 array(
17 "id" => 'intertitre',
18 "name" => _T('barre_intertitre'),
19 "className" => 'outil_intertitre1',
20 "openWith" => "\n{{{",
21 "closeWith" => "}}}\n",
22 "display" => true,
23 "selectionType" => "line",
24 ),
25 array(
26 "id" => 'intertitre2',
27 "name" => _T('enlumtypo:barre_intertitre2'),
28 "className" => 'outil_intertitre2',
29 "openWith" => "\n{{{**",
30 "closeWith" => "}}}\n",
31 "display" => true,
32 "selectionType" => "line",
33 ),
34 array(
35 "id" => 'intertitre3',
36 "name" => _T('enlumtypo:barre_intertitre3'),
37 "className" => 'outil_intertitre3',
38 "openWith" => "\n{{{***",
39 "closeWith" => "}}}\n",
40 "display" => true,
41 "selectionType" => "line",
42 ),
43 array(
44 "id" => 'alignerdroite',
45 "name" => _T('enlumtypo:barre_alignerdroite'),
46 "className" => 'outil_alignerdroite',
47 "openWith" => "\n[/",
48 "closeWith" => "/]\n",
49 "display" => true,
50 "selectionType" => "line",
51 ),
52 array(
53 "id" => 'alignergauche',
54 "name" => _T('enlumtypo:barre_alignergauche'),
55 "className" => 'outil_alignergauche',
56 "openWith" => "\n[!",
57 "closeWith" => "!]\n",
58 "display" => true,
59 "lang" => array('ar','fa'),
60 "selectionType" => "line",
61 ),
62 array(
63 "id" => 'cadretexte',
64 "name" => _T('enlumtypo:barre_encadrer'),
65 "className" => 'outil_cadretexte',
66 "openWith" => "\n[(",
67 "closeWith" => ")]\n",
68 "display" => true,
69 "selectionType" => "line",
70 ),
71 // code spip
72 array(
73 "id" => 'barre_cadre',
74 "name" => _T($module_barre.':barre_cadre'),
75 "className" => "outil_barre_cadre",
76 "openWith" => "\n&lt;cadre&gt;",
77 "closeWith" => "&lt;/cadre&gt;\n",
78 "display" => true,
79 "selectionType" => "line",
80 ),
81 ),
82 ));
83
84 $barre->set('bold', array(
85 // groupe formatage texte
86 "dropMenu" => array(
87 // Mise en évidence (gras + couleur)
88 array(
89 "id" => 'miseenevidence',
90 "name" => _T('enlumtypo:barre_miseenevidence'),
91 "className" => "outil_miseenevidence",
92 "openWith" => "[*",
93 "closeWith" => "*]",
94 "display" => true,
95 "selectionType" => "word",
96 ),
97 // Mise en évidence2 (gras + autre couleur)
98 array(
99 "id" => 'miseenevidence2',
100 "name" => _T('enlumtypo:barre_miseenevidence2'),
101 "className" => "outil_miseenevidence2",
102 "openWith" => "[**",
103 "closeWith" => "*]",
104 "display" => true,
105 "selectionType" => "word",
106 ),
107 // montrer une suppression
108 array(
109 "id" => 'stroke_through_et',
110 "name" => _T('enlumtypo:barre_barre'), // :-)
111 "className" => "outil_stroke_through_et",
112 "openWith" => "<del>",
113 "closeWith" => "</del>",
114 "display" => true,
115 "selectionType" => "word",
116 ),
117 // Mise en exposant
118 array(
119 "id" => 'exposant',
120 "name" => _T('enlumtypo:barre_exposant'),
121 "className" => "outil_exposant",
122 "openWith" => "<sup>",
123 "closeWith" => "</sup>",
124 "display" => true,
125 "selectionType" => "word",
126 ),
127 // Mise en indice
128 array(
129 "id" => 'indice',
130 "name" => _T('enlumtypo:barre_indice'),
131 "className" => "outil_indice",
132 "openWith" => "<sub>",
133 "closeWith" => "</sub>",
134 "display" => true,
135 "selectionType" => "word",
136 ),
137 // cadre spip
138 array(
139 "id" => 'barre_code',
140 "name" => _T($module_barre.':barre_code'),
141 "className" => "outil_barre_code",
142 "openWith" => "&lt;code&gt;",
143 "closeWith" => "&lt;/code&gt;",
144 "display" => true,
145 "selectionType" => "word",
146 ),
147 ),
148 ));
149
150 // Appel Tableau
151 $barre->ajouterApres('notes', array(
152 "id" => 'barre_tableau',
153 "name" => _T('enlumtypo:barre_tableau'),
154 "className" => "outil_barre_tableau",
155 "replaceWith" => 'function(markitup) { zone_selection = markitup.textarea; window.open("?exec=tableau_edit", "","scrollbars=yes,resizable=yes,width=700,height=600") }',
156 "display" => true,
157 "selectionType" => "line",
158 ));
159
160 $barre->set('quote', array(
161 "dropMenu" => array(
162 // poesie spip
163 array(
164 "id" => 'barre_poesie',
165 "name" => _T($module_barre.':barre_poesie'),
166 "className" => "outil_barre_poesie",
167 "openWith" => "\n&lt;poesie&gt;",
168 "closeWith" => "&lt;/poesie&gt;\n",
169 "display" => true,
170 "selectionType" => "line",
171 ),
172 ),
173 ));
174
175 // Petites capitales
176 $barre->ajouterApres('italic', array(
177 "id" => 'petitescapitales',
178 "name" => _T('enlumtypo:barre_petitescapitales'),
179 "className" => "outil_petitescapitales",
180 "openWith" => "<sc>",
181 "closeWith" => "</sc>",
182 "display" => true,
183 "selectionType" => "word",
184 ));
185
186 return $barres;
187 }
188
189 function typoenluminee_porte_plume_lien_classe_vers_icone($flux){
190 return array_merge($flux, array(
191 'outil_intertitre1' => array('spt-v1.png','-10px -226px'), //'intertitre.png'
192 'outil_intertitre2' => array('intertitre2.png','0'),
193 'outil_intertitre3' => array('intertitre3.png','0'),
194 'outil_alignerdroite' => array('right.png','0'),
195 'outil_alignergauche' => array('left.png','0'),
196 'outil_stroke_through_et' => array('spt-v1.png','-10px -946px'), //'text_strikethrough.png'
197 'outil_cadretexte' => array('cadretexte.png','0'),
198 'outil_speciaux' => array('tag.png','0'),
199 'outil_barre_code' => array('page_white_code_red.png','0'),
200 'outil_barre_cadre' => array('page_white_code.png','0'),
201
202 'outil_miseenevidence' => array('miseenevidence.png','0'),
203 'outil_miseenevidence2' => array('miseenevidence2.png','0'),
204 'outil_exposant' => array('exposant.png','0'),
205 'outil_indice' => array('indice.png','0'),
206 'outil_petitescapitales' => array('petitescapitales.png','0'),
207 'outil_barre_poesie' => array('poesie.png','0'),
208
209 'outil_barre_tableau' => array('barre-tableau.png','0'),
210 ));
211 }
212
213 ?>