e=ace.edit('editor')
e.getSession().setUseWorker(false)
e.setTheme("ace/theme/monokai")
e.getSession().setMode("ace/mode/javascript")
e.setOptions({
	fontFamily:'dvsm',
	fontSize:'13px'
})

$('#run').click(function(){
	$.get(encodeURI('/eval/'+(e.getValue()||'undefined')),function(x){
		showDialog({
			title:'Result',
			text:'<pre id="res" style="font-family:dvsm">'+x.r+'</pre>',
			positive:{
				title:'Edit'
			}
		})
	})
});
@@ -211,16 +211,31 @@
 tion()%7B%0A
+%09showLoading()%0A
 %09$.get(e
@@ -294,16 +294,32 @@
 ion(x)%7B%0A
+%09%09hideLoading()%0A
 %09%09showDi
@@ -354,19 +354,19 @@
 %09text:'%3C
-pre
+div
  id=%22res
@@ -405,11 +405,11 @@
 +'%3C/
-pre
+div
 %3E',%0A
@@ -439,16 +439,272 @@
 :'Edit'%0A
+%09%09%09%7D,%0A%09%09%09onLoaded:function()%7B%0A%09%09%09%09re=ace.edit('editor')%0A%09%09%09%09re.getSession().setUseWorker(false)%0A%09%09%09%09re.setTheme(%22ace/theme/monokai%22)%0A%09%09%09%09re.getSession().setMode(%22ace/mode/javascript%22)%0A%09%09%09%09re.setOptions(%7B%0A%09%09%09%09%09fontFamily:'dvsm',%0A%09%09%09%09%09fontSize:'13px'%0A%09%09%09%09%7D)%0A
 %09%09%09%7D%0A%09%09%7D

add more dialog features