From: Lukasz Anwajler <lukasz@anwajler.com>
Date: Mon, 23 Aug 2010 22:14:34 +0000 (-0500)
Subject: Shorter XML error message in WYSIWYG editor.
X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/780ab9457100da7f96656a9bf97cb512b5c69a6e?hp=--cc

Shorter XML error message in WYSIWYG editor.
---

780ab9457100da7f96656a9bf97cb512b5c69a6e
diff --git a/redakcja/static/js/wiki/view_editor_wysiwyg.js b/redakcja/static/js/wiki/view_editor_wysiwyg.js
index 5f450622..5fcca87e 100644
--- a/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@ -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]);
@@ -486,11 +485,11 @@
                 _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);
             }
         });