tooltip: "wstawia kwesti\u0119"
model: toolbar.button
pk: 82
+- fields:
+ accesskey: ''
+ group: [12]
+ label: kwestioakapit
+ link: ''
+ params: '[["insert_tag", {"tag": "akap"}], ["insert_tag", {"tag": "kwestia"}]]'
+ scriptlet: macro
+ slug: kwestioakapit
+ tooltip: ''
+ model: toolbar.button
+ pk: 101
+- fields:
+ accesskey: ''
+ group: [12]
+ label: kwestiostrofa
+ link: ''
+ params: '[["insert_stanza", {"tag": "strofa"}], ["insert_tag", {"tag": "kwestia"}]]'
+ scriptlet: macro
+ slug: kwestiostrofa
+ tooltip: ''
+ model: toolbar.button
+ pk: 102
- fields:
accesskey: ''
group: [11]
tooltip: "Zamienia cudzys\u0142owy podw\xF3jne na niemieckie"
model: toolbar.button
pk: 3
+- fields:
+ accesskey: ''
+ group: [28]
+ label: "nag\u0142. dramatu"
+ link: ''
+ params: '{"exprs": [["^AKT(\\s\\w*)$", "<naglowek_akt>AKT$1</naglowek_akt>"],
+ ["^SCENA(\\s\\w*)$", "<naglowek_scena>SCENA$1</naglowek_scena>"], ["([A-Z\u0104\u0106\u0118\u0141\u0143\u00d3\u015a\u017b\u0179]{2}[A-Z\u0104\u0106\u0118\u0141\u0143\u00d3\u015a\u017b\u0179\\s]+)$",
+ "<naglowek_osoba>$1</naglowek_osoba>"]]}'
+ scriptlet: lineregexp
+ slug: nagl-dramatu
+ tooltip: "autotagowanie akt\xF3w, scen, nag\u0142\xF3wk\xF3w os\xF3b"
+ model: toolbar.button
+ pk: 103
- fields:
accesskey: ''
group: [12]
this.scriptlets['insert_tag'] = function(context, params, text, move_forward, done)
{
var start_tag = '<'+params.tag;
- var move_cursor = false;
+ var cursor_inside = false;
for (var attr in params.attrs) {
start_tag += ' '+attr+'="' + params.attrs[attr] + '"';
output += end_tag;
}
output += token;
+
+ // keep cursor inside tag if some previous scriptlet has already moved it
+ cursor_inside = move_forward != 0;
}
else {
if(params.nocontent) {
}
else {
output = start_tag + end_tag;
- move_cursor = true;
+ cursor_inside = true;
}
}
- if (move_cursor) {
+ if (cursor_inside) {
move_forward -= params.tag.length+3;
}