[soashable commit] r803 - deps/log4js/src/main/javascript

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 4, 2008, 2:43:30 PM8/4/08
to soashabl...@googlegroups.com
Author: h.iverson
Date: Mon Aug 4 11:42:40 2008
New Revision: 803

Modified:
deps/log4js/src/main/javascript/log4js.js

Log:
fixed IE window.open name issue by replacing non digit and alphanum
characters with underscores

Modified: deps/log4js/src/main/javascript/log4js.js
==============================================================================
--- deps/log4js/src/main/javascript/log4js.js (original)
+++ deps/log4js/src/main/javascript/log4js.js Mon Aug 4 11:42:40 2008
@@ -869,7 +869,7 @@
setAccessKey : function(key) {
this.accesskey = key;
},
-
+
/**
* @private
*/
@@ -878,8 +878,10 @@
if(!this.inline) {
var doc = null;
var win = null;
- window.top.consoleWindow = window.open("", this.logger.category,
- "left=0,top=0,width=700,height=700,scrollbars=no,status=no,resizable=yes;toolbar=no");
+ var winName = this.makeWinName(
this.logger.category );
+
+ window.top.consoleWindow = window.open("", winName,
+ "left=0,top=0,width=700,height=700,scrollbars=no,status=no,resizable=yes;toolbar=no");
window.top.consoleWindow.opener = self;
win = window.top.consoleWindow;

@@ -1046,7 +1048,7 @@

// If we are at the bottom of the window, then keep scrolling with
the output
var shouldScroll = (this.outputElement.scrollTop + (2 *
this.outputElement.clientHeight)) >= this.outputElement.scrollHeight;
-
+
this.outputCount++;
style = (style ? style += ';' : '');
style += 'padding:1px;margin:0 0 5px 0';
@@ -1057,9 +1059,9 @@

message = message || "undefined";
message = message.toString();
-
+
this.outputElement.innerHTML += "<pre style='" + style + "'>" +
message + "</pre>";
-
+
if (shouldScroll) {
this.outputElement.scrollTop = this.outputElement.scrollHeight;
}
@@ -1196,7 +1198,14 @@
this.commandIndex = 0;
}
},
-
+
+ /**
+ * @private
+ */
+ makeWinName : function(category) {
+ return category.replace(/[^\d\w]/g, "_");
+ },
+
/**
* toString
*/

Reply all
Reply to author
Forward
0 new messages