/* 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=/'+'

'+''+'{sourceAndDetail}'+''+''+'{category}'+''+' {totalTime}ms (+{elapsedTime}) {localTime}'+''+'

'+'
{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;i0){if(this.get('newestOnTop')){i=limit;l=entries.size();}else{i=0;} this._body.setStyle('display','none');for(;i'+'

{str_title}

'+''+'',BODY_TEMPLATE:'
',FOOTER_TEMPLATE:'
'+'
'+''+''+'
'+'
',ENTRY_TEMPLATE:ENTRY_TEMPLATE_STR,ATTRS:{logEvent:{value:'yui:log',writeOnce:true,validator:isString},logSource:{value:Y,writeOnce:true,validator:function(v){return this._validateLogSource(v);}},strings:{valueFn:function(){return Y.Intl.get("console");}},paused:{value:false,validator:L.isBoolean},defaultCategory:{value:INFO,validator:isString},defaultSource:{value:'global',validator:isString},entryTemplate:{value:ENTRY_TEMPLATE_STR,validator:isString},logLevel:{value:Y.config.logLevel||INFO,setter:function(v){return this._setLogLevel(v);}},printTimeout:{value:100,validator:isNumber},printLimit:{value:50,validator:isNumber},consoleLimit:{value:300,validator:isNumber},newestOnTop:{value:true},scrollIntoView:{value:true},startTime:{value:new Date()},lastTime:{value:new Date(),readOnly:true},collapsed:{value:false},height:{value:"300px"},width:{value:"300px"},useBrowserConsole:{lazyAdd:false,value:false,getter:function(){return this._getUseBrowserConsole();},setter:function(v){return this._setUseBrowserConsole(v);}},style:{value:'separate',writeOnce:true,validator:function(v){return this._validateStyle(v);}}}});},'3.3.0',{requires:['substitute','widget'],lang:['en','es']});