[
{
"pk": 14,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Akapity",
"slug": "akapity"
}
},
{
"pk": 2,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Autokorekta",
"slug": "autokorekta"
}
},
{
"pk": 28,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Autotagowanie",
"slug": "autotagowanie"
}
},
{
"pk": 13,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Elementy pocz\u0105tkowe",
"slug": "elementy-poczatkowe"
}
},
{
"pk": 30,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Listy",
"slug": "listy"
}
},
{
"pk": 11,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Mastery",
"slug": "mastery"
}
},
{
"pk": 1,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Nag\u0142\u00f3wki",
"slug": "naglowki"
}
},
{
"pk": 15,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Style znakowe",
"slug": "style-znakowe"
}
},
{
"pk": 29,
"model": "toolbar.buttongroup",
"fields": {
"position": 0,
"name": "Uwaga",
"slug": "uwaga"
}
},
{
"pk": 39,
"model": "toolbar.button",
"fields": {
"group": [
14
],
"scriptlet": "insert_tag",
"accesskey": "a",
"tooltip": "wstawia akapit",
"label": "akapit",
"link": "",
"params": "{\"padding_top\": 1, \"padding_bottom\": 3, \"tag\": \"akap\"}",
"slug": "akapit"
}
},
{
"pk": 97,
"model": "toolbar.button",
"fields": {
"group": [
28
],
"scriptlet": "autotag",
"accesskey": "",
"tooltip": "autotagowanie akapit\u00f3w",
"label": "akapity",
"link": "",
"params": "{\"tag\": \"akap\"}",
"slug": "akapity"
}
},
{
"pk": 109,
"model": "toolbar.button",
"fields": {
"group": [
14
],
"scriptlet": "insert_tag",
"accesskey": "z",
"tooltip": "",
"label": "aktywno\u015b\u0107",
"link": "",
"params": "{\"tag\": \"aktywnosc\"}",
"slug": "aktywnosc"
}
},
{
"pk": 32,
"model": "toolbar.button",
"fields": {
"group": [
13
],
"scriptlet": "insert_tag",
"accesskey": "",
"tooltip": "",
"label": "autor",
"link": "",
"params": "{\"padding_top\": 1, \"padding_bottom\": 2, \"tag\": \"autor_utworu\"}",
"slug": "autor"
}
},
{
"pk": 4,
"model": "toolbar.button",
"fields": {
"group": [
2
],
"scriptlet": "macro",
"accesskey": "",
"tooltip": "Wykonuj\u0119 podstawow\u0105 korekt\u0119 tekstu.",
"label": "Podstawowa",
"link": "",
"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 ---\"], [\"\\\\s*-+\\\\s*\", \"--- \"]]}], [\"lineregexp\", {\"exprs\": [[\"^\\\\s+|\\\\s+$\", \"\"], [\"\\\\s+\", \" \"], [\"(,,)\\\\s+\", \"$1\"], [\"\\\\s+(\\\")\", \"$1\"], [\"([^\\\\.])(\\\\s*)
\u2193",
"link": "",
"params": "[]",
"slug": "tolowercase"
}
},
{
"pk": 129,
"model": "toolbar.button",
"fields": {
"group": [
28
],
"scriptlet": "autotag",
"accesskey": "",
"tooltip": "",
"label": "typ kod",
"link": "",
"params": "{\"tag\": \"typ\", \"attrs\": {\"kod\": \"\"}}",
"slug": "typ-kod"
}
},
{
"pk": 92,
"model": "toolbar.button",
"fields": {
"group": [
15
],
"scriptlet": "insert_tag",
"accesskey": "r",
"tooltip": "",
"label": "tytu\u0142 dzie\u0142a",
"link": "",
"params": "{\"tag\": \"tytul_dziela\"}",
"slug": "tytul-dziela"
}
},
{
"pk": 45,
"model": "toolbar.button",
"fields": {
"group": [
15
],
"scriptlet": "insert_tag",
"accesskey": "",
"tooltip": "tytu\u0142 dzie\u0142a w cytowanym tytule dzie\u0142a",
"label": "tytu\u0142 dzie\u0142a typ 1",
"link": "",
"params": "{\"tag\": \"tytul_dziela\", \"attrs\": {\"typ\": \"1\"}}",
"slug": "tytul-dziela-typ"
}
},
{
"pk": 51,
"model": "toolbar.button",
"fields": {
"group": [
29
],
"scriptlet": "insert_tag",
"accesskey": "",
"tooltip": "uwagi redaktorsko-korektorskie ",
"label": "uwaga",
"link": "",
"params": "{\"tag\": \"uwaga\"}",
"slug": "uwaga"
}
},
{
"pk": 112,
"model": "toolbar.button",
"fields": {
"group": [
14
],
"scriptlet": "insert_tag",
"accesskey": "d",
"tooltip": "",
"label": "wskaz\u00f3wki",
"link": "",
"params": "{\"tag\": \"wskazowki\"}",
"slug": "wskazowki"
}
},
{
"pk": 48,
"model": "toolbar.button",
"fields": {
"group": [
15
],
"scriptlet": "insert_tag",
"accesskey": "",
"tooltip": "",
"label": "www",
"link": "",
"params": "{\"tag\": \"www\"}",
"slug": "www"
}
},
{
"pk": 44,
"model": "toolbar.button",
"fields": {
"group": [
15
],
"scriptlet": "insert_tag",
"accesskey": "f",
"tooltip": "wyr\u00f3\u017cnienie autorskie",
"label": "wyr\u00f3\u017cnienie",
"link": "",
"params": "{\"tag\": \"wyroznienie\"}",
"slug": "wyroznienie"
}
},
{
"pk": "macro",
"model": "toolbar.scriptlet",
"fields": {
"code": "$(params).each(function() {\n $.log(this[0], this[1]);\n editor.callScriptlet(this[0], panel, this[1]);\n\n});"
}
},
{
"pk": "insert_tag",
"model": "toolbar.scriptlet",
"fields": {
"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');"
}
},
{
"pk": "lineregexp",
"model": "toolbar.scriptlet",
"fields": {
"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 )"
}
},
{
"pk": "autotag",
"model": "toolbar.scriptlet",
"fields": {
"code": "-"
}
},
{
"pk": "fulltextregexp",
"model": "toolbar.scriptlet",
"fields": {
"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}"
}
},
{
"pk": "insert_text",
"model": "toolbar.scriptlet",
"fields": {
"code": "-"
}
},
{
"pk": "lowercase",
"model": "toolbar.scriptlet",
"fields": {
"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};"
}
},
{
"pk": "insert_stanza",
"model": "toolbar.scriptlet",
"fields": {
"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 ? '\\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' + 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');"
}
},
{
"pk": "slugify",
"model": "toolbar.scriptlet",
"fields": {
"code": "-"
}
}
]