X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d0cbddd54807e6e43f2ab75bd234ddc0beaa8d86..36387dac2e103ca656be9dc65fabb936f80191d1:/project/static/js/button_scripts.js?ds=inline diff --git a/project/static/js/button_scripts.js b/project/static/js/button_scripts.js index 8c049291..40f45f6f 100644 --- a/project/static/js/button_scripts.js +++ b/project/static/js/button_scripts.js @@ -42,11 +42,11 @@ function ScriptletCenter() output = start_tag + end_tag; } - if (text.length === 0) { - this.XMLEditorMoveCursorForward(context, params.tag.length + 2); - } - this.XMLEditorReplaceSelectedText(context, output); + + if (text.length == 0) { + this.XMLEditorMoveCursorForward(context, -params.tag.length-3); + } }.bind(this); this.scriptlets['lineregexp'] = function(context, params) { @@ -167,7 +167,7 @@ function ScriptletCenter() for(var i=0; i < verses.length; i++) { var verse = verses[i].replace(/^\s+/, "").replace(/\s+$/, ""); if(verse) { - text += (buf ? buf + '\\\n' : '') + ebuf; + text += (buf ? buf + '/\n' : '') + ebuf; buf = (first ? '\n' : '') + verses[i]; ebuf = ''; first = false;