1 - fields: {name: "Nag\u0142\xF3wki", position: 0, slug: naglowki}
2 model: toolbar.buttongroup
4 - fields: {name: Autokorekta, position: 0, slug: autokorekta}
5 model: toolbar.buttongroup
7 - fields: {name: Mastery, position: 0, slug: mastery}
8 model: toolbar.buttongroup
10 - fields: {name: 'Dramat ', position: 0, slug: dramat}
11 model: toolbar.buttongroup
13 - fields: {name: "Elementy pocz\u0105tkowe", position: 0, slug: elementy-poczatkowe}
14 model: toolbar.buttongroup
16 - fields: {name: Akapity, position: 0, slug: akapity}
17 model: toolbar.buttongroup
19 - fields: {name: Style znakowe, position: 0, slug: style-znakowe}
20 model: toolbar.buttongroup
22 - fields: {name: Separatory, position: 0, slug: separatory}
23 model: toolbar.buttongroup
25 - fields: {name: Wersy, position: 0, slug: wersy}
26 model: toolbar.buttongroup
28 - fields: {name: Bloki, position: 0, slug: bloki}
29 model: toolbar.buttongroup
31 - fields: {name: "Pocz\u0105tek dramatu", position: 0, slug: poczatek-dramatu}
32 model: toolbar.buttongroup
34 - fields: {name: Przypisy, position: 0, slug: przypisy}
35 model: toolbar.buttongroup
37 - fields: {name: Autotagowanie, position: 0, slug: autotagowanie}
38 model: toolbar.buttongroup
40 - fields: {name: Uwaga, position: 0, slug: uwaga}
41 model: toolbar.buttongroup
46 label: ",,\u2026\" na \xAB\u2026\xBB"
48 params: '{"exprs": [[",,", "\u00ab"], ["\"", "\u00bb"]]}'
49 scriptlet: fulltextregexp
51 tooltip: "Zamienia cudzys\u0142owy podw\xF3jne na francuskie"
57 label: ",,\u2026\" na \xBB\u2026\xAB"
59 params: '{"exprs": [[",,", "\u00bb"], ["\"", "\u00ab"]]}'
60 scriptlet: fulltextregexp
62 tooltip: "Zamienia cudzys\u0142owy podw\xF3jne na niemieckie"
70 params: '[["fulltextregexp", {"exprs": [["\ufeff", ""], ["$[\\s]*\\d+[\\s]*^",
71 ""], ["-\\s*^", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."], ["<(/?)P([aert])",
72 "<$1p$2"], ["[\u2014\u2013\u2010-]{2,}|[\u2014\u2013\u2010]+", "---"],
73 ["(\\s)-([^-])", "$1---$2"], ["([^-])-(\\s)", "$1---$2"], ["(\\d)-+(\\d)",
74 "$1--$2"], ["---(\\S)", "--- $1"], ["(\\S)---", "$1 ---"], ["<akap_dialog>\\s*-+\\s*",
75 "<akap_dialog>--- "]]}], ["lineregexp", {"exprs": [["^\\s+|\\s+$", ""],
76 ["\\s+", " "], ["(,,)\\s+", "$1"], ["\\s+(\")", "$1"], ["([^\\.])(\\s*)</p",
77 "$1.$2</p"], ["([\\.:;!\\?])([^\\s\\\\])", "$1 $2"], ["([^\\s])\\s+([\\.:;!\\?])",
78 "$1$2"], ["\\s+,([^,])", ",$1"], ["([^,]),([^\\s\\\\,])", "$1, $2"], ["([A-Za-z])0",
79 "$1o"], ["(\\. )0([A-Za-z])", "$1O$2"], [" 0([A-Za-z])", " o$1"], ["([A-Za-z])1",
80 "$1l"], ["(\\. )1([A-Za-z])", "$1L$2"], [" 1([A-Za-z])", " l$1"]]}]]'
82 slug: basic_correction
83 tooltip: "Wykonuj\u0119 podstawow\u0105 korekt\u0119 tekstu."
89 label: "cz\u0119\u015B\u0107/ksi\u0119ga"
91 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "naglowek_czesc"}'
100 label: "rozdzia\u0142"
102 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "naglowek_rozdzial"}'
103 scriptlet: insert_tag
106 model: toolbar.button
111 label: "podrozdzia\u0142"
113 params: '{"tag": "naglowek_podrozdzial"}'
114 scriptlet: insert_tag
117 model: toolbar.button
122 label: "\u015Br\xF3dtytu\u0142"
124 params: '{"tag": "srodtytul"}'
125 scriptlet: insert_tag
128 model: toolbar.button
135 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "naglowek_akt"}'
136 scriptlet: insert_tag
139 model: toolbar.button
146 params: '{"tag": "naglowek_scena"}'
147 scriptlet: insert_tag
150 model: toolbar.button
155 label: "nag\u0142\xF3wek kwestii"
157 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "naglowek_osoba"}'
158 scriptlet: insert_tag
159 slug: naglowek-kwestii
160 tooltip: "nag\u0142\xF3wek kwestii - nazwa osoby"
161 model: toolbar.button
166 label: "tag g\u0142\xF3wny"
168 params: '{"tag": "utwor"}'
169 scriptlet: insert_tag
172 model: toolbar.button
179 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "opowiadanie"}'
180 scriptlet: insert_tag
183 model: toolbar.button
188 label: "powie\u015B\u0107"
190 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "powiesc"}'
191 scriptlet: insert_tag
194 model: toolbar.button
199 label: dramat wiersz.
201 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "dramat_wierszowany_l"}'
202 scriptlet: insert_tag
205 model: toolbar.button
210 label: "dramat wsp\xF3\u0142czesny"
212 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "dramat_wspolczesny"}'
213 scriptlet: insert_tag
214 slug: dramat-wspolczesny
215 tooltip: "dramat wsp\xF3\u0142czesny (proz\u0105)"
216 model: toolbar.button
221 label: "dramat wiersz./w. \u0142am"
223 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "dramat_wierszowany_lp"}'
224 scriptlet: insert_tag
225 slug: dramat-wiersz-w-lam
226 tooltip: "dramat wierszowany o zw\u0119\u017Conej szeroko\u015Bci \u0142amu"
227 model: toolbar.button
234 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "liryka_l"}'
235 scriptlet: insert_tag
238 model: toolbar.button
243 label: "liryka/w. \u0142am"
245 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "liryka_lp"}'
246 scriptlet: insert_tag
248 tooltip: "utw\xF3r liryczny o zw\u0119\u017Conej szeroko\u015Bci \u0142amu"
249 model: toolbar.button
256 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "wywiad"}'
257 scriptlet: insert_tag
260 model: toolbar.button
267 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "autor_utworu"}'
268 scriptlet: insert_tag
271 model: toolbar.button
278 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "nazwa_utworu"}'
279 scriptlet: insert_tag
282 model: toolbar.button
287 label: "podtytu\u0142"
289 params: '{"tag": "podtytul"}'
290 scriptlet: insert_tag
293 model: toolbar.button
300 params: '{"tag": "nota"}'
301 scriptlet: insert_tag
304 model: toolbar.button
311 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "motto_podpis"}'
312 scriptlet: insert_tag
315 model: toolbar.button
320 label: "dzie\u0142o nadrz\u0119dne"
322 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "dzielo_nadrzedne"}'
323 scriptlet: insert_tag
324 slug: dzielo-nadrzedne
326 model: toolbar.button
333 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "akap"}'
334 scriptlet: insert_tag
336 tooltip: wstawia akapit
337 model: toolbar.button
344 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "akap_cd"}'
345 scriptlet: insert_tag
347 tooltip: "ci\u0105g dalszy akapitu po wewn\u0105trzakapitowym wtr\u0105ceniu"
348 model: toolbar.button
353 label: akapit dialogowy
355 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "akap_dialog"}'
356 scriptlet: insert_tag
357 slug: akapit-dialogowy
358 tooltip: wstawia akapit dialogowy
359 model: toolbar.button
364 label: "d\u0142ugi cytat"
366 params: '{"tag": "dlugi_cytat"}'
367 scriptlet: insert_tag
369 tooltip: "d\u0142ugi cytat wyr\xF3\u017Cniony sk\u0142adem"
370 model: toolbar.button
375 label: "wyr\xF3\u017Cnienie"
377 params: '{"tag": "wyroznienie"}'
378 scriptlet: insert_tag
380 tooltip: "wyr\xF3\u017Cnienie autorskie"
381 model: toolbar.button
386 label: "tytu\u0142 dzie\u0142a typ 1"
388 params: '{"tag": "tytul_dziela", "attrs": {"typ": "1"}}'
389 scriptlet: insert_tag
390 slug: tytul-dziela-typ
391 tooltip: "tytu\u0142 dzie\u0142a w cytowanym tytule dzie\u0142a"
392 model: toolbar.button
397 label: "s\u0142owo obce"
399 params: '{"tag": "slowo_obce"}'
400 scriptlet: insert_tag
402 tooltip: "frazy w j\u0119zykach innych ni\u017C polski/definiendum w przypisie"
403 model: toolbar.button
410 params: '{"tag": "mat"}'
411 scriptlet: insert_tag
413 tooltip: "wyra\u017Cenia matematyczne lub zmienne symboliczne"
414 model: toolbar.button
421 params: '{"tag": "www"}'
422 scriptlet: insert_tag
425 model: toolbar.button
432 params: '{"tag": "indeks_dolny"}'
433 scriptlet: insert_tag
436 model: toolbar.button
441 label: "wi\u0119ksze odst\u0119py"
443 params: '{"tag": "wieksze_odstepy"}'
444 scriptlet: insert_tag
445 slug: wieksze-odstepy
446 tooltip: "wi\u0119ksze odst\u0119py mi\u0119dzy s\u0142owami"
447 model: toolbar.button
454 params: '{"tag": "uwaga"}'
455 scriptlet: insert_tag
457 tooltip: 'uwagi redaktorsko-korektorskie '
458 model: toolbar.button
463 label: "\u015Bwiat\u0142o"
465 params: '{"nocontent": "true", "tag": "sekcja_swiatlo"}'
466 scriptlet: insert_tag
468 tooltip: "\u015Bwiat\u0142o rozdzielaj\u0105ce sekcje tekstu"
469 model: toolbar.button
476 params: '{"nocontent": "true", "tag": "sekcja_asterysk"}'
477 scriptlet: insert_tag
479 tooltip: rozdzielenie partii tekstu asteryskiem
480 model: toolbar.button
487 params: '{"nocontent": "true", "tag": "separator_linia"}'
488 scriptlet: insert_tag
490 tooltip: "rozdzielenie partii tekstu pozioma lini\u0105"
491 model: toolbar.button
496 label: "zast\u0119pnik wersu"
498 params: '{"tag": "zastepnik_wersu"}'
499 scriptlet: insert_tag
500 slug: zastepnik-wersu
501 tooltip: wykropkowanie wersu
502 model: toolbar.button
509 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "didaskalia"}'
510 scriptlet: insert_tag
513 model: toolbar.button
518 label: didaskalia tekstowe
520 params: '{"tag": "didask_tekst"}'
521 scriptlet: insert_tag
522 slug: didaskalia-tekstowe
523 tooltip: "didaskalia umieszczone w obr\u0119bie innego tekstu"
524 model: toolbar.button
531 params: '{"tag": "osoba"}'
532 scriptlet: insert_tag
534 tooltip: "wstawia nazw\u0119 osoby w didaskaliach"
535 model: toolbar.button
540 label: "d\u0142ugi cyt. poet."
542 params: '{"tag": "poezja_cyt"}'
543 scriptlet: insert_tag
545 tooltip: "d\u0142ugi cytat wierszowany wyr\xF3\u017Cniony sk\u0142adem"
546 model: toolbar.button
551 label: przypis autorski
553 params: '{"tag": "pa"}'
554 scriptlet: insert_tag
555 slug: przypis-autorski
557 model: toolbar.button
562 label: "przypis t\u0142umacza"
564 params: '{"tag": "pt"}'
565 scriptlet: insert_tag
566 slug: przypis-tlumacza
568 model: toolbar.button
573 label: przypis redaktorski
575 params: '{"tag": "pr"}'
576 scriptlet: insert_tag
577 slug: przypis-redaktorski
579 model: toolbar.button
584 label: przypis edytorski
586 params: '{"tag": "pe"}'
587 scriptlet: insert_tag
588 slug: przypis-edytorski
590 model: toolbar.button
595 label: wywiad pytanie
597 params: '{"tag": "wywiad_pyt"}'
598 scriptlet: insert_tag
601 model: toolbar.button
606 label: "wywiad odpowied\u017A"
608 params: '{"tag": "wywiad_odp"}'
609 scriptlet: insert_tag
610 slug: wywiad-odpowiedz
612 model: toolbar.button
619 params: '{"tag": "dedykacja"}'
620 scriptlet: insert_tag
623 model: toolbar.button
630 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "motto"}'
631 scriptlet: insert_tag
634 model: toolbar.button
639 label: "A<sup>\u2193</sup>"
644 tooltip: "Zamie\u0144 wielkie litery na ma\u0142e"
645 model: toolbar.button
650 label: "zamiana cudzys\u0142ow\xF3w 2"
652 params: '{"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["([^=])\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])",
653 "$1,,$2"], ["^\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])",
654 ",,$1"], ["(,,)\\s+|\\s+(\")", "$1"]]}'
655 scriptlet: lineregexp
656 slug: cudzyslow-niemiecki
657 tooltip: "zamienia \" na ,, oraz \xBBa\xAB na ,,a\""
658 model: toolbar.button
665 params: '{"padding_top": 1, "padding_bottom": 1, "tag": "lista_osoba", "attrs":
667 scriptlet: insert_tag
668 slug: lista-osob-pole
669 tooltip: osoby z takim samym opisem
670 model: toolbar.button
675 label: "didaskalia pocz\u0105tkowe"
677 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "miejsce_czas"}'
678 scriptlet: insert_tag
679 slug: didaskalia-poczatkowe
680 tooltip: "komentarze wprowadzaj\u0105ce przed tekstem dramatu"
681 model: toolbar.button
688 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "strofa"}'
689 scriptlet: insert_stanza
691 tooltip: "wstawia strof\u0119"
692 model: toolbar.button
699 params: '{"padding_top": 1, "padding_bottom": 1, "tag": "kwestia"}'
700 scriptlet: insert_tag
702 tooltip: "wstawia kwesti\u0119"
703 model: toolbar.button
708 label: "wers mocno wci\u0119ty"
710 params: '{"tag": "wers_wciety", "attrs": {"typ": ""}}'
711 scriptlet: insert_tag
712 slug: wers-mocno-wciety
713 tooltip: "argumenty wersu wci\u0119tego: od 2 do 6"
714 model: toolbar.button
721 params: '{"tag": "wers_cd"}'
722 scriptlet: insert_tag
724 tooltip: "cz\u0119\u015B\u0107 wersu przeniesiona do innego wiersza"
725 model: toolbar.button
730 label: wers do prawej
732 params: '{"tag": "wers_do_prawej"}'
733 scriptlet: insert_tag
735 tooltip: "wers wyr\xf3wnany do prawej"
736 model: toolbar.button
744 scriptlet: insert_tag
747 model: toolbar.button
755 scriptlet: insert_tag
756 slug: htmleditor-print
758 model: toolbar.button
763 label: "zamiana cudzys\u0142ow\xF3w 1"
765 params: '{"exprs": [["\u00ab|\u201e", ",,"], ["\u00bb", "\""], ["([^=])\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])",
766 "$1,,$2"], ["^\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])",
767 ",,$1"], ["(,,)\\s+|\\s+(\")", "$1"]]}'
768 scriptlet: lineregexp
769 slug: cudzyslow-francuski
770 tooltip: "zamiana \" na ,, oraz \xABa\xBB na ,,a\""
771 model: toolbar.button
776 label: "wers wci\u0119ty"
778 params: '{"tag": "wers_wciety", "attrs": {"typ": "1"}}'
779 scriptlet: insert_tag
781 tooltip: "wstawia wers wci\u0119ty"
782 model: toolbar.button
787 label: "tytu\u0142 dzie\u0142a"
789 params: '{"tag": "tytul_dziela"}'
790 scriptlet: insert_tag
793 model: toolbar.button
798 label: "lista os\xF3b"
800 params: '{"padding_top": 1, "padding_bottom": 4, "tag": "lista_osob"}'
801 scriptlet: insert_tag
803 tooltip: "lista os\xF3b poprzedzaj\u0105ca tekst dramatu"
804 model: toolbar.button
809 label: "nag\u0142\xF3wek listy"
811 params: '{"padding_top": 1, "padding_bottom": 2, "tag": "naglowek_listy"}'
812 scriptlet: insert_tag
814 tooltip: "nag\u0142\xF3wek listy os\xF3b"
815 model: toolbar.button
820 label: osoba na liscie
822 params: '{"padding_top": 1, "padding_bottom": 1, "tag": "lista_osoba"}'
823 scriptlet: insert_tag
824 slug: osoba-na-liscie
825 tooltip: "nazwa osoby na liscie os\xF3b"
826 model: toolbar.button
833 params: '{"tag": "extra"}'
834 scriptlet: insert_tag
836 tooltip: "uwagi dotycz\u0105ce sk\u0142adu"
837 model: toolbar.button
844 params: '{"tag": "akap"}'
847 tooltip: "autotagowanie akapit\xF3w"
848 model: toolbar.button
855 params: '{"tag": "strofa"}'
858 tooltip: autotagowanie strof
859 model: toolbar.button
864 label: "wersy wci\u0119te"
866 params: '{"padding": 1, "tag": "wers_wciety", "split": 1}'
869 tooltip: "autotagowanie wers\xF3w wci\u0119tych"
870 model: toolbar.button
877 params: '[["insert_tag", {"tag": "akap"}], ["insert_tag", {"padding_top":
878 1, "padding_bottom": 1, "tag": "kwestia"}]]'
882 model: toolbar.button
889 params: '[["insert_stanza", {"tag": "strofa"}], ["insert_tag", {"padding_top":
890 1, "padding_bottom": 1, "tag": "kwestia"}]]'
894 model: toolbar.button
899 label: "nag\u0142. dramatu"
901 params: '{"exprs": [["^AKT(\\s\\w*)$", "<naglowek_akt>AKT$1</naglowek_akt>"],
902 ["^SCENA(\\s\\w*)$", "<naglowek_scena>SCENA$1</naglowek_scena>"], ["([A-Z\u0104\u0106\u0118\u0141\u0143\u00d3\u015a\u017b\u0179]{2}[A-Z\u0104\u0106\u0118\u0141\u0143\u00d3\u015a\u017b\u0179\\s]+)$",
903 "<naglowek_osoba>$1</naglowek_osoba>"]]}'
904 scriptlet: lineregexp
906 tooltip: "autotagowanie akt\xF3w, scen, nag\u0142\xF3wk\xF3w os\xF3b"
907 model: toolbar.button
914 params: '{"padding_top": 1, "padding_bottom": 3, "tag": "nota_red"}'
915 scriptlet: insert_tag
917 tooltip: nota redakcyjna
918 model: toolbar.button
928 tooltip: slugifikacja
929 model: toolbar.button
936 params: '{"text": "\n<!-- TRIM_BEGIN -->\n"}'
937 scriptlet: insert_text
939 tooltip: "Wstawia pocz\u0105tkowy znacznik ci\u0119cia cz\u0119\u015Bci"
940 model: toolbar.button
947 params: '{"text": "\n<!-- TRIM_END -->\n"}'
948 scriptlet: insert_text
950 tooltip: "Wstawia ko\u0144cowy znacznik ci\u0119cia cz\u0119\u015Bci"
951 model: toolbar.button
958 params: '{"tag": "developmentStage"}'
959 scriptlet: insert_tag
961 tooltip: "wymaga uwsp\xF3\u0142czesnienia: 0.3"
962 model: toolbar.button
964 - fields: {code: '-'}
965 model: toolbar.scriptlet
967 - fields: {code: "editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...',\
968 \ '', -1);\n$.log(editor, panel, params);\nvar cm = panel.texteditor;\n\
969 var exprs = $.map(params.exprs, function(expr) {\n var opts = \"mg\"\
970 ;\n if(expr.length > 2)\n opts = expr[2];\n\n return {rx:\
971 \ new RegExp(expr[0], opts), repl: expr[1]};\n});\n\nvar partial = true;\n\
972 var text = cm.selection();\n\nif(!text) {\n var cpos = cm.cursorPosition();\n\
973 \ cpos.line = cm.lineNumber(cpos.line)\n cm.selectLines(cm.firstLine(),\
974 \ 0, cm.lastLine(), 0);\n\n text = cm.selection();\n partial = false;\n\
975 }\n\nvar original = text;\n$(exprs).each(function() { \n text = text.replace(this.rx,\
976 \ this.repl);\n});\n\nif( original != text) \n{ \n cm.replaceSelection(text);\n\
977 \ panel.fireEvent('contentChanged');\n editor.showPopup('generic-yes',\
978 \ 'Zmieniono tekst' );\n editor.advancePopupQueue();\n}\nelse {\n \
979 \ editor.showPopup('generic-info', 'Brak zmian w tek\u015Bcie.');\n\
980 \ editor.advancePopupQueue();\n}\n\nif(!partial) {\n cm.selectLines(\
981 \ cm.nthLine(cpos.line), cpos.character );\n}"}
982 model: toolbar.scriptlet
984 - fields: {code: "var texteditor = panel.texteditor;\r\nvar text = texteditor.selection();\r\
985 \n\r\nif(text) {\r\n var verses = text.split('\\n');\r\n var text =\
986 \ ''; var buf = ''; var ebuf = '';\r\n var first = true;\r\n\r\n for(var\
987 \ i=0; i < verses.length; i++) {\r\n verse = verses[i].replace(/^\\\
988 s+/, \"\").replace(/\\s+$/, \"\"); \r\n if(verse) {\r\n text\
989 \ += (buf ? buf + '/\\n' : '') + ebuf;\r\n buf = (first ? '<strofa>\\\
990 n' : '') + verses[i];\r\n ebuf = '';\r\n first = false;\r\n\
991 \ } else { \r\n ebuf += '\\n' + verses[i];\r\n }\r\n };\r\
992 \n text = text + buf + '\\n</strofa>' + ebuf; \r\n texteditor.replaceSelection(text);\r\
993 \n}\r\n\r\nif (!text) {\r\n var pos = texteditor.cursorPosition();\r\
994 \n texteditor.selectLines(pos.line, pos.character + 6 + 2);\r\n}\r\n\
995 \r\n\r\n\r\n\r\n\r\n\r\n\r\npanel.fireEvent('contentChanged');"}
996 model: toolbar.scriptlet
998 - fields: {code: "var texteditor = panel.texteditor;\nvar text = texteditor.selection();\n\
999 var start_tag = '<'+params.tag;\nfor (var attr in params.attrs) {\n \
1000 \ start_tag += ' '+attr+'=\"' + params.attrs[attr] + '\"';\n};\nstart_tag\
1001 \ += '>';\nvar end_tag = '</'+params.tag+'>';\n\nif(text.length > 0) {\n\
1002 // tokenize\nvar output = ''\nvar token = ''\nfor(var index=0; index <\
1003 \ text.length; index++)\n{\n if (text[index].match(/\\s/)) { // whitespace\n\
1004 \ token += text[index];\n }\n else { // character\n \
1005 \ output += token;\n if(output == token) output += start_tag;\n\
1006 \ token = ''\n output += text[index];\n }\n}\n\nif( output[output.length-1]\
1007 \ == '\\\\' ) {\n output = output.substr(0, output.length-1) + end_tag\
1008 \ + '\\\\';\n} else {\n output += end_tag;\n}\noutput += token;\n}\n\
1009 else {\n output = start_tag + end_tag;\n}\n\ntexteditor.replaceSelection(output);\n\
1010 \nif (text.length == 0) {\n var pos = texteditor.cursorPosition();\n\
1011 \ texteditor.selectLines(pos.line, pos.character + params.tag.length\
1012 \ + 2);\n}\n\npanel.fireEvent('contentChanged');"}
1013 model: toolbar.scriptlet
1015 - fields: {code: '-'}
1016 model: toolbar.scriptlet
1018 - fields: {code: "editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...',\
1019 \ '', -1);\n\nvar cm = panel.texteditor;\nvar exprs = $.map(params.exprs,\
1020 \ function(expr) {\n\n var opts = \"g\";\n\n if(expr.length > 2)\n\
1021 \n opts = expr[2];\n\n return {rx: new RegExp(expr[0], opts),\
1022 \ repl: expr[1]};\n\n});\n\n\n\nvar partial = true;\n\nvar text = cm.selection();\n\
1023 \n\n\nif(!text) {\n\n var cpos = cm.cursorPosition();\n\n cpos.line\
1024 \ = cm.lineNumber(cpos.line)\n\n cm.selectLines(cm.firstLine(), 0,\
1025 \ cm.lastLine(), 0);\n\n text = cm.selection();\n\n partial = false;\n\
1026 \n}\n\n\n\nvar changed = 0;\nvar lines = text.split('\\n');\nvar lines\
1027 \ = $.map(lines, function(line) { \n var old_line = line;\n $(exprs).each(function()\
1028 \ { \n var expr = this;\n line = line.replace(expr.rx, expr.repl);\n\
1029 \ });\n\n if(old_line != line) changed += 1;\n return line;\n\
1030 });\n\nif(changed > 0) \n{\n cm.replaceSelection( lines.join('\\n')\
1031 \ );\n panel.fireEvent('contentChanged');\n editor.showPopup('generic-yes',\
1032 \ 'Zmieniono ' + changed + ' linii.', 1500);\n editor.advancePopupQueue();\n\
1033 }\nelse {\n editor.showPopup('generic-info', 'Brak zmian w tek\u015B\
1034 cie', 1500);\n editor.advancePopupQueue();\n}\n\nif(!partial)\n \
1035 \ cm.selectLines( cm.nthLine(cpos.line), cpos.character )"}
1036 model: toolbar.scriptlet
1038 - fields: {code: "var cm = panel.texteditor;\r\nvar text = cm.selection();\r\n\r\
1039 \nif(!text) return;\r\nvar repl = '';\r\nvar lcase = text.toLowerCase();\r\
1040 \nvar ucase = text.toUpperCase();\r\n\r\nif(lcase == text) repl = ucase;\
1041 \ /* was lowercase */\r\nelse if(ucase != text) repl = lcase; /* neither\
1042 \ lower- or upper-case */\r\nelse { /* upper case -> title-case */\r\n\
1043 \ var words = $(lcase.split(/\\s/)).map(function() { \r\n if(this.length\
1044 \ > 0) { return this[0].toUpperCase() + this.slice(1); } else { return\
1045 \ ''}\r\n }); \r\n repl = words.join(' ');\r\n} \r\n\r\nif(repl !=\
1046 \ text) {\r\n cm.replaceSelection(repl);\r\n panel.fireEvent('contentChanged');\r\
1048 model: toolbar.scriptlet
1050 - fields: {code: "$(params).each(function() {\n $.log(this[0], this[1]);\n \
1051 \ editor.callScriptlet(this[0], panel, this[1]);\n\n});"}
1052 model: toolbar.scriptlet
1054 - fields: {code: '-'}
1055 model: toolbar.scriptlet