Skip to content

Commit 750846e

Browse files
committed
Load stylesheet into the MarkupView
1 parent c111ed8 commit 750846e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

chrome/skin/classic/shared/firequery.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/* See license.txt for terms of usage */
22

3+
/******************************************************************************/
4+
/* Console Panel */
5+
36
.kind-jQuery .cm-variable {
47
color: #4B0082;
58
}
@@ -10,3 +13,16 @@
1013
margin-left: 2px;
1114
cursor: pointer;
1215
}
16+
17+
/******************************************************************************/
18+
/* Inspector Panel */
19+
20+
.fireQueryNodeData {
21+
font-size: 90%;
22+
color: #4B0082;
23+
background-color: #ddd;
24+
margin-left: 3px;
25+
margin-right: 3px;
26+
padding: 0px 4px;
27+
border-radius: 2px;
28+
}

lib/inspector-overlay.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.metadata = {
99
// Add-on SDK
1010
const { Cu, Ci } = require("chrome");
1111
const { Class } = require("sdk/core/heritage");
12+
const { loadSheet, removeSheet } = require("sdk/stylesheet/utils");
1213

1314
// Firebug SDK
1415
const { Trace, TraceError } = require("firebug.sdk/lib/core/trace.js").get(module.id);
@@ -78,19 +79,26 @@ const InspectorOverlay = Class(
7879
return;
7980
}
8081

82+
Trace.sysout("InspectorOverlay.onMarkupViewRender;", cache);
83+
8184
let doc = node.ownerDocument;
8285

8386
for (var data in cache) {
8487
if (cache.hasOwnProperty(data)) {
8588
let label = doc.createElementNS(XHTML_NS, "span");
86-
label.innerHTML = cache[data];
89+
label.className = "fireQueryNodeData";
90+
label.innerHTML = JSON.stringify(cache[data]);
8791
node.appendChild(label);
8892
}
8993
}
9094
},
9195

9296
onMarkupViewLoaded: function() {
9397
Trace.sysout("inspectorOverlay.onMarkupViewLoaded;");
98+
99+
// xxxHonza: unload on destroy.
100+
let win = this.panel._markupFrame.contentWindow;
101+
loadSheet(win, "chrome://firequery/skin/firequery.css", "author");
94102
},
95103
});
96104

0 commit comments

Comments
 (0)