forked from firefox-devtools/devtools-bug-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
components.js
105 lines (101 loc) · 2.46 KB
/
components.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"use strict";
var COMPONENT_MAPPING = {
"inspector": {
label: "Inspector",
components: ["Inspector",
"Inspector: Animations",
"Inspector: Changes",
"Inspector: Computed",
"Inspector: Fonts",
"Inspector: Layout",
"Inspector: Rules",
"Style Editor",
"Responsive Design Mode"]
},
"console": {
label: "Web Console",
components: ["Console"]
},
"debugger": {
label: "JS Debugger",
components: ["Debugger"]
},
"network": {
label: "Network Monitor",
components: ["Netmonitor"]
},
"perf": {
label: "Performance Tools",
components: ["Memory",
"Performance Tools (Profiler/Timeline)"]
},
"jsonviewer": {
label: "JSON Viewer",
components: ["JSON Viewer"]
},
"storage": {
label: "Storage Inspector",
components: ["Storage Inspector"]
},
"dom": {
label: "DOM Panel",
components: ["DOM"]
},
"responsive": {
label: "Responsive Mode",
components: ["Responsive Design Mode"]
},
"aboutdebugging": {
label: "about:debugging",
components: ["about:debugging"]
},
"scratchpad": {
label: "Scratchpad",
components: ["Scratchpad"]
},
"audio": {
label: "Web Audio Editor",
components: ["Web Audio Editor"]
},
"canvas": {
label: "Canvas & WebGL",
components: ["Canvas Debugger",
"WebGL Shader Editor"]
},
"webide": {
label: "WebIDE",
components: ["WebIDE"]
},
"main": {
label: "Shared, Framework, Untriaged",
components: ["General",
"Framework",
"Object Inspector",
"Source Editor",
"Shared Components"]
},
};
/**
* Get a list of bugzilla component names given a list of COMPONENT_MAPPING
* keys.
* @param {Array} keys A list of keys as found in the COMPONENT_MAPPING object.
* If instead of an array, the special string "all" is passed, then all
* components are returned.
* @return {Array} A list of bugzilla component names for these keys.
*/
function getBugzillaComponents(keys) {
if (!keys) {
return [];
}
if (keys === "all") {
keys = Object.keys(COMPONENT_MAPPING);
}
var components = [];
for (var i = 0; i < keys.length; i++) {
var component = COMPONENT_MAPPING[keys[i]];
if (component) {
components = components.concat(component.components);
}
}
return components;
}