1 - fields: {name: Autokorekta, position: 0, slug: autokorekta}
\r
2 model: toolbar.buttongroup
\r
4 - fields: {name: Formatowanie, position: 0, slug: formatowanie}
\r
5 model: toolbar.buttongroup
\r
11 params: "({exprs: [\r\n [\"\\\\,\\\\.\\\\.|\\\\.\\\\,\\\\.|\\\\.\\\\.\\\\\
\r
12 ,\", \"...\"],\r\n [\"\u201E\", \",,\"] /* DOUBLE LOW-9 QUOTATION MARK\
\r
14 scriptlet: lineregexp
\r
16 tooltip: "Wykonuj\u0119 operacj\u0119 z novel-pages."
\r
17 model: toolbar.button
\r
22 label: "Usu\u0144 spacj\u0119"
\r
23 params: '({exprs: [ ["^\\s+|\\s+$", ""], ["\\s+", " "] ]})'
\r
24 scriptlet: lineregexp
\r
25 slug: strip_whitespace
\r
26 tooltip: "Usuwa zb\u0119dne spacj\u0119 z dokumentu."
\r
27 model: toolbar.button
\r
33 params: '({tag: ''wers''})'
\r
34 scriptlet: insert_tag
\r
36 tooltip: Otacza zaznaczony tekst tagiem 'wers'.
\r
37 model: toolbar.button
\r
42 label: "Zamie\u0144 dywiz"
\r
43 params: "({exprs:[ [\"\u2014\",\"---\"] ]})"
\r
44 scriptlet: lineregexp
\r
46 tooltip: "Zamienia '\u2014' na '---'."
\r
47 model: toolbar.button
\r
49 - fields: {code: "$.log(editor, panel, params);\r\n\r\nvar texteditor = panel.texteditor;\r\
\r
50 \nvar text = texteditor.selection();\r\ntexteditor.replaceSelection('<'\
\r
51 \ + params.tag + '>' + text + '</' + params.tag + '>');\r\nif (text.length\
\r
52 \ == 0) \r\n{\r\n var pos = texteditor.cursorPosition();\r\n texteditor.selectLines(pos.line,\
\r
53 \ pos.character + params.tag.length + 2);\r\n}\r\n\r\npanel.fireEvent('contentChanged');"}
\r
54 model: toolbar.scriptlet
\r
56 - fields: {code: "// params: {exprs: list of {expr: \"\", repl: \"\" [, opts: \"\
\r
57 g\"]}}\r\nvar cm = panel.texteditor;\r\n\r\nvar exprs = $.map(params.exprs,\
\r
58 \ function(expr) {\r\n var opts = \"g\";\r\n if(expr.length > 2)\r\
\r
59 \n opts = expr[2];\r\n return {rx: new RegExp(expr[0], opts),\
\r
60 \ repl: expr[1]};\r\n});\r\n\r\nvar selection = cm.selection();\r\n\r\n\
\r
61 if(selection) \r\n{\r\n var lines = selection.split('\\n');\r\n \
\r
62 \ lines = $.map(lines, function(line) { \r\n for each(var expr\
\r
63 \ in exprs) {\r\n line = line.replace(expr.rx, expr.repl);\r\
\r
64 \n };\r\n return line;\r\n });\r\n cm.replaceSelection(\
\r
65 \ lines.join('\\n') );\r\n}\r\nelse {\r\n var line = cm.firstLine();\r\
\r
66 \n do {\r\n var content = cm.lineContent(line);\r\n \r\n\
\r
67 \ for each(var expr in exprs) {\r\n content = content.replace(expr.rx,\
\r
68 \ expr.repl);\r\n };\r\n cm.setLineContent(line, content);\r\
\r
69 \n line = cm.nextLine(line);\r\n } while( !(line === false)\
\r
71 model: toolbar.scriptlet
\r