X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c0f614854cf883800a813cac3703fcc875b0b098..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 219b405a..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;