Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>terminal</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="dandavis" />
<style type='text/css'>
:Focus { outline: none; }
body, html { margin: 0px; padding: 0px; color: #fff; background-color: #111; font-family: georgia;}
textarea, input { color: #bfb; background: #111; font-family: 'Lucida Console', monospace; padding: 0;
width: 98%; margin: 1em; border: 1px solid #000; overflow: hidden; }
</style>
</head>
<body>
<textarea rows='40' cols='110' id='view' ></textarea>
<form onsubmit="render(line.value); return false;">
<datalist id='hist'></datalist>
<input value='Object.keys(window)' type='text' id='line' autofocus tabindex=1 list='hist' />
</form>
<script type='text/javascript'>
commands={
cls: function cls(){ setTimeout("view.value='';",0); },
date: function(){return new Date().toISOString(); }
}
commands.ls=Object.keys.bind(Object, commands);
function propToMethod(){
}
function render(code){
hist.appendChild(new Option(code));
var rez="";
try{
rez=eval("with(commands){"+(code||'')+"}");
}catch(y){
rez=y;
}
if(typeof rez==='function'){ rez=rez();}
view.value+="\n\n JS:>"+ code+"\n" + JSON.stringify(rez, null, "\t")+"\n";
if(view.value.length>5000){ view.value=view.value.slice(-5000); }
view.scrollTop=9e9;
line.select();
line.focus();
}
window.onload=render(render+"; 'ready!' ");
</script>
</body>
</html>