r1753 - in branches/bxe_2_0: js relaxng

[email protected] Thu, 13 Sep 2007 17:27:03 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Sep 13 17:27:02 2007
New Revision: 1753

Log:
nicer errrormessages, if loading on errors

BXEB-37

(document laod error handler is missing)


Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/js/bxeXMLDocument.js
   branches/bxe_2_0/relaxng/DocumentVDOM.js

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Thu Sep 13 17:27:02 2007
@@ -1903,28 +1903,28 @@
 }
 
 function bxe_catch_alert_message(e) {
-	var mes = bxe_i18n.getText("ERROR in Bitflux Editor:") + "\n" + e.message +"\n";
+	var mes = "ERROR in Bitflux Editor:" + "\n" + e.message +"\n";
 	try
 	{
 		if (e.filename) {
-			mes += bxe_i18n.getText("In File: ") + e.filename +"\n";
+			mes += ("In File: ") + e.filename +"\n";
 		} else {
-			mes += bxe_i18n.getText("In File: ") + e.fileName +"\n";
+			mes += ("In File: ") + e.fileName +"\n";
 		}
 		
 	}
 	catch (e)
 	{
-		mes += bxe_i18n.getText("In File: ") + e.fileName +"\n";
+		mes += ("In File: ") + e.fileName +"\n";
 	}
 	try
 	{
-		mes += bxe_i18n.getText("Linenumber: ") + e.lineNumber + "\n";
+		mes += ("Linenumber: ") + e.lineNumber + "\n";
 	}
 	catch(e) {}
 	
-	mes += bxe_i18n.getText("Type: ") + e.name + "\n";
-	mes += bxe_i18n.getText("Stack:") + e.stack + "\n";
+	mes += ("Type: ") + e.name + "\n";
+	mes += ("Stack:") + e.stack + "\n";
 	return mes;
 }
 

Modified: branches/bxe_2_0/js/bxeXMLDocument.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLDocument.js	(original)
+++ branches/bxe_2_0/js/bxeXMLDocument.js	Thu Sep 13 17:27:02 2007
@@ -184,8 +184,18 @@
 			}
 			processor.importStylesheet(newDocument);
 		} catch(e) {
-			bxe_dump(newDocument.saveXML(newDocument));
-			alert(bxe_i18n.getText("Something went wrong during importing the XSLT document.")+"\n" + bxe_catch_alert_message(e) + "\n" + newDocument.saveXML(newDocument));
+			//bxe_dump(newDocument.saveXML(newDocument));
+			var widg = mozilla.getWidgetModalBox("Load Error");
+			widg.addText("Something went wrong during importing the XSLT document");
+			widg.addText("See console.log for details.");
+			widg.show((window.innerWidth- 500)/2,50, "fixed");
+			if (console.log) {
+				console.log(bxe_catch_alert_message(e) + "\n" + newDocument.saveXML(newDocument));
+			}
+				
+			
+			
+			return;
 		}
 		bxe_config.processor = processor;
 		/*

Modified: branches/bxe_2_0/relaxng/DocumentVDOM.js
==============================================================================
--- branches/bxe_2_0/relaxng/DocumentVDOM.js	(original)
+++ branches/bxe_2_0/relaxng/DocumentVDOM.js	Thu Sep 13 17:27:02 2007
@@ -28,7 +28,13 @@
 	//if it's an XMLSchema File
 	if (!this.xmldoc.documentElement) {
 		
-		alert("Validation Document could not be loaded. \n" + this.xmldoc.saveXML(this.xmldoc));
+		bxe_alert("Something went wrong during importing the Validation/RelaxNG document\n.See console.log for details.");
+		if (console.log) {
+			console.log( this.xmldoc.saveXML(newDocument));
+		}
+		return false;
+		
+		
 	}
 	if (this.xmldoc.documentElement.localName == "schema" &&
 		this.xmldoc.documentElement.namespaceURI == "http://www.w3.org/2001/XMLSchema" ) {
@@ -39,7 +45,10 @@
 		this.xmldoc.documentElement.namespaceURI == "http://relaxng.org/ns/structure/1.0" ) {
 		this.parseRelaxNG();
 	} else {
-		bxe_alert ("Validation-file is not valid :\n" + this.xmldoc.saveXML(this.xmldoc));
+		bxe_alert("Validation/RelaxNG document is not valid.\n See console.log for details.");
+		if (console.log) {
+			console.log(this.xmldoc.saveXML(this.xmldoc));
+		}
 		return false;
 	}
 	this.onparse(this);
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs