Sync include/webutil.js with noVNC.

This commit is contained in:
Joel Martin 2012-02-14 17:37:01 -06:00
parent 7d44853da7
commit db17151941
1 changed files with 10 additions and 6 deletions

View File

@ -8,16 +8,16 @@
"use strict"; "use strict";
/*jslint bitwise: false, white: false */ /*jslint bitwise: false, white: false */
/*global window, document */ /*global Util, window, document */
// Globals defined here // Globals defined here
var WebUtil = {}, $; var WebUtil = {}, $D;
/* /*
* Simple DOM selector by ID * Simple DOM selector by ID
*/ */
if (!window.$D) { if (!window.$D) {
$D = function (id) { window.$D = function (id) {
if (document.getElementById) { if (document.getElementById) {
return document.getElementById(id); return document.getElementById(id);
} else if (document.all) { } else if (document.all) {
@ -42,8 +42,8 @@ WebUtil.init_logging = function() {
/logging=([A-Za-z0-9\._\-]*)/) || /logging=([A-Za-z0-9\._\-]*)/) ||
['', Util._log_level])[1]; ['', Util._log_level])[1];
Util.init_logging() Util.init_logging();
} };
WebUtil.init_logging(); WebUtil.init_logging();
@ -59,7 +59,11 @@ WebUtil.dirObj = function (obj, depth, parent) {
msg += WebUtil.dirObj(obj[i], depth-1, parent + "." + i); msg += WebUtil.dirObj(obj[i], depth-1, parent + "." + i);
} else { } else {
//val = new String(obj[i]).replace("\n", " "); //val = new String(obj[i]).replace("\n", " ");
val = obj[i].toString().replace("\n", " "); if (typeof(obj[i]) === "undefined") {
val = "undefined";
} else {
val = obj[i].toString().replace("\n", " ");
}
if (val.length > 30) { if (val.length > 30) {
val = val.substr(0,30) + "..."; val = val.substr(0,30) + "...";
} }