4 "model": "toolbar.buttongroup",
13 "model": "toolbar.buttongroup",
16 "name": "Autokorekta",
22 "model": "toolbar.buttongroup",
25 "name": "Autotagowanie",
26 "slug": "autotagowanie"
31 "model": "toolbar.buttongroup",
34 "name": "Elementy pocz\u0105tkowe",
35 "slug": "elementy-poczatkowe"
40 "model": "toolbar.buttongroup",
49 "model": "toolbar.buttongroup",
58 "model": "toolbar.buttongroup",
61 "name": "Nag\u0142\u00f3wki",
67 "model": "toolbar.buttongroup",
70 "name": "Style znakowe",
71 "slug": "style-znakowe"
76 "model": "toolbar.buttongroup",
85 "model": "toolbar.button",
90 "scriptlet": "insert_tag",
92 "tooltip": "wstawia akapit",
95 "params": "{\"padding_top\": 1, \"padding_bottom\": 3, \"tag\": \"akap\"}",
101 "model": "toolbar.button",
106 "scriptlet": "autotag",
108 "tooltip": "autotagowanie akapit\u00f3w",
111 "params": "{\"tag\": \"akap\"}",
117 "model": "toolbar.button",
122 "scriptlet": "insert_tag",
125 "label": "aktywno\u015b\u0107",
127 "params": "{\"tag\": \"aktywnosc\"}",
133 "model": "toolbar.button",
138 "scriptlet": "insert_tag",
143 "params": "{\"padding_top\": 1, \"padding_bottom\": 2, \"tag\": \"autor_utworu\"}",
149 "model": "toolbar.button",
154 "scriptlet": "macro",
156 "tooltip": "Wykonuj\u0119 podstawow\u0105 korekt\u0119 tekstu.",
157 "label": "Podstawowa",
159 "params": "[[\"fulltextregexp\", {\"exprs\": [[\"\\ufeff\", \"\"], [\"$[\\\\s]*\\\\d+[\\\\s]*^\", \"\"], [\"-\\\\s*^\", \"\"], [\"\\\\,\\\\.\\\\.|\\\\.\\\\,\\\\.|\\\\.\\\\.\\\\,\", \"...\"], [\"<(/?)P([aert])\", \"<$1p$2\"], [\"[\\u2014\\u2013\\u2010-]{2,}|[\\u2014\\u2013\\u2010]+\", \"---\"], [\"(\\\\s)-([^-])\", \"$1---$2\"], [\"([^-])-(\\\\s)\", \"$1---$2\"], [\"(\\\\d)-+(\\\\d)\", \"$1--$2\"], [\"---(\\\\S)\", \"--- $1\"], [\"(\\\\S)---\", \"$1 ---\"], [\"<akap_dialog>\\\\s*-+\\\\s*\", \"<akap_dialog>--- \"]]}], [\"lineregexp\", {\"exprs\": [[\"^\\\\s+|\\\\s+$\", \"\"], [\"\\\\s+\", \" \"], [\"(,,)\\\\s+\", \"$1\"], [\"\\\\s+(\\\")\", \"$1\"], [\"([^\\\\.])(\\\\s*)</p\", \"$1.$2</p\"], [\"([\\\\.:;!\\\\?])([^\\\\s\\\\\\\\])\", \"$1 $2\"], [\"([^\\\\s])\\\\s+([\\\\.:;!\\\\?])\", \"$1$2\"], [\"\\\\s+,([^,])\", \",$1\"], [\"([^,]),([^\\\\s\\\\\\\\,])\", \"$1, $2\"]]}]]",
160 "slug": "basic_correction"
165 "model": "toolbar.button",
170 "scriptlet": "lineregexp",
172 "tooltip": "zamiana \" na ,, oraz \u00aba\u00bb na ,,a\"",
173 "label": "zamiana cudzys\u0142ow\u00f3w 1",
175 "params": "{\"exprs\": [[\"\\u00ab|\\u201e\", \",,\"], [\"\\u00bb\", \"\\\"\"], [\"([^=])\\\"([\\u0104\\u0118\\u00d3\\u0141\\u017b\\u0179\\u0106\\u0143\\u0105\\u017c\\u017a\\u015b\\u0144\\u00f3\\u0142\\u0107\\\\w])\", \"$1,,$2\"], [\"^\\\"([\\u0104\\u0118\\u00d3\\u0141\\u017b\\u0179\\u0106\\u0143\\u0105\\u017c\\u017a\\u015b\\u0144\\u00f3\\u0142\\u0107\\\\w])\", \",,$1\"], [\"(,,)\\\\s+|\\\\s+(\\\")\", \"$1\"]]}",
176 "slug": "cudzyslow-francuski"
181 "model": "toolbar.button",
186 "scriptlet": "lineregexp",
188 "tooltip": "zamienia \" na ,, oraz \u00bba\u00ab na ,,a\"",
189 "label": "zamiana cudzys\u0142ow\u00f3w 2",
191 "params": "{\"exprs\": [[\"\\u00bb|\\u201e\", \",,\"], [\"\\u00ab\", \"\\\"\"], [\"([^=])\\\"([\\u0104\\u0118\\u00d3\\u0141\\u017b\\u0179\\u0106\\u0143\\u0105\\u017c\\u017a\\u015b\\u0144\\u00f3\\u0142\\u0107\\\\w])\", \"$1,,$2\"], [\"^\\\"([\\u0104\\u0118\\u00d3\\u0141\\u017b\\u0179\\u0106\\u0143\\u0105\\u017c\\u017a\\u015b\\u0144\\u00f3\\u0142\\u0107\\\\w])\", \",,$1\"], [\"(,,)\\\\s+|\\\\s+(\\\")\", \"$1\"]]}",
192 "slug": "cudzyslow-niemiecki"
197 "model": "toolbar.button",
202 "scriptlet": "insert_tag",
205 "label": "\u0107wiczenie",
207 "params": "{\"tag\": \"cwiczenie\"}",
213 "model": "toolbar.button",
218 "scriptlet": "insert_tag",
221 "label": "\u0107wiczenie typ",
223 "params": "{\"tag\": \"cwiczenie\", \"attrs\": {\"typ\": \"\"}}",
224 "slug": "cwiczenie-typ"
229 "model": "toolbar.button",
234 "scriptlet": "insert_tag",
239 "params": "{\"tag\": \"czas\"}",
245 "model": "toolbar.button",
250 "scriptlet": "insert_tag",
253 "label": "cz\u0119\u015b\u0107/ksi\u0119ga",
255 "params": "{\"padding_top\": 1, \"padding_bottom\": 4, \"tag\": \"naglowek_czesc\"}",
261 "model": "toolbar.button",
266 "scriptlet": "insert_tag",
269 "label": "definiendum",
271 "params": "{\"tag\": \"definiendum\"}",
272 "slug": "definiendum"
277 "model": "toolbar.button",
282 "scriptlet": "insert_tag",
285 "label": "definiens",
287 "params": "{\"tag\": \"definiens\"}",
293 "model": "toolbar.button",
298 "scriptlet": "insert_tag",
303 "params": "{\"tag\": \"forma\"}",
309 "model": "toolbar.button",
312 "scriptlet": "insert_tag",
316 "link": "print/html",
318 "slug": "htmleditor-print"
323 "model": "toolbar.button",
328 "scriptlet": "insert_tag",
331 "label": "link slug",
333 "params": "{\"tag\": \"link\", \"attrs\": {\"slug\": \"\"}}",
339 "model": "toolbar.button",
344 "scriptlet": "insert_tag",
349 "params": "{\"tag\": \"link\", \"attrs\": {\"url\": \"\"}}",
355 "model": "toolbar.button",
360 "scriptlet": "insert_tag",
365 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"\"}}",
371 "model": "toolbar.button",
376 "scriptlet": "insert_tag",
379 "label": "lista alfa",
381 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"alfa\"}}",
387 "model": "toolbar.button",
392 "scriptlet": "insert_tag",
395 "label": "lista czytelnia",
397 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"czytelnia\"}}",
398 "slug": "lista-czytelnia"
403 "model": "toolbar.button",
408 "scriptlet": "insert_tag",
411 "label": "lista num",
413 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"num\"}}",
419 "model": "toolbar.button",
424 "scriptlet": "insert_tag",
427 "label": "lista punkt",
429 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"punkt\"}}",
430 "slug": "lista-punkt"
435 "model": "toolbar.button",
440 "scriptlet": "insert_tag",
443 "label": "lista s\u0142owniczek",
445 "params": "{\"tag\": \"lista\", \"attrs\": {\"typ\": \"slowniczek\"}}",
446 "slug": "lista-slowniczek"
451 "model": "toolbar.button",
456 "scriptlet": "insert_tag",
459 "label": "nazwa utworu",
461 "params": "{\"padding_top\": 1, \"padding_bottom\": 2, \"tag\": \"nazwa_utworu\"}",
462 "slug": "nazwa-utworu"
467 "model": "toolbar.button",
472 "scriptlet": "insert_tag",
477 "params": "{\"tag\": \"nota\"}",
483 "model": "toolbar.button",
488 "scriptlet": "autotag",
493 "params": "{\"tag\": \"opis\"}",
499 "model": "toolbar.button",
504 "scriptlet": "insert_tag",
507 "label": "podrozdzia\u0142",
509 "params": "{\"tag\": \"naglowek_podrozdzial\"}",
510 "slug": "podrozdzial"
515 "model": "toolbar.button",
520 "scriptlet": "insert_tag",
523 "label": "podtytu\u0142",
525 "params": "{\"tag\": \"podtytul\"}",
531 "model": "toolbar.button",
536 "scriptlet": "insert_tag",
541 "params": "{\"tag\": \"pomoce\"}",
547 "model": "toolbar.button",
552 "scriptlet": "insert_tag",
555 "label": "powie\u015b\u0107",
557 "params": "{\"padding_top\": 1, \"padding_bottom\": 4, \"tag\": \"powiesc\"}",
563 "model": "toolbar.button",
566 "scriptlet": "insert_tag",
577 "model": "toolbar.button",
582 "scriptlet": "insert_tag",
585 "label": "punkt na li\u015bcie",
587 "params": "{\"tag\": \"punkt\"}",
588 "slug": "punkt-na-liscie"
593 "model": "toolbar.button",
598 "scriptlet": "insert_tag",
601 "label": "punkt warto\u015b\u0107",
603 "params": "{\"tag\": \"punkt\", \"attrs\": {\"wartosc\": \"\"}}",
604 "slug": "punkt-wartosc"
609 "model": "toolbar.button",
614 "scriptlet": "autotag",
617 "label": "punkty na li\u015bcie",
619 "params": "{\"tag\": \"punkt\"}",
620 "slug": "punkty-na-liscie"
625 "model": "toolbar.button",
630 "scriptlet": "insert_tag",
633 "label": "rozdzia\u0142",
635 "params": "{\"padding_top\": 1, \"padding_bottom\": 4, \"tag\": \"naglowek_rozdzial\"}",
641 "model": "toolbar.button",
646 "scriptlet": "insert_tag",
648 "tooltip": "frazy w j\u0119zykach innych ni\u017c polski/definiendum w przypisie",
649 "label": "s\u0142owo obce",
651 "params": "{\"tag\": \"slowo_obce\"}",
657 "model": "toolbar.button",
662 "scriptlet": "slugify",
664 "tooltip": "slugifikacja",
673 "model": "toolbar.button",
678 "scriptlet": "insert_tag",
681 "label": "\u015br\u00f3dtytu\u0142",
683 "params": "{\"tag\": \"srodtytul\"}",
689 "model": "toolbar.button",
694 "scriptlet": "insert_tag",
697 "label": "tag g\u0142\u00f3wny",
699 "params": "{\"tag\": \"utwor\"}",
705 "model": "toolbar.button",
710 "scriptlet": "lowercase",
712 "tooltip": "Zamie\u0144 wielkie litery na ma\u0142e",
713 "label": "A<sup>\u2193</sup>",
716 "slug": "tolowercase"
721 "model": "toolbar.button",
726 "scriptlet": "autotag",
731 "params": "{\"tag\": \"typ\", \"attrs\": {\"kod\": \"\"}}",
737 "model": "toolbar.button",
742 "scriptlet": "insert_tag",
745 "label": "tytu\u0142 dzie\u0142a",
747 "params": "{\"tag\": \"tytul_dziela\"}",
748 "slug": "tytul-dziela"
753 "model": "toolbar.button",
758 "scriptlet": "insert_tag",
760 "tooltip": "tytu\u0142 dzie\u0142a w cytowanym tytule dzie\u0142a",
761 "label": "tytu\u0142 dzie\u0142a typ 1",
763 "params": "{\"tag\": \"tytul_dziela\", \"attrs\": {\"typ\": \"1\"}}",
764 "slug": "tytul-dziela-typ"
769 "model": "toolbar.button",
774 "scriptlet": "insert_tag",
776 "tooltip": "uwagi redaktorsko-korektorskie ",
779 "params": "{\"tag\": \"uwaga\"}",
785 "model": "toolbar.button",
790 "scriptlet": "insert_tag",
793 "label": "wskaz\u00f3wki",
795 "params": "{\"tag\": \"wskazowki\"}",
801 "model": "toolbar.button",
806 "scriptlet": "insert_tag",
811 "params": "{\"tag\": \"www\"}",
817 "model": "toolbar.button",
822 "scriptlet": "insert_tag",
824 "tooltip": "wyr\u00f3\u017cnienie autorskie",
825 "label": "wyr\u00f3\u017cnienie",
827 "params": "{\"tag\": \"wyroznienie\"}",
828 "slug": "wyroznienie"
833 "model": "toolbar.scriptlet",
835 "code": "$(params).each(function() {\n $.log(this[0], this[1]);\n editor.callScriptlet(this[0], panel, this[1]);\n\n});"
840 "model": "toolbar.scriptlet",
842 "code": "var texteditor = panel.texteditor;\nvar text = texteditor.selection();\nvar start_tag = '<'+params.tag;\nfor (var attr in params.attrs) {\n start_tag += ' '+attr+'=\"' + params.attrs[attr] + '\"';\n};\nstart_tag += '>';\nvar end_tag = '</'+params.tag+'>';\n\nif(text.length > 0) {\n// tokenize\nvar output = ''\nvar token = ''\nfor(var index=0; index < text.length; index++)\n{\n if (text[index].match(/\\s/)) { // whitespace\n token += text[index];\n }\n else { // character\n output += token;\n if(output == token) output += start_tag;\n token = ''\n output += text[index];\n }\n}\n\nif( output[output.length-1] == '\\\\' ) {\n output = output.substr(0, output.length-1) + end_tag + '\\\\';\n} else {\n output += end_tag;\n}\noutput += token;\n}\nelse {\n output = start_tag + end_tag;\n}\n\ntexteditor.replaceSelection(output);\n\nif (text.length == 0) {\n var pos = texteditor.cursorPosition();\n texteditor.selectLines(pos.line, pos.character + params.tag.length + 2);\n}\n\npanel.fireEvent('contentChanged');"
847 "model": "toolbar.scriptlet",
849 "code": "editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);\n\nvar cm = panel.texteditor;\nvar exprs = $.map(params.exprs, function(expr) {\n\n var opts = \"g\";\n\n if(expr.length > 2)\n\n opts = expr[2];\n\n return {rx: new RegExp(expr[0], opts), repl: expr[1]};\n\n});\n\n\n\nvar partial = true;\n\nvar text = cm.selection();\n\n\n\nif(!text) {\n\n var cpos = cm.cursorPosition();\n\n cpos.line = cm.lineNumber(cpos.line)\n\n cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);\n\n text = cm.selection();\n\n partial = false;\n\n}\n\n\n\nvar changed = 0;\nvar lines = text.split('\\n');\nvar lines = $.map(lines, function(line) { \n var old_line = line;\n $(exprs).each(function() { \n var expr = this;\n line = line.replace(expr.rx, expr.repl);\n });\n\n if(old_line != line) changed += 1;\n return line;\n});\n\nif(changed > 0) \n{\n cm.replaceSelection( lines.join('\\n') );\n panel.fireEvent('contentChanged');\n editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500);\n editor.advancePopupQueue();\n}\nelse {\n editor.showPopup('generic-info', 'Brak zmian w tek\u015bcie', 1500);\n editor.advancePopupQueue();\n}\n\nif(!partial)\n cm.selectLines( cm.nthLine(cpos.line), cpos.character )"
854 "model": "toolbar.scriptlet",
860 "pk": "fulltextregexp",
861 "model": "toolbar.scriptlet",
863 "code": "editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);\n$.log(editor, panel, params);\nvar cm = panel.texteditor;\nvar exprs = $.map(params.exprs, function(expr) {\n var opts = \"mg\";\n if(expr.length > 2)\n opts = expr[2];\n\n return {rx: new RegExp(expr[0], opts), repl: expr[1]};\n});\n\nvar partial = true;\nvar text = cm.selection();\n\nif(!text) {\n var cpos = cm.cursorPosition();\n cpos.line = cm.lineNumber(cpos.line)\n cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);\n\n text = cm.selection();\n partial = false;\n}\n\nvar original = text;\n$(exprs).each(function() { \n text = text.replace(this.rx, this.repl);\n});\n\nif( original != text) \n{ \n cm.replaceSelection(text);\n panel.fireEvent('contentChanged');\n editor.showPopup('generic-yes', 'Zmieniono tekst' );\n editor.advancePopupQueue();\n}\nelse {\n editor.showPopup('generic-info', 'Brak zmian w tek\u015bcie.');\n editor.advancePopupQueue();\n}\n\nif(!partial) {\n cm.selectLines( cm.nthLine(cpos.line), cpos.character );\n}"
868 "model": "toolbar.scriptlet",
875 "model": "toolbar.scriptlet",
877 "code": "var cm = panel.texteditor;\r\nvar text = cm.selection();\r\n\r\nif(!text) return;\r\nvar repl = '';\r\nvar lcase = text.toLowerCase();\r\nvar ucase = text.toUpperCase();\r\n\r\nif(lcase == text) repl = ucase; /* was lowercase */\r\nelse if(ucase != text) repl = lcase; /* neither lower- or upper-case */\r\nelse { /* upper case -> title-case */\r\n var words = $(lcase.split(/\\s/)).map(function() { \r\n if(this.length > 0) { return this[0].toUpperCase() + this.slice(1); } else { return ''}\r\n }); \r\n repl = words.join(' ');\r\n} \r\n\r\nif(repl != text) {\r\n cm.replaceSelection(repl);\r\n panel.fireEvent('contentChanged');\r\n};"
881 "pk": "insert_stanza",
882 "model": "toolbar.scriptlet",
884 "code": "var texteditor = panel.texteditor;\r\nvar text = texteditor.selection();\r\n\r\nif(text) {\r\n var verses = text.split('\\n');\r\n var text = ''; var buf = ''; var ebuf = '';\r\n var first = true;\r\n\r\n for(var i=0; i < verses.length; i++) {\r\n verse = verses[i].replace(/^\\s+/, \"\").replace(/\\s+$/, \"\"); \r\n if(verse) {\r\n text += (buf ? buf + '/\\n' : '') + ebuf;\r\n buf = (first ? '<strofa>\\n' : '') + verses[i];\r\n ebuf = '';\r\n first = false;\r\n } else { \r\n ebuf += '\\n' + verses[i];\r\n }\r\n };\r\n text = text + buf + '\\n</strofa>' + ebuf; \r\n texteditor.replaceSelection(text);\r\n}\r\n\r\nif (!text) {\r\n var pos = texteditor.cursorPosition();\r\n texteditor.selectLines(pos.line, pos.character + 6 + 2);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\npanel.fireEvent('contentChanged');"
889 "model": "toolbar.scriptlet",