X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/05124c8c30a67c005eac475a262c6e3c61473590..514e98aeae05045d0086aae39960124a572e646f:/platforma/static/js/main.js diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index 8aff7317..3c1a3c00 100644 --- a/platforma/static/js/main.js +++ b/platforma/static/js/main.js @@ -301,7 +301,11 @@ function transform(editor, callback) { callback(); } }, error: function(text) { - $('#html-view').html('
WystÄ piÅ bÅÄ d:
' + text + ''); + var message = $(''); + message.text(text); + $('#html-view').html('
WystÄ piÅ bÅÄ d:
' + + message.html() + ''); + $.unblockUI(); if (callback) { callback(); @@ -469,12 +473,20 @@ function html(element) { // for now allow only 1 range if(n > 1) { - window.alert("Zaznacz jeden obszar"); + window.alert("Zaznacz jeden obszar."); return false; } + // remember the selected range var range = selection.getRangeAt(0); + + + if( $(range.startContainer).is('.html-editarea') + || $(range.endContainer).is('.html-editarea') ) { + window.alert("Motywy można oznaczaÄ tylko na tekÅcie nie otwartym do edycji. \n Zamknij edytowany fragment i spróbuj ponownie."); + return false; + } // verify if the start/end points make even sense - // they must be inside a x-node (otherwise they will be discarded) @@ -511,7 +523,7 @@ function html(element) { etag.replaceWith(text); xml2html({ xml: '