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\n\
\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('<' + params.tag\
\r
51 \ + '>' + text + '</' + params.tag + '>');\r\nif (text.length == 0) \r\n{\r\n\
\r
52 \ 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: \"g\"\
\r
57 ]}}\r\nvar cm = panel.texteditor;\r\n\r\nvar exprs = $.map(params.exprs, function(expr)\
\r
58 \ {\r\n var opts = \"g\";\r\n if(expr.length > 2)\r\n opts = expr[2];\r\
\r
59 \n return {rx: new RegExp(expr[0], opts), repl: expr[1]};\r\n});\r\n\r\n\
\r
60 var selection = cm.selection();\r\n\r\nif(selection) \r\n{\r\n var lines\
\r
61 \ = selection.split('\\n');\r\n lines = $.map(lines, function(line) { \r\n\
\r
62 \ $(exprs).each(function() { \r\n var expr = this;\r\n \
\r
63 \ line = line.replace(expr.rx, expr.repl);\r\n });\r\n \
\r
64 \ return line;\r\n });\r\n cm.replaceSelection( lines.join('\\n') );\r\
\r
65 \n}\r\nelse {\r\n var line = cm.firstLine();\r\n do {\r\n var content\
\r
66 \ = cm.lineContent(line);\r\n $.log(\"Swapping line: $\" + content +\
\r
67 \ \"$\");\r\n \r\n $(exprs).each(function() { var expr = this;\r\n\
\r
68 \ content = content.replace(expr.rx, expr.repl);\r\n });\r\
\r
69 \n cm.setLineContent(line, content);\r\n line = cm.nextLine(line);\r\
\r
70 \n } while( !(line === false) );\r\n}"}
\r
71 model: toolbar.scriptlet
\r