+ pk: autotag
+- fields: {code: "editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...',\
+ \ '', -1);\n$.log(editor, panel, params);\nvar cm = panel.texteditor;\n\
+ var 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;\n\
+ var 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}"}
+ model: toolbar.scriptlet
+ pk: fulltextregexp
+- 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 ? '<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');"}
+ model: toolbar.scriptlet
+ pk: insert_stanza