Shorter XML error message in WYSIWYG editor.
[redakcja.git] / redakcja / static / js / wiki / view_editor_wysiwyg.js
index 5f45062..5fcca87 100644 (file)
@@ -91,7 +91,6 @@
         // BUG #273 - selected text can contain themes, which should be omitted from
         // defining term
         var text = html2plainText(range.cloneContents());
-
         var tag = $('<span></span>');
         range.collapse(false);
         range.insertNode(tag[0]);
                 _finalize(success);
             },
             error: function(text){
-                var message = $('<pre></pre>');
-                message.text(text);
-                $('#html-view').html('<p class="error">Wystąpił błąd:</p><pre>' +
-                message.html() +
-                '</pre>');
+                /* only basic error message */
+                var errorArray = text.split("\n");
+                var errorLocation = errorArray[2].split(":")[0];
+                text = errorLocation;
+                $('#html-view').html('<p class="error">Wystąpił błąd: '+ text + '</p>');
                 _finalize(failure);
             }
         });