Permalink
Browse files

compatibility with firebug 1.9b3

  • Loading branch information...
1 parent 2ad98d6 commit ff24e4ad43c14cb2600f36faf8d5aac925a739fb @nightwing nightwing committed Dec 22, 2011
Showing with 79 additions and 11 deletions.
  1. +5 −0 chrome/content/aceEditor.js
  2. +4 −4 chrome/content/firebugOverlay.xul
  3. +66 −3 chrome/content/resource.js
  4. +4 −4 install.rdf
@@ -800,6 +800,11 @@ HTMLPanelEditor.prototype = {
arrowCompletion: false,
//
+ getInitialValue: function(target, value)
+ {
+ return value;
+ },
+
getValue: function() {
return this.editor.session.getValue()
},
@@ -62,16 +62,16 @@
<deck id="fbPanelBar1-deck" >
<hbox id='fbAceBrowser1-parent'>
<vbox hidden='true' id='fbAceFileListTree' persist='width' width='50' >
+ <textbox type='search' oninput="Firebug.chrome.getSelectedPanel().setFilter(this.value)"
+ oncommand="Firebug.chrome.getSelectedPanel().setFilter(this.value)"
+ onchange="Firebug.chrome.getSelectedPanel().setFilter(this.value)"/>
<tree position='1' class='plain' flex='10' hidecolumnpicker='true'
- onselect="this.ownerPanel.onSelect()" treelines='true'>
+ onselect="this.ownerPanel.onSelect()" treelines='true'>
<treechildren id="domfly" flex='1' contextmenu="fbContextMenu"/>
<treecols>
<treecol id="name" hideheader="true" primary="true" flex="2" crop="start" />
</treecols>
</tree>
- <textbox type='search' oninput="Firebug.chrome.getSelectedPanel().setFilter(this.value)"
- oncommand="Firebug.chrome.getSelectedPanel().setFilter(this.value)"
- onchange="Firebug.chrome.getSelectedPanel().setFilter(this.value)"/>
</vbox>
<splitter position='2' hidden='true' collapse='before'><grippy/></splitter>
<iframe id="fbAceBrowser1" type="content" flex="1"
View
@@ -202,9 +202,9 @@ Firebug.ResourcePanel.prototype = extend(Firebug.Panel,
this.aceWindow = Firebug.Ace.win1;
this.editor = this.aceWindow.editor;
- this.tree = treePane.firstChild;
+ this.tree = treePane.querySelector("tree");
this.tree.ownerPanel = this;
- this.searchbox = this.tree.nextSibling
+ this.searchbox = treePane.querySelector("textbox")
this.searchbox.value = this.filterText || '';
this.updateLocationData();
this.setFilter(this.filterText || '');
@@ -262,7 +262,7 @@ Firebug.ResourcePanel.prototype = extend(Firebug.Panel,
// location textbox
if (!this.filterText)
- this.tree.nextSibling.value = (data && data.href);
+ this.searchbox.value = (data && data.href) || "";
// reset session
this.session = null
@@ -476,6 +476,69 @@ function generateDataURI(href) {
}
var gClipboardHelper = Firebug.Ace.gClipboardHelper
+
+
+var loadSource = function(url, onSourceLoaded, onError) {
+ let url = aEvent.detail;
+ let scheme = Services.io.extractScheme(url);
+ switch (scheme) {
+ case "file":
+ case "chrome":
+ case "resource":
+ NetUtil.asyncFetch(url, function onAsyncFetch(stream, status) {
+ if (!Components.isSuccessCode(status)) {
+ Components.utils.reportError("loadingError" + [url, status]);
+ onError && onError(url, status)
+ return;
+ }
+ let source = NetUtil.readInputStreamToString(stream, stream.available());
+ stream.close();
+ onSourceLoaded(url, source);
+ }.bind(this));
+ break;
+
+ default:
+ let cacheService = Cc["@mozilla.org/network/cache-service;1"].getService(Ci.nsICacheService);
+ let session = cacheService.createSession("HTTP", Ci.nsICache.STORE_ANYWHERE, true);
+ session.doomEntriesIfExpired = false;
+ session.asyncOpenCacheEntry(url, Ci.nsICache.ACCESS_READ, {
+ onCacheEntryAvailable: function onCacheEntryAvailable(entry, mode, status) {
+ if (!Components.isSuccessCode(status)) {
+ Components.utils.reportError("loadingError" + [url, status]);
+ onError && onError(url, status)
+ return;
+ }
+
+ let source = "";
+ let stream = entry.openInputStream(0);
+ let head = entry.getMetaDataElement("response-head");
+
+ if (/Content-Encoding:\s*gzip/i.test(head)) {
+ let converter = Cc["@mozilla.org/streamconv;1?from=gzip&to=uncompressed"].createInstance(Ci.nsIStreamConverter);
+ converter.asyncConvertData("gzip", "uncompressed", {
+ onDataAvailable: function onDataAvailable(aRequest, aContext, uncompressedStream, aOffset, aCount) {
+ source += NetUtil.readInputStreamToString(uncompressedStream, aCount);
+ }
+ }, this);
+ while (stream.available()) {
+ converter.onDataAvailable(null, this, stream, 0, stream.available());
+ }
+ } else {
+ // uncompressed data
+ while (stream.available()) {
+ source += NetUtil.readInputStreamToString(stream, stream.available());
+ }
+ }
+
+ stream.close();
+ entry.close();
+ onSourceLoaded(url, source);
+ }.bind(this)
+ });
+ break;
+ }
+}
+
// ************************************************************************************************
Firebug.registerPanel(Firebug.ResourcePanel);
View
@@ -7,7 +7,7 @@
<em:name>Acebug</em:name>
<em:description>Syntax highlighting for the Firebug command line using Ace. Firebug 1.7X.0a10 or above must be installed in order to use this extension.</em:description>
<em:id>acebug@mozilla.org</em:id>
- <em:version>1.8.1</em:version>
+ <em:version>1.9.0b1</em:version>
<em:type>2</em:type>
<em:creator>Harutyun Amirjanyan &amp; Michael Ratcliffe</em:creator>
<em:iconURL>chrome://acebug/content/acebug.png</em:iconURL>
@@ -20,16 +20,16 @@
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>1.9.0.*</em:minVersion>
- <em:maxVersion>2.0.0.*</em:maxVersion>
+ <em:maxVersion>20.0.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Firefox, at least one valid target application needed by AMO -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>4.0</em:minVersion>
- <em:maxVersion>11.0a1</em:maxVersion>
+ <em:minVersion>8.0</em:minVersion>
+ <em:maxVersion>12.0a1</em:maxVersion>
</Description>
</em:targetApplication>

0 comments on commit ff24e4a

Please sign in to comment.