X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/755cace721087441becc6e1f22a3e1eed5bbec32..9feffcf1e18f73cbf75265533a70c5e252ce0748:/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 04caf003..1032dcf8 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++) { 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;