From 626544136e8324e77af198dad26e4ad3e51f0240 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 27 Jul 2008 04:30:29 +0000 Subject: Adding firebug lite --- usr/local/www/javascript/firebug-lite.js | 1000 ++++++++++++++++++++++++++++++ 1 file changed, 1000 insertions(+) create mode 100644 usr/local/www/javascript/firebug-lite.js (limited to 'usr/local/www/javascript/firebug-lite.js') diff --git a/usr/local/www/javascript/firebug-lite.js b/usr/local/www/javascript/firebug-lite.js new file mode 100644 index 0000000..e1e4cf2 --- /dev/null +++ b/usr/local/www/javascript/firebug-lite.js @@ -0,0 +1,1000 @@ +/** + * firebug lite + * v1.0 + * 04.11.2008, 8:25 PM ~ + * v1.0a + * 03.27.2008, 5:44 AM ~ 04.01.2008, 21:32 PM + * Azer Koçulu + */ + +var firebug = { + env:{ "cache":{}, "ctmp":[], "dIndex":"console", "init":false, "ml":false, "objCn":[] }, + init:function(){ + firebug.el = {}; // elements + firebug.el.content = {}; + with(firebug){ + + document.documentElement.childNodes[0].appendChild( + new pi.element("link").attribute.set("rel","stylesheet").attribute.set("href","http://firebuglite.appspot.com/firebug-lite.css").environment.getElement() + ); + + /* + * main interface + */ + el.main = new pi.element("DIV").attribute.set("id","Firebug").environment.addStyle({ "width":pi.util.GetWindowSize().width+"px" }).insert(document.body); + el.header = new pi.element("DIV").attribute.addClass("Header").insert(el.main); + el.left = {}; + el.left.container = new pi.element("DIV").attribute.addClass("Left").insert(el.main); + el.right = {}; + el.right.container = new pi.element("DIV").attribute.addClass("Right").insert(el.main); + el.main.child.add(new pi.element("DIV").environment.addStyle({ "clear":"both" })); + + /* + * buttons + */ + el.button = {}; + el.button.container = new pi.element("DIV").attribute.addClass("ButtonContainer").insert(el.header); + el.button.logo = new pi.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update(" ").attribute.addClass("Button Logo").insert(el.button.container); + el.button.inspect = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.inspector.toggle).update("Inspect").insert(el.button.container); + el.button.maximize = new pi.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container); + el.button.minimize = new pi.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container); + el.button.close = new pi.element("A").attribute.addClass("Button Close").event.addListener("click",win.close).insert(el.button.container);; + + if(pi.env.ie||pi.env.webkit){ + el.button.container.environment.addStyle({ "paddingTop":"12px" }); + } + + /* + * navigation + */ + el.nav = {}; + el.nav.container = new pi.element("DIV").attribute.addClass("Nav").insert(el.left.container); + el.nav.console = new pi.element("A").attribute.addClass("Tab Selected").event.addListener("click",d.navigate.curry(window,"console")).update("Console").insert(el.nav.container); + el.nav.html = new pi.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",d.navigate.curry(window,"html")).insert(el.nav.container); + el.nav.css = new pi.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",d.navigate.curry(window,"css")).insert(el.nav.container); + el.nav.scripts = new pi.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",d.navigate.curry(window,"scripts")).insert(el.nav.container); + el.nav.dom = new pi.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",d.navigate.curry(window,"dom")).insert(el.nav.container); + el.nav.xhr = new pi.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",d.navigate.curry(window,"xhr")).insert(el.nav.container); + + /* + * inspector + */ + + el.borderInspector = new pi.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body); + el.bgInspector = new pi.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body); + + /* + * console + */ + el.left.console = {}; + el.left.console.container = new pi.element("DIV").attribute.addClass("Console").insert(el.left.container); + el.left.console.mlButton = new pi.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container); + el.left.console.monitor = new pi.element("DIV").insert( + new pi.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container) + ); + el.left.console.container.child.add( + new pi.element("DIV").attribute.addClass("InputArrow").update(">>>") + ); + el.left.console.input = new pi.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert( + new pi.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container) + ); + + el.right.console = {}; + el.right.console.container = new pi.element("DIV").attribute.addClass("Console Container").insert(el.right.container); + el.right.console.mlButton = new pi.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container); + el.right.console.input = new pi.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container); + el.right.console.run = new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container); + + el.right.console.clear = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.right.console.input)).update("Clear").insert(el.right.console.container); + + el.button.console = {}; + el.button.console.container = new pi.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container); + el.button.console.clear = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.left.console.monitor)).update("Clear").insert(el.button.console.container); + + /* + * html + */ + + el.left.html = {}; + el.left.html.container = new pi.element("DIV").attribute.addClass("HTML").insert(el.left.container); + + el.right.html = {}; + el.right.html.container = new pi.element("DIV").attribute.addClass("HTML Container").insert(el.right.container); + + el.right.html.nav = {}; + el.right.html.nav.container = new pi.element("DIV").attribute.addClass("Nav").insert(el.right.html.container); + el.right.html.nav.computedStyle = new pi.element("A").attribute.addClass("Tab Selected").event.addListener("click",d.html.navigate.curry(firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container); + if(!pi.env.ie6) + el.right.html.nav.dom = new pi.element("A").attribute.addClass("Tab").event.addListener("click",d.html.navigate.curry(firebug,"dom")).update("DOM").insert(el.right.html.nav.container); + + el.right.html.content = new pi.element("DIV").attribute.addClass("Content").insert(el.right.html.container); + + el.button.html = {}; + el.button.html.container = new pi.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container); + + /* + * css + */ + + el.left.css = {}; + el.left.css.container = new pi.element("DIV").attribute.addClass("CSS").insert(el.left.container); + + el.right.css = {}; + el.right.css.container = new pi.element("DIV").attribute.addClass("CSS Container").insert(el.right.container); + + el.right.css.nav = {}; + el.right.css.nav.container = new pi.element("DIV").attribute.addClass("Nav").insert(el.right.css.container); + el.right.css.nav.runCSS = new pi.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container); + + el.right.css.mlButton = new pi.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container); + el.right.css.input = new pi.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container); + el.right.css.run = new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container); + el.right.css.clear = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.clean.curry(window,el.right.css.input)).update("Clear").insert(el.right.css.container); + + el.button.css = {}; + el.button.css.container = new pi.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container); + el.button.css.selectbox = new pi.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container); + + /* + * scripts + */ + + el.left.scripts = {}; + el.left.scripts.container = new pi.element("DIV").attribute.addClass("Scripts").insert(el.left.container); + + el.right.scripts = {}; + el.right.scripts.container = new pi.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container); + + el.button.scripts = {}; + el.button.scripts.container = new pi.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container); + el.button.scripts.selectbox = new pi.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container); + el.button.scripts.lineNumbers = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container); + + /* + * dom + */ + + el.left.dom = {}; + el.left.dom.container = new pi.element("DIV").attribute.addClass("DOM").insert(el.left.container); + + el.right.dom = {}; + el.right.dom.container = new pi.element("DIV").attribute.addClass("DOM Container").insert(el.right.container); + + el.button.dom = {}; + el.button.dom.container = new pi.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container); + el.button.dom.label = new pi.element("LABEL").update("Object Path:").insert(el.button.dom.container); + el.button.dom.textbox = new pi.element("INPUT").event.addListener("keydown",listen.domTextbox).update("window").insert(el.button.dom.container); + + /* + * str + */ + + el.left.str = {}; + el.left.str.container = new pi.element("DIV").attribute.addClass("STR").insert(el.left.container); + + el.right.str = {}; + el.right.str.container = new pi.element("DIV").attribute.addClass("STR").insert(el.left.container); + + el.button.str = {}; + el.button.str.container = new pi.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container); + el.button.str.watch = new pi.element("A").attribute.addClass("Button").event.addListener("click",d.navigate.curry(window,"xhr")).update("Back").insert(el.button.str.container); + + /* + * xhr + */ + + el.left.xhr = {}; + el.left.xhr.container = new pi.element("DIV").attribute.addClass("XHR").insert(el.left.container); + + el.right.xhr = {}; + el.right.xhr.container = new pi.element("DIV").attribute.addClass("XHR").insert(el.left.container); + + + el.button.xhr = {}; + el.button.xhr.container = new pi.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container); + el.button.xhr.label = new pi.element("LABEL").update("XHR Path:").insert(el.button.xhr.container); + el.button.xhr.textbox = new pi.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container); + el.button.xhr.watch = new pi.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container); + + // fix ie6 a:hover bug + if(pi.env.ie6) + { + var buttons = [ + el.button.inspect, + el.button.close, + el.button.inspect, + el.button.console.clear, + el.right.console.run, + el.right.console.clear, + el.right.css.run, + el.right.css.clear + ]; + for(var i=0; i>> console.dir("+_value+")"); + d.dom.open(_value,d.console.addLine()); + } + }, + addLine:function(){ + with (firebug) { + return new pi.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor); + } + }, + openObject:function(_index){ + with (firebug) { + d.dom.open(env.objCn[_index], el.left.dom.container, pi.env.ie); + d.navigate("dom"); + } + }, + historyIndex:0, + history:[], + log:function(_values){ + with (firebug) { + if(env.init==false){ + env.ctmp.push(arguments); + return; + } + + var value = ""; + for(var i=0; i0?" ":"")+d.highlight(arguments[i],false,false,true); + } + + d.console.addLine().update(value); + d.console.scroll(); + + } + }, + print: function(_cmd,_text){ + with (firebug){ + d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd); + d.console.addLine().update(d.highlight(_text,false,false,true)); + d.console.scroll(); + d.console.historyIndex = d.console.history.push(_cmd); + } + }, + run:function(cmd){ + with(firebug){ + if(cmd.length==0)return; + el.left.console.input.environment.getElement().value = ""; + try { + var result = eval.call(window,cmd); + d.console.print(cmd,result); + } catch(e){ + d.console.addLine().attribute.addClass("Arrow").update(">>> "+cmd); + if(!pi.env.ff){ + d.console.scroll(); + return d.console.addLine().attribute.addClass("Error").update("Error: "+(e.description||e),true); + } + if(e.fileName==null){ + d.console.addLine().attribute.addClass("Error").update("Error: "+e.message,true); + } + var fileName = e.fileName.split("\/").getLastItem(); + d.console.addLine().attribute.addClass("Error").update("Error: "+e.message+" ("+fileName+","+e.lineNumber+")",true); + d.console.scroll(); + } + d.console.scroll(); + } + }, + scroll:function(){ + with(firebug){ + el.left.console.monitor.environment.getElement().parentNode.scrollTop = Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-200); + } + }, + toggleML:function(){ + with(firebug){ + var open = !env.ml; + env.ml = !env.ml; + d.navigateRightColumn("console",open); + el[open?"left":"right"].console.mlButton.environment.addStyle({ display:"none" }); + el[!open?"left":"right"].console.mlButton.environment.addStyle({ display:"block" }); + el.left.console.monitor.environment.addStyle({ "height":(open?233:210)+"px" }); + el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML"); + } + } + }, + css:{ + index:-1, + open:function(_index){ + with (firebug) { + var item = document.styleSheets[_index]; + var uri = item.href; + if(uri.indexOf("http:\/\/")>-1&&getDomain(uri)!=document.domain){ + el.left.css.container.update("Access to restricted URI denied"); + return; + } + var rules = item[pi.env.ie ? "rules" : "cssRules"]; + var str = ""; + for (var i=0; i"; + for(var i=0; i<_css.length; i++){ + var item = _css[i]; + str += "
"+item.replace(/(.+\:)(.+)/,"$1$2;")+"
"; + } + str+="
}
"; + return str; + } + }, + refresh:function(){ + with(firebug){ + el.button.css.selectbox.update(""); + var collection = document.styleSheets; + for(var i=0; i-1){ + // NULL + if(_value==null){ + return "null"; + } + + // BOOLEAN & NUMBER + if (["boolean", "number"].indexOf(typeof _value) > -1) { + return "" + _value + ""; + } + + // FUNCTION + if(typeof _value=="function"){ + return "function()"; + } + + // STRING + return "\""+( !_inObject&&!_inArray?_value : _value.substring(0,35) ).replace(/\n/g,"\\n").replace(/\s/g," ").replace(/>/g,">").replace(/"; + } + // element + else if(isElement){ + if(_value.nodeType==3)return d.highlight(_value.nodeValue); + + if(_inArray||_inObject){ + var result = ""+_value.nodeName.toLowerCase(); + if(_value.getAttribute&&_value.getAttribute("id"))result += "#"+_value.getAttribute("id")+""; + var elClass = _value.getAttribute?_value.getAttribute(pi.env.ie?"className":"class"):""; + if(elClass)result += "."+elClass.split(" ")[0]+""; + return result+""; + } + + var result = "<"+_value.nodeName.toLowerCase()+""; + if(_value.attributes) + for(var i=0; i<_value.attributes.length; i++){ + var item = _value.attributes[i]; + if(pi.env.ie&&Boolean(item.nodeValue)==false)continue; + result += " "+item.nodeName+"=\""+item.nodeValue+"\""; + } + result += ">"; + return result; + } + // array & object + else if(isArray||["object","array"].indexOf(typeof _value)>-1){ + var result = ""; + if(isArray||_value instanceof Array){ + if(_inObject)return "["+_value.length+"]"; + result += "[ "; + + for(var i=0; i<_value.length; i++){ + if((_inObject||_inArray)&&pi.env.ie&&i>3)break; + result += (i > 0 ? ", " : "") + d.highlight(_value[i], false, true, true); + } + result += " ]"; + return result; + } + if(_inObject)return "Object"; + result += "Object"; + var i=0; + for(var key in _value){ + var value = _value[key]; + if((_inObject||_inArray)&&pi.env.ie&&i>3) + break; + result += " "+key+"="+d.highlight(value,true); + i++; + }; + result += ""; + return result; + } else { + if(_inObject) + return ""+_value+""; + return _value; + } + + } + }, + html:{ + nIndex:"computedStyle", + current:null, + highlight:function(_element,_clear,_event){ + with(firebug){ + if(_clear){ + el.bgInspector.environment.addStyle({ "display":"none" }); + return; + } + d.inspector.inspect(_element,true); + } + }, + inspect:function(_element){ + var el = _element, map = [], parent = _element; + while(parent){ + map.push(parent); + if(parent==document.body)break; + parent = parent.parentNode; + } + map = map.reverse(); + with(firebug){ + d.inspector.toggle(); + var parentLayer = el.left.html.container.child.get()[1].childNodes[1].pi; + for(var t=0; map[t];){ + if(t==map.length-1){ + + var link = parentLayer.environment.getElement().previousSibling.pi; + link.attribute.addClass("Selected"); + + if(d.html.current)d.html.current[1].attribute.removeClass("Selected"); + + d.html.current = [_element,link]; + + return;t + } + parentLayer = d.html.openHtmlTree(map[t],parentLayer,map[t+1]); + t++; + } + } + }, + navigate:function(_index,_element){ + with(firebug){ + el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected"); + el.right.html.nav[_index].attribute.addClass("Selected"); + d.html.nIndex = _index; + d.html.openProperties(); + + } + }, + openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){ + with(firebug){ + var element = _element || document.documentElement, + parent = _parent || el.left.html.container, + returnParentEl = _returnParentElementByElement || null, + returnParentVal = null; + + if(parent!=el.left.html.container){ + var nodeLink = parent.environment.getParent().pi.child.get()[0].pi; + if(d.html.current)d.html.current[1].attribute.removeClass("Selected"); + nodeLink.attribute.addClass("Selected"); + + d.html.current = [_element,nodeLink]; + d.html.openProperties(); + } + + if(element.childNodes&&(element.childNodes.length==0||(element.childNodes.length==1&&element.childNodes[0].nodeType==3)))return; + parent.clean(); + + if(parent.opened&&Boolean(_returnParentElementByElement)==false){ + parent.opened = false; + parent.environment.getParent().pi.child.get()[0].pi.attribute.removeClass("Open"); + return; + } + if (parent != el.left.html.container) { + parent.environment.getParent().pi.child.get()[0].pi.attribute.addClass("Open"); + parent.opened = true; + + } + + for(var i=0; i")); + continue; + } + else if(item.childNodes&&item.childNodes.length==0)continue; + link.attribute.addClass("ParentLink"); + + } + return returnParentVal; + } + }, + openProperties:function(){ + with(firebug){ + + var index = d.html.nIndex; + var node = d.html.current[0]; + d.clean(el.right.html.content); + var str = ""; + switch(index){ + case "computedStyle": + var property = ["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort(); + var view = document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle; + for(var i=0; i
"+d.highlight(view[item])+"
"; + } + el.right.html.content.update(str); + break; + case "dom": + d.dom.open(node,el.right.html.content,pi.env.ie); + break; + } + } + } + }, + inspector:{ + enabled:false, + el:null, + inspect:function(_element,_bgInspector){ + var el = _element, top = el.offsetTop, left = el.offsetLeft, parent = _element.offsetParent; + while(Boolean(parent)&&parent!=document.firstChild){ + top += parent.offsetTop; + left += parent.offsetLeft; + parent = parent.offsetParent; + if(parent==document.body)break; + }; + + with(firebug){ + el[_bgInspector?"bgInspector":"borderInspector"].environment.addStyle({ + "width":_element.offsetWidth+"px", "height":_element.offsetHeight+"px", + "top":top-(_bgInspector?0:2)+"px", "left":left-(_bgInspector?0:2)+"px", + "display":"block" + }); + + if(!_bgInspector){ + d.inspector.el = _element; + } + }; + }, + toggle:function(){ + with (firebug) { + d.inspector.enabled = !d.inspector.enabled; + el.button.inspect.attribute[(d.inspector.enabled ? "add" : "remove") + "Class"]("Enabled"); + if(d.inspector.enabled==false){ + el.borderInspector.environment.addStyle({ "display":"none" }); + d.inspector.el = null; + } else if(pi.env.dIndex!="html") { + d.navigate("html"); + } + } + } + }, + scripts:{ + index:-1, + lineNumbers:false, + open:function(_index){ + with(firebug){ + d.scripts.index = _index; + el.left.scripts.container.update(""); + var script = document.getElementsByTagName("script")[_index],uri = script.src||document.location.href,source; + + if(uri.indexOf("http:\/\/")>-1&&getDomain(uri)!=document.domain){ + el.left.scripts.container.update("Access to restricted URI denied"); + return; + } + + if(uri!=document.location.href){ + source = env.cache[uri]||pi.xhr.get(uri).responseText; + env.cache[uri] = source; + } else + source = script.innerHTML; + source = source.replace(/\n|\t|<|>/g,function(_ch){ + return ({"<":"<",">":">","\t":"        ","\n":"
"})[_ch]; + }); + + if (!d.scripts.lineNumbers) + el.left.scripts.container.child.add( + new pi.element("DIV").attribute.addClass("CodeContainer").update(source) + ); + else { + source = source.split("
"); + for (var i = 0; i < source.length; i++) { + el.left.scripts.container.child.add(new pi.element("DIV").child.add(new pi.element("DIV").attribute.addClass("LineNumber").update(i + 1), new pi.element("DIV").attribute.addClass("Code").update(" " + source[i]), new pi.element("DIV").environment.addStyle({ + "clear": "both" + }))); + }; + }; + } + }, + toggleLineNumbers:function(){ + with(firebug){ + d.scripts.lineNumbers = !d.scripts.lineNumbers; + el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers ? "add" : "remove") + "Class"]("Enabled"); + d.scripts.open( d.scripts.index ); + + } + }, + refresh:function(){ + with(firebug){ + el.button.scripts.selectbox.clean(); + var collection = document.getElementsByTagName("script"); + for(var i=0; i")) + } + } + }, + xhr:{ + objects:[], + addObject:function(){ + with(firebug){ + for(var i=0; i d.console.historyIndex ? + d.console.history[d.console.historyIndex] : + "" + ); + } + }, + cssSelectbox:function(){ + with(firebug){ + d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex); + } + }, + domTextbox:function(_event){ + with(firebug){ + if(_event.keyCode==13){ + d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container); + } + } + }, + inspector:function(){ + with(firebug){ + d.html.inspect(d.inspector.el); + } + }, + keyboard:function(_event){ + with(firebug){ + if(_event.keyCode==27&&d.inspector.enabled) + d.inspector.toggle(); + } + }, + mouse:function(_event){ + with(firebug){ + var target = _event[pi.env.ie?"srcElement":"target"]; + if( + d.inspector.enabled&& + target!=document.body&& + target!=document.firstChild&& + target!=document.childNodes[1]&& + target!=el.borderInspector.environment.getElement()&& + target!=el.main.environment.getElement()&& + target.offsetParent!=el.main.environment.getElement() + ) + d.inspector.inspect(target); + } + }, + runMultiline:function(){ + with(firebug){ + d.console.run.call(window,el.right.console.input.environment.getElement().value); + } + }, + runCSS:function(){ + with(firebug){ + var source = el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}"); + for(var i=0; i0?collection[0]:document.body.appendChild( document.createElement("style") ); + if(!item.match(/.+\{.+\}/))continue; + if(pi.env.ie) + style.styleSheet.addRule(rule[0],rule[1]); + else + style.sheet.insertRule( rule, style.sheet.cssRules.length ); + } + } + }, + scriptsSelectbox:function(){ + with(firebug){ + d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value)); + } + }, + xhrTextbox:function(_event){ + with(firebug){ + if(_event.keyCode==13){ + d.xhr.addObject.apply(window, el.button.xhr.textbox.environment.getElement().value.split(",")); + } + } + } + } +}; + +window.console = firebug.d.console; +pi.util.AddEvent(window,"resize",firebug.d.refreshSize); +pi.util.AddEvent(document,"mousemove",firebug.listen.mouse); +pi.util.AddEvent(document,"keydown",firebug.listen.keyboard); +pi.util.DOMContentLoaded.push(firebug.init); \ No newline at end of file -- cgit v1.1