📄 firebug.js
字号:
/* Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details*/if(!dojo._hasResource["dojo._firebug.firebug"]){dojo._hasResource["dojo._firebug.firebug"]=true;dojo.provide("dojo._firebug.firebug");dojo.deprecated=function(_1,_2,_3){var _4="DEPRECATED: "+_1;if(_2){_4+=" "+_2;}if(_3){_4+=" -- will be removed in version: "+_3;}console.warn(_4);};dojo.experimental=function(_5,_6){var _7="EXPERIMENTAL: "+_5+" -- APIs subject to change without notice.";if(_6){_7+=" "+_6;}console.warn(_7);};if(!dojo.config.useCustomLogger&&!dojo.isAIR&&(!dojo.isFF||(dojo.isFF&&!("console" in window))||(dojo.isFF&&!(window.loadFirebugConsole||console.firebug))&&!dojo.config.noFirebugLite)){(function(){try{if(window!=window.parent){if(window.parent["console"]){window.console=window.parent.console;}return;}}catch(e){}window.console={_connects:[],log:function(){logFormatted(arguments,"");},debug:function(){logFormatted(arguments,"debug");},info:function(){logFormatted(arguments,"info");},warn:function(){logFormatted(arguments,"warning");},error:function(){logFormatted(arguments,"error");},assert:function(_8,_9){if(!_8){var _a=[];for(var i=1;i<arguments.length;++i){_a.push(arguments[i]);}logFormatted(_a.length?_a:["Assertion Failure"],"error");throw _9?_9:"Assertion Failure";}},dir:function(_c){var _d=printObject(_c);_d=_d.replace(/\n/g,"<br />");_d=_d.replace(/\t/g," ");logRow([_d],"dir");},dirxml:function(_e){var _f=[];appendNode(_e,_f);logRow(_f,"dirxml");},group:function(){logRow(arguments,"group",pushGroup);},groupEnd:function(){logRow(arguments,"",popGroup);},time:function(_10){_11[_10]=new Date().getTime();},timeEnd:function(_12){if(_12 in _11){var _13=(new Date()).getTime()-_11[_12];logFormatted([_12+":",_13+"ms"]);delete _11[_12];}},count:function(){this.warn(["count() not supported."]);},trace:function(){this.warn(["trace() not supported."]);},profile:function(){this.warn(["profile() not supported."]);},profileEnd:function(){},clear:function(){if(_14){while(_14.childNodes.length){dojo._destroyElement(_14.firstChild);}}dojo.forEach(this._connects,dojo.disconnect);},open:function(){toggleConsole(true);},close:function(){if(_15){toggleConsole();}},_restoreBorder:function(){if(_16){_16.style.border=_17;}},openDomInspector:function(){_inspectionEnabled=true;_14.style.display="none";consoleDomInspector.style.display="block";consoleObjectInspector.style.display="none";document.body.style.cursor="pointer";_inspectionMoveConnection=dojo.connect(document,"mousemove",function(evt){if(!_inspectionEnabled){return;}if(!_inspectionTimer){_inspectionTimer=setTimeout(function(){_inspectionTimer=null;},50);}else{return;}var _19=evt.target;if(_19&&(_16!==_19)){var _1a=true;console._restoreBorder();var _1b=[];appendNode(_19,_1b);consoleDomInspector.innerHTML=_1b.join("");_16=_19;_17=_16.style.border;_16.style.border="#0000FF 1px solid";}});setTimeout(function(){_inspectionClickConnection=dojo.connect(document,"click",function(evt){document.body.style.cursor="";_1d=!_1d;dojo.disconnect(_1e);});},30);},_closeDomInspector:function(){document.body.style.cursor="";dojo.disconnect(_1f);dojo.disconnect(_1e);_1d=false;console._restoreBorder();},openConsole:function(){_14.style.display="block";_20.style.display="none";_21.style.display="none";console._closeDomInspector();},openObjectInspector:function(){_14.style.display="none";_20.style.display="none";_21.style.display="block";console._closeDomInspector();},recss:function(){var i,a,s;a=document.getElementsByTagName("link");for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf("stylesheet")>=0&&s.href){var h=s.href.replace(/(&|%5C?)forceReload=\d+/,"");s.href=h+(h.indexOf("?")>=0?"&":"?")+"forceReload="+new Date().valueOf();}}}};var _26=document;var _27=window;var _28=0;var _29=null;var _14=null;var _21=null;var _2a=null;var _2b=null;var _2c=null;var _15=false;var _2d=[];var _2e=[];var _11={};var _20=null;var _1f;var _1e;var _1d=false;var _2f=null;var _30=document.createElement("div");var _16;var _17;function toggleConsole(_31){_15=_31||!_15;if(_29){_29.style.display=_15?"block":"none";}};function focusCommandLine(){toggleConsole(true);if(_2b){_2b.focus();}};function openWin(x,y,w,h){var win=window.open("","_firebug","status=0,menubar=0,resizable=1,top="+y+",left="+x+",width="+w+",height="+h+",scrollbars=1,addressbar=0");if(!win){var msg="Firebug Lite could not open a pop-up window, most likely because of a blocker.\n"+"Either enable pop-ups for this domain, or change the djConfig to popup=false.";alert(msg);}createResizeHandler(win);var _38=win.document;var _39="<html style=\"height:100%;\"><head><title>Firebug Lite</title></head>\n"+"<body bgColor=\"#ccc\" style=\"height:97%;\" onresize=\"opener.onFirebugResize()\">\n"+"<div id=\"fb\"></div>"+"</body></html>";_38.write(_39);_38.close();return win;};function createResizeHandler(wn){var d=new Date();d.setTime(d.getTime()+(60*24*60*60*1000));d=d.toUTCString();var dc=wn.document,_3d;if(wn.innerWidth){_3d=function(){return {w:wn.innerWidth,h:wn.innerHeight};};}else{if(dc.documentElement&&dc.documentElement.clientWidth){_3d=function(){return {w:dc.documentElement.clientWidth,h:dc.documentElement.clientHeight};};}else{if(dc.body){_3d=function(){return {w:dc.body.clientWidth,h:dc.body.clientHeight};};}}}window.onFirebugResize=function(){layout(_3d().h);clearInterval(wn._firebugWin_resize);wn._firebugWin_resize=setTimeout(function(){var x=wn.screenLeft,y=wn.screenTop,w=wn.outerWidth||wn.document.body.offsetWidth,h=wn.outerHeight||wn.document.body.offsetHeight;document.cookie="_firebugPosition="+[x,y,w,h].join(",")+"; expires="+d+"; path=/";},5000);};};function createFrame(){if(_29){return;}if(dojo.config.popup){var _42="100%";var _43=document.cookie.match(/(?:^|; )_firebugPosition=([^;]*)/);var p=_43?_43[1].split(","):[2,2,320,480];_27=openWin(p[0],p[1],p[2],p[3]);_26=_27.document;dojo.config.debugContainerId="fb";_27.console=window.console;_27.dojo=window.dojo;}else{_26=document;_42=(dojo.config.debugHeight||300)+"px";}var _45=_26.createElement("link");_45.href=dojo.moduleUrl("dojo._firebug","firebug.css");_45.rel="stylesheet";_45.type="text/css";var _46=_26.getElementsByTagName("head");if(_46){_46=_46[0];}if(!_46){_46=_26.getElementsByTagName("html")[0];}if(dojo.isIE){window.setTimeout(function(){_46.appendChild(_45);},0);}else{_46.appendChild(_45);}if(dojo.config.debugContainerId){_29=_26.getElementById(dojo.config.debugContainerId);}if(!_29){_29=_26.createElement("div");_26.body.appendChild(_29);}_29.className+=" firebug";_29.style.height=_42;_29.style.display=(_15?"block":"none");var _47=function(_48,_49,_4a,_4b){return "<li class=\""+_4b+"\"><a href=\"javascript:void(0);\" onclick=\"console."+_4a+"(); return false;\" title=\""+_49+"\">"+_48+"</a></li>";};_29.innerHTML="<div id=\"firebugToolbar\">"+" <ul id=\"fireBugTabs\" class=\"tabs\">"+_47("Clear","Remove All Console Logs","clear","")+_47("ReCSS","Refresh CSS without reloading page","recss","")+_47("Console","Show Console Logs","openConsole","gap")+_47("DOM","Show DOM Inspector","openDomInspector","")+_47("Object","Show Object Inspector","openObjectInspector","")+((dojo.config.popup)?"":_47("Close","Close the console","close","gap"))+"\t</ul>"+"</div>"+"<input type=\"text\" id=\"firebugCommandLine\" />"+"<div id=\"firebugLog\"></div>"+"<div id=\"objectLog\" style=\"display:none;\">Click on an object in the Log display</div>"+"<div id=\"domInspect\" style=\"display:none;\">Hover over HTML elements in the main page. Click to hold selection.</div>";_2c=_26.getElementById("firebugToolbar");_2b=_26.getElementById("firebugCommandLine");addEvent(_2b,"keydown",onCommandLineKeyDown);addEvent(_26,dojo.isIE||dojo.isSafari?"keydown":"keypress",onKeyDown);_14=_26.getElementById("firebugLog");_21=_26.getElementById("objectLog");_20=_26.getElementById("domInspect");_2a=_26.getElementById("fireBugTabs");layout();flush();};dojo.addOnLoad(createFrame);function clearFrame(){_26=null;if(_27.console){_27.console.clear();}_27=null;_29=null;_14=null;_21=null;_20=null;_2b=null;_2d=[];_2e=[];_11={};};dojo.addOnUnload(clearFrame);function evalCommandLine(){var _4c=_2b.value;_2b.value="";logRow(["> ",_4c],"command");var _4d;try{_4d=eval(_4c);}catch(e){}};function layout(h){var _4f=25;var _50=h?h-(_4f+_2b.offsetHeight+25+(h*0.01))+"px":(_29.offsetHeight-_4f-_2b.offsetHeight)+"px";_14.style.top=_4f+"px";_14.style.height=_50;_21.style.height=_50;_21.style.top=_4f+"px";_20.style.height=_50;_20.style.top=_4f+"px";_2b.style.bottom=0;};function logRow(_51,_52,_53){if(_14){writeMessage(_51,_52,_53);}else{_2d.push([_51,_52,_53]);}};function flush(){var _54=_2d;_2d=[];for(var i=0;i<_54.length;++i){writeMessage(_54[i][0],_54[i][1],_54[i][2]);}};function writeMessage(_56,_57,_58){var _59=_14.scrollTop+_14.offsetHeight>=_14.scrollHeight;_58=_58||writeRow;_58(_56,_57);if(_59){_14.scrollTop=_14.scrollHeight-_14.offsetHeight;}};function appendRow(row){var _5b=_2e.length?_2e[_2e.length-1]:_14;_5b.appendChild(row);};function writeRow(_5c,_5d){var row=_14.ownerDocument.createElement("div");row.className="logRow"+(_5d?" logRow-"+_5d:"");row.innerHTML=_5c.join("");appendRow(row);};function pushGroup(_5f,_60){logFormatted(_5f,_60);var _61=_14.ownerDocument.createElement("div");_61.className="logGroupBox";appendRow(_61);_2e.push(_61);};function popGroup(){_2e.pop();};function logFormatted(_62,_63){var _64=[];var _65=_62[0];var _66=0;if(typeof (_65)!="string"){_65="";_66=-1;}var _67=parseFormat(_65);for(var i=0;i<_67.length;++i){var _69=_67[i];if(_69&&typeof _69=="object"){_69.appender(_62[++_66],_64);}else{appendText(_69,_64);}}var ids=[];var obs=[];for(i=_66+1;i<_62.length;++i){appendText(" ",_64);var _6c=_62[i];if(_6c===undefined||_6c===null){appendNull(_6c,_64);}else{if(typeof (_6c)=="string"){appendText(_6c,_64);}else{if(_6c instanceof Date){appendText(_6c.toString(),_64);}else{if(_6c.nodeType==9){appendText("[ XmlDoc ]",_64);}else{var id="_a"+_28++;ids.push(id);obs.push(_6c);var str="<a id=\""+id+"\" href=\"javascript:void(0);\">"+getObjectAbbr(_6c)+"</a>";appendLink(str,_64);}}}}}logRow(_64,_63);for(i=0;i<ids.length;i++){var btn=_26.getElementById(ids[i]);if(!btn){continue;}btn.obj=obs[i];_27.console._connects.push(dojo.connect(btn,"onclick",function(){console.openObjectInspector();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -