PageSourceSearch

https://iets.org.br/local/cache-js/jsdyn-javascript_porte_plume_start_js-890efc31.js?1790105337

js iets.org.br collected 2026-10-02 11:58:19 UTC 23,234 bytes, 725 lines download raw bytes

1/* #PRODUIRE{fond=javascript/porte_plume_start.js,hash=257a709119e1a4c763efb43f595a441d,inserer_auto_name_texte=1,lang=pt_br}
2   md5:483ab5ba3e2f14ace0618ac3c5983a09 */
3
4
5barre_outils_edition = {
6    "nameSpace": "edition",
7    "previewAutoRefresh": false,
8    "onEnter": {
9        "keepDefault": false,
10        "selectionType": "return",
11        "replaceWith": "\n"
12    },
13    "onShiftEnter": {
14        "keepDefault": false,
15        "replaceWith": "\n_ "
16    },
17    "onCtrlEnter": {
18        "keepDefault": false,
19        "replaceWith": "\n\n"
20    },
21    "markupSet": [
22        {
23            "name": "Transformar em {{{intert\u00edtulo}}}",
24            "key": "H",
25            "className": "outil_header1",
26            "openWith": "\n{{{",
27            "closeWith": "}}}\n",
28            "selectionType": "line"
29        },
30        {
31            "name": "P\u00f4r em {{negrito}}",
32            "key": "B",
33            "className": "outil_bold",
34            "replaceWith": function(h){ return espace_si_accolade(h, '{{', '}}');},
35            "selectionType": "word"
36        },
37        {
38            "name": "P\u00f4r em {it\u00e1lico}",
39            "key": "I",
40            "className": "outil_italic",
41            "replaceWith": function(h){ return espace_si_accolade(h, '{', '}');},
42            "selectionType": "word"
43        },
44        {
45            "name": "P\u00f4r em lista",
46            "className": "outil_liste_ul separateur_avant",
47            "replaceWith": function(h){ return outil_liste(h, '*');},
48            "selectionType": "line",
49            "forceMultiline": true,
50            "dropMenu": [
51                {
52                    "id": "liste_ol",
53                    "name": "P\u00f4r em lista numerada",
54                    "className": "outil_liste_ol",
55                    "replaceWith": function(h){ return outil_liste(h, '#');},
56                    "display": true,
57                    "selectionType": "line",
58                    "forceMultiline": true
59                },
60                {
61                    "id": "desindenter",
62                    "name": "Desindentar uma lista",
63                    "className": "outil_desindenter",
64                    "replaceWith": function(h){return outil_desindenter(h);},
65                    "display": true,
66                    "selectionType": "line",
67                    "forceMultiline": true
68                },
69                {
70                    "id": "indenter",
71                    "name": "Indentar uma lista",
72                    "className": "outil_indenter",
73                    "replaceWith": function(h){return outil_indenter(h);},
74                    "display": true,
75                    "selectionType": "line",
76                    "forceMultiline": true
77                }
78            ]
79        },
80        {
81            "name": "Transformar em [link ->http:\/\/...]",
82            "key": "L",
83            "className": "outil_link separateur separateur_apres sepLink",
84            "openWith": "[",
85            "closeWith": "->[![Indique o endere\u00e7o do link (pode ser uma p\u00e1gina, como  http:\/\/qqcoisa.com.br, um endere\u00e7o de email \u2014 ou, para lincar com um artigo deste site, simplesmente digite seu n\u00famero.]!]]"
86        },
87        {
88            "name": "Transformar em [[Nota de rodap\u00e9]]",
89            "className": "outil_notes separateur_avant",
90            "openWith": "[[",
91            "closeWith": "]]",
92            "selectionType": "word"
93        },
94        {
95            "name": "<quote>Fazer uma cita\u00e7\u00e3o<\/quote>",
96            "key": "Q",
97            "className": "outil_quote separateur separateur_apres sepGuillemets",
98            "openWith": "\n<quote>",
99            "closeWith": "<\/quote>\n",
100            "selectionType": "word",
101            "dropMenu": [
102                {
103                    "id": "barre_poesie",
104                    "name": "Formatar como <poesie>poesia<\/poesie>",
105                    "className": "outil_poesie",
106                    "openWith": "\n<poesie>",
107                    "closeWith": "<\/poesie>\n",
108                    "display": true,
109                    "selectionType": "line"
110                }
111            ]
112        },
113        {
114            "name": "Colocar entre \u00abaspas francesas\u00bb",
115            "className": "outil_guillemets",
116            "openWith": "«",
117            "closeWith": "»",
118            "lang": [
119                "fr",
120                "eo",
121                "cpf",
122                "ar",
123                "es"
124            ],
125            "selectionType": "word",
126            "dropMenu": [
127                {
128                    "id": "guillemets_simples",
129                    "name": "Colocar entre \u201caspas\u201d",
130                    "className": "outil_guillemets_simples",
131                    "openWith": "“",
132                    "closeWith": "”",
133                    "display": true,
134                    "lang": [
135                        "fr",
136                        "eo",
137                        "cpf",
138                        "ar",
139                        "es"
140                    ],
141                    "selectionType": "word"
142                }
143            ]
144        },
145        {
146            "name": "Colocar entre \u00abaspas francesas\u00bb",
147            "className": "outil_guillemets_de",
148            "openWith": "„",
149            "closeWith": "“",
150            "lang": [
151                "bg",
152                "de",
153                "pl",
154                "hr",
155                "src"
156            ],
157            "selectionType": "word",
158            "dropMenu": [
159                {
160                    "id": "guillemets_de_simples",
161                    "name": "Colocar entre \u201caspas\u201d",
162                    "className": "outil_guillemets_de_simples",
163                    "openWith": "&sbquo;",
164                    "closeWith": "‘",
165                    "display": true,
166                    "lang": [
167                        "bg",
168                        "de",
169                        "pl",
170                        "hr",
171                        "src"
172                    ],
173                    "selectionType": "word"
174                }
175            ]
176        },
177        {
178            "name": "Colocar entre \u00abaspas francesas\u00bb",
179            "className": "outil_guillemets_simples separateur_avant",
180            "openWith": "“",
181            "closeWith": "”",
182            "lang_not": [
183                "fr",
184                "eo",
185                "cpf",
186                "ar",
187                "es",
188                "bg",
189                "de",
190                "pl",
191                "hr",
192                "src"
193            ],
194            "selectionType": "word",
195            "dropMenu": [
196                {
197                    "id": "guillemets_autres_simples",
198                    "name": "Colocar entre \u201caspas\u201d",
199                    "className": "outil_guillemets_uniques",
200                    "openWith": "‘",
201                    "closeWith": "’",
202                    "display": true,
203                    "lang_not": [
204                        "fr",
205                        "eo",
206                        "cpf",
207                        "ar",
208                        "es",
209                        "bg",
210                        "de",
211                        "pl",
212                        "hr",
213                        "src"
214                    ],
215                    "selectionType": "word"
216                }
217            ]
218        },
219        {
220            "name": "Inserir caracteres especiais",
221            "className": "outil_caracteres separateur separateur_apres sepCaracteres",
222            "dropMenu": [
223                {
224                    "id": "A_grave",
225                    "name": "Inserir \u00c0",
226                    "className": "outil_a_maj_grave",
227                    "replaceWith": "À",
228                    "display": true,
229                    "lang": [
230                        "fr",
231                        "eo",
232                        "cpf"
233                    ]
234                },
235                {
236                    "id": "E_aigu",
237                    "name": "Inserir \u00c9",
238                    "className": "outil_e_maj_aigu",
239                    "replaceWith": "É",
240                    "display": true,
241                    "lang": [
242                        "fr",
243                        "eo",
244                        "cpf"
245                    ]
246                },
247                {
248                    "id": "E_grave",
249                    "name": "Inserir \u00c8",
250                    "className": "outil_e_maj_grave",
251                    "replaceWith": "È",
252                    "display": true,
253                    "lang": [
254                        "fr",
255                        "eo",
256                        "cpf"
257                    ]
258                },
259                {
260                    "id": "aelig",
261                    "name": "Inserir \u00e6",
262                    "className": "outil_aelig",
263                    "replaceWith": "æ",
264                    "display": true,
265                    "lang": [
266                        "fr",
267                        "eo",
268                        "cpf"
269                    ]
270                },
271                {
272                    "id": "AElig",
273                    "name": "Inserir \u00c6",
274                    "className": "outil_aelig_maj",
275                    "replaceWith": "Æ",
276                    "display": true,
277                    "lang": [
278                        "fr",
279                        "eo",
280                        "cpf"
281                    ]
282                },
283                {
284                    "id": "oe",
285                    "name": "Inserir \u0153",
286                    "className": "outil_oe",
287                    "replaceWith": "œ",
288                    "display": true,
289                    "lang": [
290                        "fr"
291                    ]
292                },
293                {
294                    "id": "OE",
295                    "name": "Inserir \u0152",
296                    "className": "outil_oe_maj",
297                    "replaceWith": "Œ",
298                    "display": true,
299                    "lang": [
300                        "fr"
301                    ]
302                },
303                {
304                    "id": "Ccedil",
305                    "name": "Inserir \u00c7",
306                    "className": "outil_ccedil_maj",
307                    "replaceWith": "Ç",
308                    "display": true,
309                    "lang": [
310                        "fr",
311                        "eo",
312                        "cpf"
313                    ]
314                },
315                {
316                    "id": "uppercase",
317                    "name": "Transformar em caixa alta",
318                    "className": "outil_uppercase",
319                    "replaceWith": function(markitup) { return markitup.selection.toUpperCase() },
320                    "display": true,
321                    "lang": [
322                        "fr",
323                        "en"
324                    ]
325                },
326                {
327                    "id": "lowercase",
328                    "name": "Transformar em caixa baixa",
329                    "className": "outil_lowercase",
330                    "replaceWith": function(markitup) { return markitup.selection.toLowerCase() },
331                    "display": true,
332                    "lang": [
333                        "fr",
334                        "en"
335                    ]
336                }
337            ]
338        },
339        {
340            "name": "Utiliser un outil du Couteau Suisse",
341            "className": "couteau_suisse_drop separateur_avant",
342            "replaceWith": "",
343            "dropMenu": [
344                {
345                    "id": "blocs_bloc",
346                    "name": "Ins\u00e9rer un bloc repli\u00e9",
347                    "className": "blocs_bloc",
348                    "replaceWith": "\n<bloc>Un titre\n\nPlacez votre texte ici\n<\/bloc>\n",
349                    "display": true
350                },
351                {
352                    "id": "blocs_visible",
353                    "name": "Ins\u00e9rer un bloc d\u00e9pli\u00e9",
354                    "className": "blocs_visible",
355                    "replaceWith": "\n<visible>Un titre\n\nPlacez votre texte ici\n<\/visible>\n",
356                    "display": true
357                }
358            ]
359        },
360        {
361            "name": "Inserir c\u00f3digo de inform\u00e1tica (`)",
362            "className": "outil_code separateur separateur_apres sepCode",
363            "openWith": "`",
364            "closeWith": "`",
365            "dropMenu": [
366                {
367                    "id": "cadre",
368                    "name": "Insirir c\u00f3digo pr\u00e9-formatado (```)",
369                    "className": "outil_cadre",
370                    "openWith": "```\n",
371                    "closeWith": "\n```",
372                    "display": true
373                }
374            ]
375        }
376    ]
377}
378
379 
380				// remplace ou cree -* ou -** ou -# ou -##
381				function outil_liste(h, c) {
382					if ((s = h.selection) && (r = s.match(/^-([*#]+) (.*)$/)))	 {
383						r[1] = r[1].replace(/[#*]/g, c);
384						s = '-'+r[1]+' '+r[2];
385					} else {
386						s = '-' + c + ' '+s;
387					}
388					return s;
389				}
390
391				// indente des -* ou -#
392				function outil_indenter(h) {
393					if (s = h.selection) {
394						if (s.substr(0,2)=='-*') {
395							s = '-**' + s.substr(2);
396						} else if (s.substr(0,2)=='-#') {
397							s = '-##' + s.substr(2);
398						} else {
399							s = '-* ' + s;
400						}
401					}
402					return s;
403				}
404
405				// desindente des -* ou -** ou -# ou -##
406				function outil_desindenter(h){
407					if (s = h.selection) {
408						if (s.substr(0,3)=='-**') {
409							s = '-*' + s.substr(3);
410						} else if (s.substr(0,3)=='-* ') {
411							s = s.substr(3);
412						} else if (s.substr(0,3)=='-##') {
413							s = '-#' + s.substr(3);
414						} else if (s.substr(0,3)=='-# ') {
415							s = s.substr(3);
416						}
417					}
418					return s;
419				}
420
421				// ajouter un espace avant, apres un {qqc} pour ne pas que
422				// gras {{}} suivi de italique {} donnent {{{}}}, mais { {{}} }
423				function espace_si_accolade(h, openWith, closeWith){
424					if (s = h.selection) {
425						// accolade dans la selection
426						if (s.charAt(0)=='{') {
427							return openWith + ' ' + s + ' ' + closeWith;
428						}
429						// accolade avant la selection
430						else if (c = h.textarea.selectionStart) {
431							if (h.textarea.value.charAt(c-1) == '{') {
432								return ' ' + openWith + s + closeWith + ' ';
433							}
434						}
435					}
436					return openWith + s + closeWith;
437				}
438				
439
440barre_outils_forum = {
441    "nameSpace": "forum",
442    "previewAutoRefresh": false,
443    "onEnter": {
444        "keepDefault": false,
445        "selectionType": "return",
446        "replaceWith": "\n"
447    },
448    "onShiftEnter": {
449        "keepDefault": false,
450        "replaceWith": "\n_ "
451    },
452    "onCtrlEnter": {
453        "keepDefault": false,
454        "replaceWith": "\n\n"
455    },
456    "markupSet": [
457        {
458            "name": "P\u00f4r em {{negrito}}",
459            "key": "B",
460            "className": "outil_bold",
461            "replaceWith": function(h){ return espace_si_accolade(h, '{{', '}}');},
462            "selectionType": "word"
463        },
464        {
465            "name": "P\u00f4r em {it\u00e1lico}",
466            "key": "I",
467            "className": "outil_italic separateur_avant",
468            "replaceWith": function(h){ return espace_si_accolade(h, '{', '}');},
469            "selectionType": "word"
470        },
471        {
472            "name": "Transformar em [link ->http:\/\/...]",
473            "key": "L",
474            "className": "outil_link separateur separateur_apres sepLink separateur_avant",
475            "openWith": "[",
476            "closeWith": "->[![Indique o endere\u00e7o do link (pode ser uma p\u00e1gina, como  http:\/\/qqcoisa.com.br, um endere\u00e7o de email \u2014 ou, para lincar com um artigo deste site, simplesmente digite seu n\u00famero.]!]]"
477        },
478        {
479            "name": "<quote>Fazer uma cita\u00e7\u00e3o<\/quote>",
480            "key": "Q",
481            "className": "outil_quote separateur separateur_apres sepGuillemets",
482            "openWith": "\n<quote>",
483            "closeWith": "<\/quote>\n",
484            "selectionType": "word"
485        },
486        {
487            "name": "Colocar entre \u00abaspas francesas\u00bb",
488            "className": "outil_guillemets",
489   
489         "openWith": "«",
490            "closeWith": "»",
491            "lang": [
492                "fr",
493                "eo",
494                "cpf",
495                "ar",
496                "es"
497            ],
498            "selectionType": "word",
499            "dropMenu": [
500                {
501                    "id": "guillemets_simples",
502                    "name": "Colocar entre \u201caspas\u201d",
503                    "className": "outil_guillemets_simples",
504                    "openWith": "“",
505                    "closeWith": "”",
506                    "display": true,
507                    "lang": [
508                        "fr",
509                        "eo",
510                        "cpf",
511                        "ar",
512                        "es"
513                    ],
514                    "selectionType": "word"
515                }
516            ]
517        },
518        {
519            "name": "Colocar entre \u00abaspas francesas\u00bb",
520            "className": "outil_guillemets_de",
521            "openWith": "„",
522            "closeWith": "“",
523            "lang": [
524                "bg",
525                "de",
526                "pl",
527                "hr",
528                "src"
529            ],
530            "selectionType": "word",
531            "dropMenu": [
532                {
533                    "id": "guillemets_de_simples",
534                    "name": "Colocar entre \u201caspas\u201d",
535                    "className": "outil_guillemets_de_simples",
536                    "openWith": "&sbquo;",
537                    "closeWith": "‘",
538                    "display": true,
539                    "lang": [
540                        "bg",
541                        "de",
542                        "pl",
543                        "hr",
544                        "src"
545                    ],
546                    "selectionType": "word"
547                }
548            ]
549        },
550        {
551            "name": "Colocar entre \u00abaspas francesas\u00bb",
552            "className": "outil_guillemets_simples separateur_avant",
553            "openWith": "“",
554            "closeWith": "”",
555            "lang_not": [
556                "fr",
557                "eo",
558                "cpf",
559                "ar",
560                "es",
561                "bg",
562                "de",
563                "pl",
564                "hr",
565                "src"
566            ],
567            "selectionType": "word",
568            "dropMenu": [
569                {
570                    "id": "guillemets_autres_simples",
571                    "name": "Colocar entre \u201caspas\u201d",
572                    "className": "outil_guillemets_uniques",
573                    "openWith": "‘",
574                    "closeWith": "’",
575                    "display": true,
576                    "lang_not": [
577                        "fr",
578                        "eo",
579                        "cpf",
580                        "ar",
581                        "es",
582                        "bg",
583                        "de",
584                        "pl",
585                        "hr",
586                        "src"
587                    ],
588                    "selectionType": "word"
589                }
590            ]
591        }
592    ]
593}
594
595 
596				// remplace ou cree -* ou -** ou -# ou -##
597				function outil_liste(h, c) {
598					if ((s = h.selection) && (r = s.match(/^-([*#]+) (.*)$/)))	 {
599						r[1] = r[1].replace(/[#*]/g, c);
600						s = '-'+r[1]+' '+r[2];
601					} else {
602						s = '-' + c + ' '+s;
603					}
604					return s;
605				}
606
607				// indente des -* ou -#
608				function outil_indenter(h) {
609					if (s = h.selection) {
610						if (s.substr(0,2)=='-*') {
611							s = '-**' + s.substr(2);
612						} else if (s.substr(0,2)=='-#') {
613							s = '-##' + s.substr(2);
614						} else {
615							s = '-* ' + s;
616						}
617					}
618					return s;
619				}
620
621				// desindente des -* ou -** ou -# ou -##
622				function outil_desindenter(h){
623					if (s = h.selection) {
624						if (s.substr(0,3)=='-**') {
625							s = '-*' + s.substr(3);
626						} else if (s.substr(0,3)=='-* ') {
627							s = s.substr(3);
628						} else if (s.substr(0,3)=='-##') {
629							s = '-#' + s.substr(3);
630						} else if (s.substr(0,3)=='-# ') {
631							s = s.substr(3);
632						}
633					}
634					return s;
635				}
636
637				// ajouter un espace avant, apres un {qqc} pour ne pas que
638				// gras {{}} suivi de italique {} donnent {{{}}}, mais { {{}} }
639				function espace_si_accolade(h, openWith, closeWith){
640					if (s = h.selection) {
641						// accolade dans la selection
642						if (s.charAt(0)=='{') {
643							return openWith + ' ' + s + ' ' + closeWith;
644						}
645						// accolade avant la selection
646						else if (c = h.textarea.selectionStart) {
647							if (h.textarea.value.charAt(c-1) == '{') {
648								return ' ' + openWith + s + closeWith + ' ';
649							}
650						}
651					}
652					return openWith + s + closeWith;
653				}
654				
655
656barre_outils_vide = {
657    "nameSpace": "vide",
658    "previewAutoRefresh": false,
659    "markupSet": []
660}
661
662 
663
664
665;(function($){
666
667// 2 fonctions pour appeler le porte plume reutilisables pour d'autres plugins
668// on envoie dedans la selection jquery qui doit etre effectuee
669// ce qui evite des appels direct a markitup, aucazou on change de lib un j
669our
670$.fn.barre_outils = function(nom, settings) {
671	options = {
672		lang:'pt_br'
673	};
674	$.extend(options, settings);
675
676	return $(this)
677		.not('.markItUpEditor, .no_barre')
678		.markItUp(eval('barre_outils_' + nom), {lang:options.lang})
679		.trigger('markItUpEditor.loaded')
680		.parent().find('.markItUpButton a').attr('tabindex', -1) // ne pas tabuler les boutons
681		.end(); 
682};
683
684$.fn.barre_previsualisation = function(settings) {
685	options = {
686		previewParserPath:"index.php?action=porte_plume_previsu", // ici une url relative pour prive/public
687		textEditer:"Alterar",
688		textVoir:"Ver"
689	};
690	$.extend(options, settings);
691
692	return $(this)
693		.not('.pp_previsualisation, .no_previsualisation')
694		.previsu_spip(options)
695		.trigger('markItUpPreview.loaded')
696		.parent().find('.markItUpTabs a').attr('tabindex', -1) // ne pas tabuler les onglets
697		.end();
698};
699
700$(window).on('load', function(){
701	// ajoute les barres d'outils markitup
702	function barrebouilles(){
703		// fonction generique appliquee aux classes CSS :
704		// inserer_barre_forum, inserer_barre_edition, inserer_previsualisation
705		$('.formulaire_spip textarea.inserer_barre_forum').barre_outils('forum');
706		$('.formulaire_spip textarea.inserer_barre_edition').barre_outils('edition');
707		$('.formulaire_spip textarea.inserer_previsualisation').barre_previsualisation();
708
709		 
710		// fonction specifique aux formulaires de SPIP :
711		// barre de forum
712		$('textarea.textarea_forum').barre_outils('forum');
713		 
714		$('.formulaire_forum textarea[name=texte]').barre_outils('forum');
715		// barre d'edition et onglets de previsualisation
716		$('.formulaire_spip textarea[name=texte]')
717			.barre_outils('edition').end()
718			.barre_previsualisation();
719		
720	}
721	barrebouilles();
722	onAjaxLoad(barrebouilles);
723
724});
725})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.