/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add('console',function(Y){var getCN=Y.ClassNameManager.getClassName,CHECKED='checked',CLEAR='clear',CLICK='click',COLLAPSED='collapsed',CONSOLE='console',CONTENT_BOX='contentBox',DISABLED='disabled',ENTRY='entry',ERROR='error',HEIGHT='height',INFO='info',INNER_HTML='innerHTML',LAST_TIME='lastTime',PAUSE='pause',PAUSED='paused',RESET='reset',START_TIME='startTime',TITLE='title',WARN='warn',DOT='.',C_BUTTON=getCN(CONSOLE,'button'),C_CHECKBOX=getCN(CONSOLE,'checkbox'),C_CLEAR=getCN(CONSOLE,CLEAR),C_COLLAPSE=getCN(CONSOLE,'collapse'),C_COLLAPSED=getCN(CONSOLE,COLLAPSED),C_CONSOLE_CONTROLS=getCN(CONSOLE,'controls'),C_CONSOLE_HD=getCN(CONSOLE,'hd'),C_CONSOLE_BD=getCN(CONSOLE,'bd'),C_CONSOLE_FT=getCN(CONSOLE,'ft'),C_CONSOLE_TITLE=getCN(CONSOLE,TITLE),C_ENTRY=getCN(CONSOLE,ENTRY),C_ENTRY_CAT=getCN(CONSOLE,ENTRY,'cat'),C_ENTRY_CONTENT=getCN(CONSOLE,ENTRY,'content'),C_ENTRY_META=getCN(CONSOLE,ENTRY,'meta'),C_ENTRY_SRC=getCN(CONSOLE,ENTRY,'src'),C_ENTRY_TIME=getCN(CONSOLE,ENTRY,'time'),C_PAUSE=getCN(CONSOLE,PAUSE),C_PAUSE_LABEL=getCN(CONSOLE,PAUSE,'label'),RE_INLINE_SOURCE=/^(\S+)\s/,RE_AMP=/&(?!#?[a-z0-9]+;)/g,RE_GT=/>/g,RE_LT=/'+'
'+'{message}'+'',L=Y.Lang,create=Y.Node.create,isNumber=L.isNumber,isString=L.isString,merge=Y.merge,substitute=Y.substitute;function Console(){Console.superclass.constructor.apply(this,arguments);} Y.Console=Y.extend(Console,Y.Widget,{_evtCat:null,_head:null,_body:null,_foot:null,_printLoop:null,buffer:null,log:function(){Y.log.apply(Y,arguments);return this;},clearConsole:function(){this._body.set(INNER_HTML,'');this._cancelPrintLoop();this.buffer=[];return this;},reset:function(){this.fire(RESET);return this;},collapse:function(){this.set(COLLAPSED,true);return this;},expand:function(){this.set(COLLAPSED,false);return this;},printBuffer:function(limit){var messages=this.buffer,debug=Y.config.debug,entries=[],consoleLimit=this.get('consoleLimit'),newestOnTop=this.get('newestOnTop'),anchor=newestOnTop?this._body.get('firstChild'):null,i;if(messages.length>consoleLimit){messages.splice(0,messages.length-consoleLimit);} limit=Math.min(messages.length,(limit||messages.length));Y.config.debug=false;if(!this.get(PAUSED)&&this.get('rendered')){for(i=0;i