Console = {}

Console.puts = function(str, no_newline) {
    var text = (str + (no_newline ? "" : "\n")).escapeHTML();
    span = document.createElement("span");
    span.innerHTML = text.replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");
    $('bs-console').insert(span);
}

Console.p = function (/*ARGS*/){
    Console.puts("p> "+$A(arguments).map(Object.inspect).join(" "));
}

Console = {}

Console.puts = function(str, no_newline) {
    var console;
    var text
    console = $('bs-console');
    if (console) {
	text = (str + (no_newline ? "" : "\n")).escapeHTML();
	span = document.createElement("span");
	span.innerHTML = text.replace(/\n/g,"<br>").replace(/ /g,"&nbsp;");
	console.insert(span);
    }
}

Console.p = function (/*ARGS*/){
    Console.puts("p> "+$A(arguments).map(Object.inspect).join(" "));
}

Handle the case that bs-console doesn't exist.
Handle the case that bs-console doesn't exist.
