+
+ var json_response = null;
+ var message = "";
+
+ try {
+ json_response = $.evalJSON(response.responseText);
+
+ if(json_response.reason == 'xml-parse-error') {
+
+ message = json_response.message.replace(/(line\s+)(\d+)(\s+)/i,
+ "<a class='xml-editor-ref' href='#xml-$2-1'>$1$2$3</a>");
+
+ message = message.replace(/(line\s+)(\d+)(\,\s*column\s+)(\d+)/i,
+ "<a class='xml-editor-ref' href='#xml-$2-$4'>$1$2$3$4</a>");
+
+
+ }
+ else {
+ message = json_response.message || json_response.reason || "nieznany błąd.";
+ }
+ }
+ catch (e) {
+ message = response.statusText;
+ }
+
+ this.set('error', '<p>Nie udało się wczytać widoku HTML: </p>' + message);
+