/* * Ext JS Library 2.3.0 * Copyright(c) 2006-2009, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.debug={};(function(){var cp;function createConsole(){var scriptPanel=new Ext.debug.ScriptsPanel();var logView=new Ext.debug.LogPanel();var tree=new Ext.debug.DomTree();var tabs=new Ext.TabPanel({activeTab:0,border:false,tabPosition:'bottom',items:[{title:'Debug Console',layout:'border',items:[logView,scriptPanel]},{title:'DOM Inspector',layout:'border',items:[tree]}]});cp=new Ext.Panel({id:'x-debug-browser',title:'Console',collapsible:true,animCollapse:false,style:'position:absolute;left:0;bottom:0;',height:200,logView:logView,layout:'fit',tools:[{id:'close',handler:function(){cp.destroy();cp=null;Ext.EventManager.removeResizeListener(handleResize);}}],items:tabs});cp.render(document.body);cp.resizer=new Ext.Resizable(cp.el,{minHeight:50,handles:"n",pinned:true,transparent:true,resizeElement:function(){var box=this.proxy.getBox();this.proxy.hide();cp.setHeight(box.height);return box;}});function handleResize(){cp.setWidth(Ext.getBody().getViewSize().width);} Ext.EventManager.onWindowResize(handleResize);handleResize();} Ext.apply(Ext,{log:function(){if(!cp){createConsole();} cp.logView.log.apply(cp.logView,arguments);},logf:function(format,arg1,arg2,etc){Ext.log(String.format.apply(String,arguments));},dump:function(o){if(typeof o=='string'||typeof o=='number'||typeof o=='undefined'||Ext.isDate(o)){Ext.log(o);}else if(!o){Ext.log("null");}else if(typeof o!="object"){Ext.log('Unknown return type');}else if(Ext.isArray(o)){Ext.log('['+o.join(',')+']');}else{var b=["{\n"];for(var key in o){var to=typeof o[key];if(to!="function"&&to!="object"){b.push(String.format(" {0}: {1},\n",key,o[key]));}} var s=b.join("");if(s.length>3){s=s.substr(0,s.length-2);} Ext.log(s+"\n}");}},_timers:{},time:function(name){name=name||"def";Ext._timers[name]=new Date().getTime();},timeEnd:function(name,printResults){var t=new Date().getTime();name=name||"def";var v=String.format("{0} ms",t-Ext._timers[name]);Ext._timers[name]=new Date().getTime();if(printResults!==false){Ext.log('Timer '+(name=="def"?v:name+": "+v));} return v;}});})();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 markup=['