/* * Ext JS Library 2.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.debug={};(function(){var B;function A(){var E=new Ext.debug.ScriptsPanel();var G=new Ext.debug.LogPanel();var C=new Ext.debug.DomTree();var D=new Ext.TabPanel({activeTab:0,border:false,tabPosition:"bottom",items:[{title:"Debug Console",layout:"border",items:[G,E]},{title:"DOM Inspector",layout:"border",items:[C]}]});B=new Ext.Panel({id:"x-debug-browser",title:"Console",collapsible:true,animCollapse:false,style:"position:absolute;left:0;bottom:0;",height:200,logView:G,layout:"fit",tools:[{id:"close",handler:function(){B.destroy();B=null;Ext.EventManager.removeResizeListener(F)}}],items:D});B.render(document.body);B.resizer=new Ext.Resizable(B.el,{minHeight:50,handles:"n",pinned:true,transparent:true,resizeElement:function(){var H=this.proxy.getBox();this.proxy.hide();B.setHeight(H.height);return H}});function F(){B.setWidth(Ext.getBody().getViewSize().width)}Ext.EventManager.onWindowResize(F);F()}Ext.apply(Ext,{log:function(){if(!B){A()}B.logView.log.apply(B.logView,arguments)},logf:function(F,E,C,D){Ext.log(String.format.apply(String,arguments))},dump:function(F){if(typeof F=="string"||typeof F=="number"||typeof F=="undefined"||Ext.isDate(F)){Ext.log(F)}else{if(!F){Ext.log("null")}else{if(typeof F!="object"){Ext.log("Unknown return type")}else{if(Ext.isArray(F)){Ext.log("["+F.join(",")+"]")}else{var C=["{\n"];for(var D in F){var G=typeof F[D];if(G!="function"&&G!="object"){C.push(String.format(" {0}: {1},\n",D,F[D]))}}var E=C.join("");if(E.length>3){E=E.substr(0,E.length-2)}Ext.log(E+"\n}")}}}}},_timers:{},time:function(C){C=C||"def";Ext._timers[C]=new Date().getTime()},timeEnd:function(D,F){var E=new Date().getTime();D=D||"def";var C=String.format("{0} ms",E-Ext._timers[D]);Ext._timers[D]=new Date().getTime();if(F!==false){Ext.log("Timer "+(D=="def"?C:D+": "+C))}return C}})})();Ext.debug.ScriptsPanel=Ext.extend(Ext.Panel,{id:"x-debug-scripts",region:"east",minWidth:200,split:true,width:350,border:false,layout:"anchor",style:"border-width:0 0 0 1px;",initComponent:function(){this.scriptField=new Ext.form.TextArea({anchor:"100% -26",style:"border-width:0;"});this.trapBox=new Ext.form.Checkbox({id:"console-trap",boxLabel:"Trap Errors",checked:true});this.toolbar=new Ext.Toolbar([{text:"Run",scope:this,handler:this.evalScript},{text:"Clear",scope:this,handler:this.clear},"->",this.trapBox," "," "]);this.items=[this.toolbar,this.scriptField];Ext.debug.ScriptsPanel.superclass.initComponent.call(this)},evalScript:function(){var s=this.scriptField.getValue();if(this.trapBox.getValue()){try{var rt=eval(s);Ext.dump(rt===undefined?"(no return)":rt)}catch(e){Ext.log(e.message||e.descript)}}else{var rt=eval(s);Ext.dump(rt===undefined?"(no return)":rt)}},clear:function(){this.scriptField.setValue("");this.scriptField.focus()}});Ext.debug.LogPanel=Ext.extend(Ext.Panel,{autoScroll:true,region:"center",border:false,style:"border-width:0 1px 0 0",log:function(){var A=["