Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 3165582

Browse files
darkwingjasonLaster
authored andcommitted
Use addons icons for extensions (#5924)
* Provide special item in source tree for addons/extensions * Update extensions text for the SourcesTree
1 parent 8563a54 commit 3165582

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
lines changed

assets/images/Svg.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const svg = {
2222
coffeescript: require(`./coffeescript.svg`),
2323
dojo: require("./dojo.svg"),
2424
domain: require("./domain.svg"),
25+
extension: require("./extension.svg"),
2526
file: require("./file.svg"),
2627
folder: require("./folder.svg"),
2728
globe: require("./globe.svg"),

assets/images/extension.svg

Lines changed: 6 additions & 0 deletions
Loading

assets/panel/debugger.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,10 @@ addWatchExpressionText=Add watch expression
655655
# variables view popup.
656656
addWatchExpressionButton=Watch
657657

658+
# LOCALIZATION NOTE (extensionsText): The text that is displayed to represent
659+
# "moz-extension" directories in the source tree
660+
extensionsText=Extensions
661+
658662
# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the
659663
# variables pane when there are no variables to display.
660664
emptyVariablesText=No variables to display

src/components/PrimaryPanes/SourcesTree.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ class SourcesTree extends Component<Props, State> {
188188

189189
if (item.path === "webpack://") {
190190
return <Svg name="webpack" />;
191-
}
192-
if (item.path === "ng://") {
191+
} else if (item.path === "ng://") {
193192
return <Svg name="angular" />;
193+
} else if (item.path === "moz-extension://") {
194+
return <img className="extension" />;
194195
}
195196

196197
if (depth === 0 && projectRoot === "") {
@@ -308,7 +309,8 @@ class SourcesTree extends Component<Props, State> {
308309
renderItemName(name) {
309310
const hosts = {
310311
"ng://": "Angular",
311-
"webpack://": "Webpack"
312+
"webpack://": "Webpack",
313+
"moz-extension://": L10N.getStr("extensionsText")
312314
};
313315

314316
return hosts[name] || name;

src/components/shared/Svg.css

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
.folder,
1414
.domain,
1515
.source-icon,
16-
.file {
16+
.file,
17+
.extension {
1718
background-color: var(--theme-comment);
1819
}
1920

2021
.worker,
2122
.file,
2223
.folder,
23-
.source-icon {
24+
.source-icon,
25+
.extension {
2426
position: relative;
2527
top: 2px;
2628
}
@@ -47,6 +49,12 @@ img.source-icon {
4749
height: 15px;
4850
}
4951

52+
img.extension {
53+
width: 13px;
54+
height: 13px;
55+
margin-inline-start: 2px;
56+
}
57+
5058
img.result-item-icon {
5159
height: 18px;
5260
width: 18px;
@@ -80,6 +88,10 @@ img.typescript {
8088
mask: url(/images/typescript.svg) no-repeat;
8189
}
8290

91+
img.extension {
92+
mask: url(/images/extension.svg) no-repeat;
93+
}
94+
8395
img.file {
8496
mask: url(/images/file.svg) no-repeat;
8597
width: 13px;
@@ -89,7 +101,8 @@ img.file {
89101
img.domain,
90102
img.folder,
91103
img.file,
92-
img.source-icon {
104+
img.source-icon,
105+
img.extension {
93106
mask-size: 100%;
94107
margin-inline-end: 5px;
95108
display: inline-block;

0 commit comments

Comments
 (0)