X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f3ad190e972476589cc8aeb7e67ed24d091ce6c0..8b04ced586931e1dd6b4759c2b972a01d877fe03:/src/redakcja/static/js/wiki/view_editor_wysiwyg.js diff --git a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js index bc498ce1..afd81082 100644 --- a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -441,7 +441,7 @@ } // start edition on this node - var $overlay = $('
').css({ + var $overlay = $('
').css({ position: 'absolute', height: h, left: x, @@ -572,23 +572,20 @@ var textAreaOpened = $('textarea', $overlay)[0]; var startTag = ""; var endTag = ""; - var buttonName = this.innerHTML; - - if(buttonName == "słowo obce") { - startTag = ""; - endTag = ""; - } else if (buttonName == "wyróżnienie") { - startTag = ""; - endTag = ""; - } else if (buttonName == "tytuł dzieła") { - startTag = ""; - endTag = ""; - } else if (buttonName == "znak spec."){ - addSymbol(); + var tag = ""; + var $this = $(this); + + if ($this.data('tag')) { + tag = $this.data('tag'); + startTag = "<" + $this.data('tag') + ">"; + endTag = ""; + } else if ($this.data('tag-selfclosing')){ + startTag = "<" + $this.data('tag-selfclosing') + "/>"; + } else if ($this.data('act')) { + if ($this.data('act') == 'spec') { + addSymbol(); + } return false; - } else if (buttonName == "br") { - startTag = "
"; - endTag = ""; } var myField = textAreaOpened; @@ -654,8 +651,9 @@ $('.active', element).not(editable).removeClass('active').children('.html-editarea-toolbar').remove(); if (!editable.hasClass('active')) { - editable.append($("
")); - var buttonSpace = $('.html-editarea-toolbar-left', editable); + var toolbar = $("
") + editable.append(toolbar); + var buttonSpace = $('.html-editarea-toolbar-left', toolbar); editable.addClass('active'); buttonSpace.append(button); if (!editable.is('[x-edit-attribute]') &&