You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2006/07/20 01:04:19 UTC

svn commit: r423687 - /incubator/xap/trunk/src/xap/util/LogFactory.js

Author: jmargaris
Date: Wed Jul 19 18:04:18 2006
New Revision: 423687

URL: http://svn.apache.org/viewvc?rev=423687&view=rev
Log:
fixed IE issue, not working with unit tests and probably apps as well

Modified:
    incubator/xap/trunk/src/xap/util/LogFactory.js

Modified: incubator/xap/trunk/src/xap/util/LogFactory.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/util/LogFactory.js?rev=423687&r1=423686&r2=423687&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/util/LogFactory.js (original)
+++ incubator/xap/trunk/src/xap/util/LogFactory.js Wed Jul 19 18:04:18 2006
@@ -45,9 +45,6 @@
 // Public Class Methods.
 //-----------------------------------------------------------------------
 
-xap.util.LogFactory.escapeName  = function( name ){
-	return name.split(".").join("_") ;
-}
 
 
 
@@ -58,11 +55,10 @@
  * @param name The named instance to return.
  */
 xap.util.LogFactory.getLog = function( name ) {
-	var escNom = xap.util.LogFactory.escapeName(name) ;
-    if ( ! xap.util.LogFactory.s_nameToConsoleLog[escNom] ) {
-        xap.util.LogFactory.s_nameToConsoleLog[escNom] = new xap.util.LogFactory.ConsoleLog( escNom );
+    if ( ! xap.util.LogFactory.s_nameToConsoleLog[name] ) {
+        xap.util.LogFactory.s_nameToConsoleLog[name] = new xap.util.LogFactory.ConsoleLog( name );
     }
-    var log = xap.util.LogFactory.s_nameToConsoleLog[escNom];
+    var log = xap.util.LogFactory.s_nameToConsoleLog[name];
 	return log;
 } 
 
@@ -123,16 +119,23 @@
 //---------------------------------------------
 // Private Methods.
 xap.util.LogFactory.ConsoleLog.prototype.output = function( id, message ) {
+	
 	if( xap.util.LogFactory.s_loggingEnabled ) {
 		var output = this.format(id, message);
 		
+	
 		if ( !xap.util.LogFactory.ConsoleLog.s_logWindow || xap.util.LogFactory.ConsoleLog.s_logWindow.closed ) {
-		xap.util.LogFactory.ConsoleLog.s_logWindow = window.open('',this._name );
-		xap.util.LogFactory.ConsoleLog.s_logWindow.document.open();
-		xap.util.LogFactory.ConsoleLog.s_logWindow.document.writeln("<head><title>Log</title></head><body><div id=\"log\"/></body>" );
-		xap.util.LogFactory.ConsoleLog.s_logWindow.document.close();
+
+	
+			xap.util.LogFactory.ConsoleLog.s_logWindow = window.open('', "XAPLOG");			
+			if (!xap.util.LogFactory.ConsoleLog.s_logWindow || xap.util.LogFactory.ConsoleLog.s_logWindow.closed) return;
+			xap.util.LogFactory.ConsoleLog.s_logWindow.document.open();
+			xap.util.LogFactory.ConsoleLog.s_logWindow.document.writeln("<head><title>Log</title></head><body><div id=\"log\"/></body>" );
+			xap.util.LogFactory.ConsoleLog.s_logWindow.document.close();
 		}
 		
+		if (!xap.util.LogFactory.ConsoleLog.s_logWindow || xap.util.LogFactory.ConsoleLog.s_logWindow.closed) return;
+
 
 		//then write to log window
 		var consoleDoc = xap.util.LogFactory.ConsoleLog.s_logWindow.document;
@@ -146,7 +149,7 @@
 		log.appendChild(p);
 		
 		var opener = xap.util.LogFactory.ConsoleLog.s_logWindow.opener;
-		if (opener && opener.focus) {opener.focus()}
+		if (opener && opener.focus) {opener.focus();}
 		
 
 	}