@mdn/fred 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/build/render.js +5 -2
- package/components/baseline-indicator/server.js +3 -3
- package/components/compat-table/constants.js +0 -3
- package/components/compat-table/element.js +3 -6
- package/components/content-feedback/element.js +2 -5
- package/components/content-section/server.css +1 -1
- package/components/contributor-list/element.css +3 -2
- package/components/interactive-example/element.js +1 -1
- package/components/menu/constants.js +6 -4
- package/components/menu/server.js +142 -89
- package/components/placement-bottom/element.js +2 -2
- package/components/placement-hp-main/element.js +2 -2
- package/components/placement-no/element.js +1 -1
- package/components/placement-note/element.js +1 -1
- package/components/placement-sidebar/element.js +4 -4
- package/components/placement-top/element.js +5 -5
- package/components/play-controller/element.js +1 -0
- package/components/playground/element.js +2 -1
- package/components/recent-contributions/server.js +1 -1
- package/components/scrim-inline/element.js +2 -2
- package/l10n/en-US.ftl +5 -2
- package/out/service-worker.js +1 -1
- package/out/service-worker.js.map +1 -1
- package/out/static/client/{2308.69b80ae939b202ae.js → 2308.0ccf49974d71523d.js} +6 -6
- package/out/static/client/2308.0ccf49974d71523d.js.map +1 -0
- package/out/static/client/{2319.daf8150c3dd00fb4.js → 2319.0a40303319ac6a6e.js} +4 -4
- package/out/static/client/{2319.daf8150c3dd00fb4.js.map → 2319.0a40303319ac6a6e.js.map} +1 -1
- package/out/static/client/{288.ba983e8acda3116e.js → 288.684edb44f92a470c.js} +2 -2
- package/out/static/client/288.684edb44f92a470c.js.map +1 -0
- package/out/static/client/{3132.ec59f4619872c415.js → 3132.5ae6f61e3998aef1.js} +6 -6
- package/out/static/client/{3132.ec59f4619872c415.js.map → 3132.5ae6f61e3998aef1.js.map} +1 -1
- package/out/static/client/{3733.60667669ab613e1f.js → 3733.94bd76664194890b.js} +5 -5
- package/out/static/client/{3733.60667669ab613e1f.js.map → 3733.94bd76664194890b.js.map} +1 -1
- package/out/static/client/{451.cd85e2808f388a00.js → 451.fb2679190b3266e1.js} +2 -2
- package/out/static/client/{451.cd85e2808f388a00.js.map → 451.fb2679190b3266e1.js.map} +1 -1
- package/out/static/client/{603.8cdd963a9e248a75.js → 603.8670965b0722be3a.js} +5 -5
- package/out/static/client/603.8670965b0722be3a.js.map +1 -0
- package/out/static/client/{6040.80c6f96d0152ac99.js → 6040.13e672aff6757a47.js} +2 -2
- package/out/static/client/{6040.80c6f96d0152ac99.js.map → 6040.13e672aff6757a47.js.map} +1 -1
- package/out/static/client/{6536.faff8f026d145aad.js → 6536.ecdcc4458cbd0504.js} +2 -2
- package/out/static/client/6536.ecdcc4458cbd0504.js.map +1 -0
- package/out/static/client/{8036.9065b84aac240378.js → 8036.6e177b49bfa9b7c4.js} +3 -3
- package/out/static/client/{8036.9065b84aac240378.js.map → 8036.6e177b49bfa9b7c4.js.map} +1 -1
- package/out/static/client/{8607.266d488ae06c2279.js → 8607.464a88660a040f97.js} +4 -4
- package/out/static/client/{8607.266d488ae06c2279.js.map → 8607.464a88660a040f97.js.map} +1 -1
- package/out/static/client/{8797.46790b4359b5d1cb.js → 8797.f5880b5ee2659039.js} +2 -2
- package/out/static/client/{8797.46790b4359b5d1cb.js.map → 8797.f5880b5ee2659039.js.map} +1 -1
- package/out/static/client/{9784.214845ec6d3b77e3.js → 9784.3f8ca449f7d36818.js} +5 -5
- package/out/static/client/9784.3f8ca449f7d36818.js.map +1 -0
- package/out/static/client/{index.b9d9ebb034538241.js → index.881056601848b5c3.js} +15 -12
- package/out/static/client/{index.b9d9ebb034538241.js.map → index.881056601848b5c3.js.map} +1 -1
- package/out/static/client/{runtime.cc9114c9e108157f.js → runtime.63305f0549b94aae.js} +2 -2
- package/out/static/client/{runtime.cc9114c9e108157f.js.map → runtime.63305f0549b94aae.js.map} +1 -1
- package/out/static/client/stats.json +136 -136
- package/out/static/client/{styles-content-section.e0bbadd0c4bc857d.css → styles-content-section.2f0727a030110fc9.css} +2 -2
- package/out/static/client/{styles-content-section.e0bbadd0c4bc857d.css.map → styles-content-section.2f0727a030110fc9.css.map} +1 -1
- package/out/static/legacy/{1289.71de08e7375881e1.js → 1289.61e3f0658b3b42f6.js} +2 -2
- package/out/static/legacy/{1289.71de08e7375881e1.js.map → 1289.61e3f0658b3b42f6.js.map} +1 -1
- package/out/static/legacy/{2090.29b77e88722868ff.js → 2090.5996133ea26ddd0a.js} +2 -2
- package/out/static/legacy/{2090.29b77e88722868ff.js.map → 2090.5996133ea26ddd0a.js.map} +1 -1
- package/out/static/legacy/2235.b99812e73c08ee51.js +2 -0
- package/out/static/legacy/{2235.c0e6904b64ea18fe.js.map → 2235.b99812e73c08ee51.js.map} +1 -1
- package/out/static/legacy/{2465.676e7f0b0f9f9d85.js → 2465.041a63f06f35163c.js} +2 -2
- package/out/static/legacy/{2465.676e7f0b0f9f9d85.js.map → 2465.041a63f06f35163c.js.map} +1 -1
- package/out/static/legacy/{3172.0c1b9258951929cc.js → 3172.cf1b8a6dcea5d789.js} +2 -2
- package/out/static/legacy/{3172.0c1b9258951929cc.js.map → 3172.cf1b8a6dcea5d789.js.map} +1 -1
- package/out/static/legacy/{4968.62ad4db7389e93ad.js → 4968.e73f2795a9ca1639.js} +2 -2
- package/out/static/legacy/{4968.62ad4db7389e93ad.js.map → 4968.e73f2795a9ca1639.js.map} +1 -1
- package/out/static/legacy/{6364.d8cdb19b92fe6dc1.js → 6364.4c2629a5287ded91.js} +2 -2
- package/out/static/legacy/{6364.d8cdb19b92fe6dc1.js.map → 6364.4c2629a5287ded91.js.map} +1 -1
- package/out/static/legacy/{652.3c82fa8fa13a87b2.js → 652.d7ab50c73c693880.js} +2 -2
- package/out/static/legacy/{652.3c82fa8fa13a87b2.js.map → 652.d7ab50c73c693880.js.map} +1 -1
- package/out/static/legacy/7510.faa07a788cad6fc7.js +2 -0
- package/out/static/legacy/{7510.d1e3773463ecc314.js.map → 7510.faa07a788cad6fc7.js.map} +1 -1
- package/out/static/legacy/{7827.838d9e673c56e936.js → 7827.efd03057dbb6c884.js} +2 -2
- package/out/static/legacy/{7827.838d9e673c56e936.js.map → 7827.efd03057dbb6c884.js.map} +1 -1
- package/out/static/legacy/8183.26862a110c641391.js +2 -0
- package/out/static/legacy/8183.26862a110c641391.js.map +1 -0
- package/out/static/legacy/{8333.c00c132d6919165b.js → 8333.e5001734aea048b6.js} +2 -2
- package/out/static/legacy/{8333.c00c132d6919165b.js.map → 8333.e5001734aea048b6.js.map} +1 -1
- package/out/static/legacy/{8504.157e4a48938fdac7.js → 8504.d5df18204dd2b2ef.js} +2 -2
- package/out/static/legacy/{8504.157e4a48938fdac7.js.map → 8504.d5df18204dd2b2ef.js.map} +1 -1
- package/out/static/legacy/8856.0efcde0ace698d4a.js.map +1 -1
- package/out/static/legacy/{9221.64e46eedebf47df8.js → 9221.3cee7be6339f4234.js} +3 -3
- package/out/static/legacy/{9221.64e46eedebf47df8.js.map → 9221.3cee7be6339f4234.js.map} +1 -1
- package/out/static/legacy/asset-manifest.json +20 -20
- package/out/static/legacy/{index.e4ab469094607d20.html → index.17917fe951b4bbfe.html} +1 -1
- package/out/static/legacy/index.81f776c8a95b5c6c.js +6 -0
- package/out/static/legacy/{index.3504df1c7b6a1b29.js.LICENSE.txt → index.81f776c8a95b5c6c.js.LICENSE.txt} +1 -1
- package/out/static/legacy/index.81f776c8a95b5c6c.js.map +1 -0
- package/out/static/legacy/stats.json +20 -20
- package/out/static/legacy/yari.255b3bc6ef8a8b24.js +7 -0
- package/out/static/legacy/{yari.7a85003b4add8414.js.LICENSE.txt → yari.255b3bc6ef8a8b24.js.LICENSE.txt} +1 -1
- package/out/static/legacy/yari.255b3bc6ef8a8b24.js.map +1 -0
- package/out/static/ssr/index.js +153 -161
- package/out/static/ssr/index.js.map +1 -1
- package/out/static/ssr/stats.json +4 -4
- package/package.json +14 -14
- package/utils/glean.js +3 -8
- package/out/static/client/2308.69b80ae939b202ae.js.map +0 -1
- package/out/static/client/288.ba983e8acda3116e.js.map +0 -1
- package/out/static/client/603.8cdd963a9e248a75.js.map +0 -1
- package/out/static/client/6536.faff8f026d145aad.js.map +0 -1
- package/out/static/client/9784.214845ec6d3b77e3.js.map +0 -1
- package/out/static/legacy/2235.c0e6904b64ea18fe.js +0 -2
- package/out/static/legacy/7510.d1e3773463ecc314.js +0 -2
- package/out/static/legacy/8183.d3c84d03c477eac6.js +0 -2
- package/out/static/legacy/8183.d3c84d03c477eac6.js.map +0 -1
- package/out/static/legacy/index.3504df1c7b6a1b29.js +0 -6
- package/out/static/legacy/index.3504df1c7b6a1b29.js.map +0 -1
- package/out/static/legacy/yari.7a85003b4add8414.js +0 -7
- package/out/static/legacy/yari.7a85003b4add8414.js.map +0 -1
- /package/out/static/client/{2319.daf8150c3dd00fb4.js.LICENSE.txt → 2319.0a40303319ac6a6e.js.LICENSE.txt} +0 -0
- /package/out/static/client/{603.8cdd963a9e248a75.js.LICENSE.txt → 603.8670965b0722be3a.js.LICENSE.txt} +0 -0
- /package/out/static/client/{9784.214845ec6d3b77e3.js.LICENSE.txt → 9784.3f8ca449f7d36818.js.LICENSE.txt} +0 -0
- /package/out/static/client/{index.b9d9ebb034538241.js.LICENSE.txt → index.881056601848b5c3.js.LICENSE.txt} +0 -0
- /package/out/static/legacy/{9221.64e46eedebf47df8.js.LICENSE.txt → 9221.3cee7be6339f4234.js.LICENSE.txt} +0 -0
|
@@ -11,14 +11,34 @@ export class Menu extends ServerComponent {
|
|
|
11
11
|
* @param {import("@fred").Context} context
|
|
12
12
|
*/
|
|
13
13
|
render(context) {
|
|
14
|
+
/**
|
|
15
|
+
* Holds the id of the section being rendered.
|
|
16
|
+
*
|
|
17
|
+
* @type {string|null}
|
|
18
|
+
*/
|
|
19
|
+
let currentSection = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Generates a Glean ID for menu/submenu links.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} href - The href of the link.
|
|
25
|
+
* @param {object} [options]
|
|
26
|
+
* @param {boolean} [options.primary] - Whether this is the primary link (in the panel title).
|
|
27
|
+
* @returns {string} the Glean ID.
|
|
28
|
+
*/
|
|
29
|
+
const gleanId = (href, { primary = false } = {}) =>
|
|
30
|
+
`${primary ? "menu_click_menu" : "menu_click_submenu"}: ${currentSection ?? "?"} -> ${href}`;
|
|
31
|
+
|
|
14
32
|
/**
|
|
15
33
|
* Renders a link to a page.
|
|
16
34
|
*
|
|
17
|
-
* @param {string} slug
|
|
18
|
-
* @param {string} text
|
|
19
|
-
* @param {
|
|
35
|
+
* @param {string} slug - The link slug (the part after `/en-US/docs/`!).
|
|
36
|
+
* @param {string} text - The link text.
|
|
37
|
+
* @param {object} [options]
|
|
38
|
+
* @param {string} [options.label] - The title and aria-label of the link.
|
|
39
|
+
* @param {boolean} [options.primary] - Whether this is the primary link (in the panel title).
|
|
20
40
|
*/
|
|
21
|
-
const link = (slug, text, label) => {
|
|
41
|
+
const link = (slug, text, { label, primary = false } = {}) => {
|
|
22
42
|
const locale =
|
|
23
43
|
context.locale in MISSING_DOCS &&
|
|
24
44
|
MISSING_DOCS[context.locale]?.includes(slug)
|
|
@@ -34,20 +54,22 @@ export class Menu extends ServerComponent {
|
|
|
34
54
|
href=${href}
|
|
35
55
|
aria-label=${ifDefined(label)}
|
|
36
56
|
title=${ifDefined(label)}
|
|
57
|
+
data-glean-id=${gleanId(href, { primary })}
|
|
37
58
|
>${text}</a
|
|
38
59
|
>`;
|
|
39
60
|
};
|
|
40
61
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
62
|
+
const sections = [
|
|
63
|
+
{
|
|
64
|
+
id: "html",
|
|
65
|
+
render: () =>
|
|
66
|
+
html`<mdn-dropdown>
|
|
45
67
|
<button class="menu__tab-button" type="button" slot="button">
|
|
46
68
|
<span class="menu__tab-label">HTML</span>
|
|
47
69
|
</button>
|
|
48
70
|
<div class="menu__panel" slot="dropdown">
|
|
49
71
|
<p class="menu__panel-title">
|
|
50
|
-
${link("Web/HTML", "HTML: Markup language")}
|
|
72
|
+
${link("Web/HTML", "HTML: Markup language", { primary: true })}
|
|
51
73
|
</p>
|
|
52
74
|
<div class="menu__panel-content">
|
|
53
75
|
<dl>
|
|
@@ -67,11 +89,9 @@ export class Menu extends ServerComponent {
|
|
|
67
89
|
${link("Web/HTML/Reference/Attributes", "Attributes")}
|
|
68
90
|
</li>
|
|
69
91
|
<li>
|
|
70
|
-
${link(
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
"See all HTML references",
|
|
74
|
-
)}
|
|
92
|
+
${link("Web/HTML/Reference", "See all…", {
|
|
93
|
+
label: "See all HTML references",
|
|
94
|
+
})}
|
|
75
95
|
</li>
|
|
76
96
|
</ul>
|
|
77
97
|
</dd>
|
|
@@ -87,10 +107,7 @@ export class Menu extends ServerComponent {
|
|
|
87
107
|
)}
|
|
88
108
|
</li>
|
|
89
109
|
<li>
|
|
90
|
-
${link(
|
|
91
|
-
"Learn_web_development/Core/Structuring_content/HTML_video_and_audio",
|
|
92
|
-
"Video & audio content",
|
|
93
|
-
)}
|
|
110
|
+
${link("Web/HTML/Guides/Cheatsheet", "HTML cheatsheet")}
|
|
94
111
|
</li>
|
|
95
112
|
<li>
|
|
96
113
|
${link(
|
|
@@ -99,11 +116,9 @@ export class Menu extends ServerComponent {
|
|
|
99
116
|
)}
|
|
100
117
|
</li>
|
|
101
118
|
<li>
|
|
102
|
-
${link(
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
"See all HTML guides",
|
|
106
|
-
)}
|
|
119
|
+
${link("Web/HTML/Guides", "See all…", {
|
|
120
|
+
label: "See all HTML guides",
|
|
121
|
+
})}
|
|
107
122
|
</li>
|
|
108
123
|
</ul>
|
|
109
124
|
</dd>
|
|
@@ -120,16 +135,18 @@ export class Menu extends ServerComponent {
|
|
|
120
135
|
</dl>
|
|
121
136
|
</div>
|
|
122
137
|
</div>
|
|
123
|
-
</mdn-dropdown
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
</mdn-dropdown>`,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "css",
|
|
142
|
+
render: () =>
|
|
143
|
+
html`<mdn-dropdown>
|
|
127
144
|
<button class="menu__tab-button" type="button" slot="button">
|
|
128
145
|
<span class="menu__tab-label">CSS</span>
|
|
129
146
|
</button>
|
|
130
147
|
<div class="menu__panel" slot="dropdown">
|
|
131
148
|
<p class="menu__panel-title">
|
|
132
|
-
${link("Web/CSS", "CSS: Styling language")}
|
|
149
|
+
${link("Web/CSS", "CSS: Styling language", { primary: true })}
|
|
133
150
|
</p>
|
|
134
151
|
<div class="menu__panel-content">
|
|
135
152
|
<dl>
|
|
@@ -146,11 +163,9 @@ export class Menu extends ServerComponent {
|
|
|
146
163
|
)}
|
|
147
164
|
</li>
|
|
148
165
|
<li>
|
|
149
|
-
${link(
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
"See all CSS references",
|
|
153
|
-
)}
|
|
166
|
+
${link("Web/CSS/Reference", "See all…", {
|
|
167
|
+
label: "See all CSS references",
|
|
168
|
+
})}
|
|
154
169
|
</li>
|
|
155
170
|
</ul>
|
|
156
171
|
</dd>
|
|
@@ -161,7 +176,7 @@ export class Menu extends ServerComponent {
|
|
|
161
176
|
<ul>
|
|
162
177
|
<li>
|
|
163
178
|
${link(
|
|
164
|
-
"
|
|
179
|
+
"Web/CSS/CSS_box_model/Introduction_to_the_CSS_box_model",
|
|
165
180
|
"Box model",
|
|
166
181
|
)}
|
|
167
182
|
</li>
|
|
@@ -173,17 +188,15 @@ export class Menu extends ServerComponent {
|
|
|
173
188
|
</li>
|
|
174
189
|
<li>
|
|
175
190
|
${link(
|
|
176
|
-
"
|
|
191
|
+
"Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox",
|
|
177
192
|
"Flexbox",
|
|
178
193
|
)}
|
|
179
194
|
</li>
|
|
180
195
|
<li>${link("Web/CSS/CSS_colors", "Colors")}</li>
|
|
181
196
|
<li>
|
|
182
|
-
${link(
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
"See all CSS guides",
|
|
186
|
-
)}
|
|
197
|
+
${link("Web/CSS/Guides", "See all…", {
|
|
198
|
+
label: "See all CSS guides",
|
|
199
|
+
})}
|
|
187
200
|
</li>
|
|
188
201
|
</ul>
|
|
189
202
|
</dd>
|
|
@@ -216,17 +229,21 @@ export class Menu extends ServerComponent {
|
|
|
216
229
|
</dl>
|
|
217
230
|
</div>
|
|
218
231
|
</div>
|
|
219
|
-
</mdn-dropdown
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
232
|
+
</mdn-dropdown>`,
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "javascript",
|
|
236
|
+
render: () =>
|
|
237
|
+
html`<mdn-dropdown>
|
|
223
238
|
<button class="menu__tab-button" type="button" slot="button">
|
|
224
239
|
<span class="menu__tab-label" data-type="long">JavaScript</span>
|
|
225
240
|
<span class="menu__tab-label" data-type="short">JS</span>
|
|
226
241
|
</button>
|
|
227
242
|
<div class="menu__panel" slot="dropdown">
|
|
228
243
|
<p class="menu__panel-title">
|
|
229
|
-
${link("Web/JavaScript", "JavaScript: Scripting language"
|
|
244
|
+
${link("Web/JavaScript", "JavaScript: Scripting language", {
|
|
245
|
+
primary: true,
|
|
246
|
+
})}
|
|
230
247
|
</p>
|
|
231
248
|
<div class="menu__panel-content">
|
|
232
249
|
<dl>
|
|
@@ -258,11 +275,9 @@ export class Menu extends ServerComponent {
|
|
|
258
275
|
)}
|
|
259
276
|
</li>
|
|
260
277
|
<li>
|
|
261
|
-
${link(
|
|
262
|
-
"
|
|
263
|
-
|
|
264
|
-
"See all JavaScript references",
|
|
265
|
-
)}
|
|
278
|
+
${link("Web/JavaScript/Reference", "See all…", {
|
|
279
|
+
label: "See all JavaScript references",
|
|
280
|
+
})}
|
|
266
281
|
</li>
|
|
267
282
|
</ul>
|
|
268
283
|
</dd>
|
|
@@ -296,27 +311,29 @@ export class Menu extends ServerComponent {
|
|
|
296
311
|
)}
|
|
297
312
|
</li>
|
|
298
313
|
<li>
|
|
299
|
-
${link(
|
|
300
|
-
"
|
|
301
|
-
|
|
302
|
-
"See all JavaScript guides",
|
|
303
|
-
)}
|
|
314
|
+
${link("Web/JavaScript/Guide", "See all…", {
|
|
315
|
+
label: "See all JavaScript guides",
|
|
316
|
+
})}
|
|
304
317
|
</li>
|
|
305
318
|
</ul>
|
|
306
319
|
</dd>
|
|
307
320
|
</dl>
|
|
308
321
|
</div>
|
|
309
322
|
</div>
|
|
310
|
-
</mdn-dropdown
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
323
|
+
</mdn-dropdown>`,
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: "webapis",
|
|
327
|
+
render: () =>
|
|
328
|
+
html`<mdn-dropdown>
|
|
314
329
|
<button class="menu__tab-button" type="button" slot="button">
|
|
315
330
|
<span class="menu__tab-label">Web APIs</span>
|
|
316
331
|
</button>
|
|
317
332
|
<div class="menu__panel" slot="dropdown">
|
|
318
333
|
<p class="menu__panel-title">
|
|
319
|
-
${link("Web/API", "Web APIs: Programming interfaces"
|
|
334
|
+
${link("Web/API", "Web APIs: Programming interfaces", {
|
|
335
|
+
primary: true,
|
|
336
|
+
})}
|
|
320
337
|
</p>
|
|
321
338
|
<div class="menu__panel-content">
|
|
322
339
|
<dl>
|
|
@@ -339,7 +356,9 @@ export class Menu extends ServerComponent {
|
|
|
339
356
|
)}
|
|
340
357
|
</li>
|
|
341
358
|
<li>
|
|
342
|
-
${link("Web/API", "See all…",
|
|
359
|
+
${link("Web/API", "See all…", {
|
|
360
|
+
label: "See all Web API guides",
|
|
361
|
+
})}
|
|
343
362
|
</li>
|
|
344
363
|
</ul>
|
|
345
364
|
</dd>
|
|
@@ -383,16 +402,18 @@ export class Menu extends ServerComponent {
|
|
|
383
402
|
</dl>
|
|
384
403
|
</div>
|
|
385
404
|
</div>
|
|
386
|
-
</mdn-dropdown
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
405
|
+
</mdn-dropdown>`,
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: "all",
|
|
409
|
+
render: () =>
|
|
410
|
+
html`<mdn-dropdown>
|
|
390
411
|
<button class="menu__tab-button" type="button" slot="button">
|
|
391
412
|
<span class="menu__tab-label">All</span>
|
|
392
413
|
</button>
|
|
393
414
|
<div class="menu__panel" slot="dropdown">
|
|
394
415
|
<p class="menu__panel-title">
|
|
395
|
-
${link("Web", "All web technology")}
|
|
416
|
+
${link("Web", "All web technology", { primary: true })}
|
|
396
417
|
</p>
|
|
397
418
|
<div class="menu__panel-content">
|
|
398
419
|
<dl>
|
|
@@ -411,11 +432,9 @@ export class Menu extends ServerComponent {
|
|
|
411
432
|
<li>${link("WebAssembly", "WebAssembly")}</li>
|
|
412
433
|
<li>${link("Web/WebDriver", "WebDriver")}</li>
|
|
413
434
|
<li>
|
|
414
|
-
${link(
|
|
415
|
-
"
|
|
416
|
-
|
|
417
|
-
"See all web technology references",
|
|
418
|
-
)}
|
|
435
|
+
${link("Web", "See all…", {
|
|
436
|
+
label: "See all web technology references",
|
|
437
|
+
})}
|
|
419
438
|
</li>
|
|
420
439
|
</ul>
|
|
421
440
|
</dd>
|
|
@@ -439,16 +458,20 @@ export class Menu extends ServerComponent {
|
|
|
439
458
|
</dl>
|
|
440
459
|
</div>
|
|
441
460
|
</div>
|
|
442
|
-
</mdn-dropdown
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
461
|
+
</mdn-dropdown>`,
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
id: "learn",
|
|
465
|
+
render: () =>
|
|
466
|
+
html`<mdn-dropdown>
|
|
446
467
|
<button class="menu__tab-button" type="button" slot="button">
|
|
447
468
|
<span class="menu__tab-label">Learn</span>
|
|
448
469
|
</button>
|
|
449
470
|
<div class="menu__panel" slot="dropdown">
|
|
450
471
|
<p class="menu__panel-title">
|
|
451
|
-
${link("Learn_web_development", "Learn web development"
|
|
472
|
+
${link("Learn_web_development", "Learn web development", {
|
|
473
|
+
primary: true,
|
|
474
|
+
})}
|
|
452
475
|
</p>
|
|
453
476
|
<div class="menu__panel-content">
|
|
454
477
|
<dl>
|
|
@@ -475,6 +498,7 @@ export class Menu extends ServerComponent {
|
|
|
475
498
|
: "only-in-en-us",
|
|
476
499
|
)}
|
|
477
500
|
href="/en-US/curriculum/"
|
|
501
|
+
data-glean-id=${gleanId("/en-US/curriculum/")}
|
|
478
502
|
>Curriculum</a
|
|
479
503
|
>
|
|
480
504
|
</li>
|
|
@@ -540,10 +564,12 @@ export class Menu extends ServerComponent {
|
|
|
540
564
|
</dl>
|
|
541
565
|
</div>
|
|
542
566
|
</div>
|
|
543
|
-
</mdn-dropdown
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
567
|
+
</mdn-dropdown>`,
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
id: "tools",
|
|
571
|
+
render: () =>
|
|
572
|
+
html`<mdn-dropdown>
|
|
547
573
|
<button class="menu__tab-button" type="button" slot="button">
|
|
548
574
|
<span class="menu__tab-label">Tools</span>
|
|
549
575
|
</button>
|
|
@@ -556,6 +582,7 @@ export class Menu extends ServerComponent {
|
|
|
556
582
|
class="menu__panel-icon"
|
|
557
583
|
data-icon="circle-play"
|
|
558
584
|
href=${`/en-US/play`}
|
|
585
|
+
data-glean-id=${gleanId("/en-US/play/")}
|
|
559
586
|
>
|
|
560
587
|
Playground
|
|
561
588
|
</a>
|
|
@@ -565,6 +592,7 @@ export class Menu extends ServerComponent {
|
|
|
565
592
|
class="menu__panel-icon"
|
|
566
593
|
data-icon="shield-check"
|
|
567
594
|
href=${`/en-US/observatory`}
|
|
595
|
+
data-glean-id=${gleanId("/en-US/observatory/")}
|
|
568
596
|
>
|
|
569
597
|
HTTP Observatory
|
|
570
598
|
</a>
|
|
@@ -598,10 +626,12 @@ export class Menu extends ServerComponent {
|
|
|
598
626
|
</ul>
|
|
599
627
|
</div>
|
|
600
628
|
</div>
|
|
601
|
-
</mdn-dropdown
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
629
|
+
</mdn-dropdown>`,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
id: "about",
|
|
633
|
+
render: () =>
|
|
634
|
+
html`<mdn-dropdown>
|
|
605
635
|
<button class="menu__tab-button" type="button" slot="button">
|
|
606
636
|
<span class="menu__tab-label">About</span>
|
|
607
637
|
</button>
|
|
@@ -614,6 +644,7 @@ export class Menu extends ServerComponent {
|
|
|
614
644
|
class="menu__panel-icon"
|
|
615
645
|
data-icon="mdn-m"
|
|
616
646
|
href=${`/en-US/about`}
|
|
647
|
+
data-glean-id=${gleanId("/en-US/about")}
|
|
617
648
|
>
|
|
618
649
|
About MDN
|
|
619
650
|
</a>
|
|
@@ -623,6 +654,7 @@ export class Menu extends ServerComponent {
|
|
|
623
654
|
class="menu__panel-icon"
|
|
624
655
|
data-icon="chart-no-axes-combined"
|
|
625
656
|
href=${`/en-US/advertising`}
|
|
657
|
+
data-glean-id=${gleanId("/en-US/advertising")}
|
|
626
658
|
>
|
|
627
659
|
Advertise with us
|
|
628
660
|
</a>
|
|
@@ -634,6 +666,7 @@ export class Menu extends ServerComponent {
|
|
|
634
666
|
class="menu__panel-icon"
|
|
635
667
|
data-icon="users"
|
|
636
668
|
href=${`/en-US/community`}
|
|
669
|
+
data-glean-id=${gleanId("/en-US/community")}
|
|
637
670
|
>
|
|
638
671
|
Community
|
|
639
672
|
</a>
|
|
@@ -643,6 +676,7 @@ export class Menu extends ServerComponent {
|
|
|
643
676
|
class="menu__panel-icon"
|
|
644
677
|
data-icon="github"
|
|
645
678
|
href="https://github.com/mdn"
|
|
679
|
+
data-glean-id=${gleanId("https://github.com/mdn")}
|
|
646
680
|
>
|
|
647
681
|
MDN on GitHub
|
|
648
682
|
</a>
|
|
@@ -650,11 +684,30 @@ export class Menu extends ServerComponent {
|
|
|
650
684
|
</ul>
|
|
651
685
|
</div>
|
|
652
686
|
</div>
|
|
653
|
-
</mdn-dropdown
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
687
|
+
</mdn-dropdown>`,
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
id: "blog",
|
|
691
|
+
render: () =>
|
|
692
|
+
html`<a
|
|
693
|
+
class="menu__tab-link"
|
|
694
|
+
href=${`/en-US/blog/`}
|
|
695
|
+
data-glean-id=${`menu_click_link: top-level -> /en-US/blog/`}
|
|
696
|
+
>Blog</a
|
|
697
|
+
>`,
|
|
698
|
+
},
|
|
699
|
+
];
|
|
700
|
+
|
|
701
|
+
return html`
|
|
702
|
+
<nav class="menu">
|
|
703
|
+
${sections.map((section) => {
|
|
704
|
+
currentSection = section.id;
|
|
705
|
+
const result = html`<div class="menu__tab" data-section=${section.id}>
|
|
706
|
+
${section.render()}
|
|
707
|
+
</div>`;
|
|
708
|
+
currentSection = null;
|
|
709
|
+
return result;
|
|
710
|
+
})}
|
|
658
711
|
</nav>
|
|
659
712
|
`;
|
|
660
713
|
}
|
|
@@ -50,10 +50,10 @@ export class MDNPlacementBottom extends PlacementMixin(LitElement) {
|
|
|
50
50
|
<section class="placement-container">
|
|
51
51
|
<a
|
|
52
52
|
class="placement-link"
|
|
53
|
-
data-glean
|
|
53
|
+
data-glean-id=${`pong: pong->click top-banner`}
|
|
54
54
|
href=${this.clickLink(click, version)}
|
|
55
55
|
target="_blank"
|
|
56
|
-
rel="sponsored
|
|
56
|
+
rel="sponsored"
|
|
57
57
|
>
|
|
58
58
|
<img
|
|
59
59
|
src=${this.imgLink(image)}
|
|
@@ -50,10 +50,10 @@ export class MDNPlacementHpMain extends PlacementMixin(LitElement) {
|
|
|
50
50
|
<section class="placement-container">
|
|
51
51
|
<a
|
|
52
52
|
class="placement-link"
|
|
53
|
-
data-glean
|
|
53
|
+
data-glean-id=${`pong: pong->click top-banner`}
|
|
54
54
|
href=${this.clickLink(click, version)}
|
|
55
55
|
target="_blank"
|
|
56
|
-
rel="sponsored
|
|
56
|
+
rel="sponsored"
|
|
57
57
|
>
|
|
58
58
|
<img
|
|
59
59
|
src=${this.imgLink(image)}
|
|
@@ -45,7 +45,7 @@ class MDNPlacementNo extends L10nMixin(LitElement) {
|
|
|
45
45
|
return showNoAds
|
|
46
46
|
? html`<a
|
|
47
47
|
class="placement-no"
|
|
48
|
-
data-glean=${"pong: " +
|
|
48
|
+
data-glean-id=${"pong: " +
|
|
49
49
|
(user?.isSubscriber ? "pong->settings" : "pong->plus")}
|
|
50
50
|
href=${user?.isSubscriber
|
|
51
51
|
? "/en-US/plus/settings?ref=nope"
|
|
@@ -11,7 +11,7 @@ class MDNPlacementNote extends L10nMixin(LitElement) {
|
|
|
11
11
|
return html`<a
|
|
12
12
|
href="/en-US/advertising"
|
|
13
13
|
class="placement-note"
|
|
14
|
-
data-glean
|
|
14
|
+
data-glean-id=${`pong: pong->about`}
|
|
15
15
|
target="_blank"
|
|
16
16
|
rel="noreferrer"
|
|
17
17
|
>${this.l10n("placement-note")}</a
|
|
@@ -75,10 +75,10 @@ export class MDNPlacementSidebar extends PlacementMixin(LitElement) {
|
|
|
75
75
|
>
|
|
76
76
|
<a
|
|
77
77
|
class="placement-link"
|
|
78
|
-
data-glean
|
|
78
|
+
data-glean-id=${`pong: pong->click side`}
|
|
79
79
|
href=${this.clickLink(click, version)}
|
|
80
80
|
target="_blank"
|
|
81
|
-
rel="sponsored
|
|
81
|
+
rel="sponsored"
|
|
82
82
|
><img
|
|
83
83
|
src=${this.imgLink(image)}
|
|
84
84
|
aria-hidden=${!alt}
|
|
@@ -101,10 +101,10 @@ export class MDNPlacementSidebar extends PlacementMixin(LitElement) {
|
|
|
101
101
|
>
|
|
102
102
|
<a
|
|
103
103
|
class="placement-link"
|
|
104
|
-
data-glean
|
|
104
|
+
data-glean-id=${`pong: pong->click side`}
|
|
105
105
|
href=${this.clickLink(click, version)}
|
|
106
106
|
target="_blank"
|
|
107
|
-
rel="sponsored
|
|
107
|
+
rel="sponsored"
|
|
108
108
|
><img
|
|
109
109
|
src=${this.imgLink(image)}
|
|
110
110
|
aria-hidden=${!alt}
|
|
@@ -37,7 +37,7 @@ export class MDNPlacementTop extends PlacementMixin(LitElement) {
|
|
|
37
37
|
href="https://scrimba.com/learn/frontend?via=mdn"
|
|
38
38
|
target="_blank"
|
|
39
39
|
rel="noreferrer"
|
|
40
|
-
data-glean
|
|
40
|
+
data-glean-id=${`pong: pong->click fallback-scrimba`}
|
|
41
41
|
>
|
|
42
42
|
Scrimba
|
|
43
43
|
</a>
|
|
@@ -115,10 +115,10 @@ export class MDNPlacementTop extends PlacementMixin(LitElement) {
|
|
|
115
115
|
<div class="placement-inner">
|
|
116
116
|
<a
|
|
117
117
|
class="placement-link"
|
|
118
|
-
data-glean
|
|
118
|
+
data-glean-id=${`pong: pong->click top-banner`}
|
|
119
119
|
href=${this.clickLink(click, version)}
|
|
120
120
|
target="_blank"
|
|
121
|
-
rel="sponsored
|
|
121
|
+
rel="sponsored"
|
|
122
122
|
><div class="placement-content">
|
|
123
123
|
<img
|
|
124
124
|
src=${this.imgLink(image)}
|
|
@@ -142,10 +142,10 @@ export class MDNPlacementTop extends PlacementMixin(LitElement) {
|
|
|
142
142
|
<div class="placement-inner">
|
|
143
143
|
<a
|
|
144
144
|
class="placement-link"
|
|
145
|
-
data-glean
|
|
145
|
+
data-glean-id=${`pong: pong->click top-banner`}
|
|
146
146
|
href=${this.clickLink(click, version)}
|
|
147
147
|
target="_blank"
|
|
148
|
-
rel="sponsored
|
|
148
|
+
rel="sponsored"
|
|
149
149
|
><div class="placement-content">
|
|
150
150
|
<img
|
|
151
151
|
src=${this.imgLink(image)}
|
|
@@ -80,6 +80,7 @@ export class MDNPlayground extends L10nMixin(LitElement) {
|
|
|
80
80
|
controller
|
|
81
81
|
) {
|
|
82
82
|
controller.clear();
|
|
83
|
+
this._autoRun = true;
|
|
83
84
|
this._storeSession();
|
|
84
85
|
this.requestUpdate();
|
|
85
86
|
const urlWithoutSearch = new URL(location.href);
|
|
@@ -238,7 +239,7 @@ ${"```"}`,
|
|
|
238
239
|
permalink.search = new URLSearchParams({ id }).toString();
|
|
239
240
|
this._permalink = permalink.toString();
|
|
240
241
|
|
|
241
|
-
gleanClick("
|
|
242
|
+
gleanClick("play_action: load-shared");
|
|
242
243
|
const code = await response.json();
|
|
243
244
|
return stateToSession(code);
|
|
244
245
|
}
|
|
@@ -18,7 +18,7 @@ export class RecentContributions extends ServerComponent {
|
|
|
18
18
|
<a
|
|
19
19
|
class="external"
|
|
20
20
|
href=${contribution.repo.url}
|
|
21
|
-
data-glean=${`homepage: contribution_repo ${index + 1}`}
|
|
21
|
+
data-glean-id=${`homepage: contribution_repo ${index + 1}`}
|
|
22
22
|
>${contribution.repo.name}</a
|
|
23
23
|
>
|
|
24
24
|
</span>
|
|
@@ -89,7 +89,7 @@ export class MDNScrimInline extends LitElement {
|
|
|
89
89
|
target="_blank"
|
|
90
90
|
rel="origin noreferrer"
|
|
91
91
|
class="external"
|
|
92
|
-
data-glean="curriculum: scrim link id:${this._scrimId}"
|
|
92
|
+
data-glean-id="curriculum: scrim link id:${this._scrimId}"
|
|
93
93
|
>
|
|
94
94
|
<div class="scrim-link"></div>
|
|
95
95
|
<span class="visually-hidden">Open on Scrimba</span>
|
|
@@ -123,7 +123,7 @@ export class MDNScrimInline extends LitElement {
|
|
|
123
123
|
<button
|
|
124
124
|
@click=${this.#open}
|
|
125
125
|
class="open"
|
|
126
|
-
data-glean=${`curriculum: scrim engage id:${this._scrimId}`}
|
|
126
|
+
data-glean-id=${`curriculum: scrim engage id:${this._scrimId}`}
|
|
127
127
|
>
|
|
128
128
|
${playSvg}
|
|
129
129
|
<span class="visually-hidden">
|
package/l10n/en-US.ftl
CHANGED
|
@@ -108,8 +108,11 @@ compat-support-flags =
|
|
|
108
108
|
[one] {" "}to <code data-l10n-name="value">{ $flag_value }</code>
|
|
109
109
|
*[other] {""}
|
|
110
110
|
}{"."}
|
|
111
|
-
{ $
|
|
112
|
-
[
|
|
111
|
+
{ NUMBER($has_pref_url) ->
|
|
112
|
+
[one] { $flag_type ->
|
|
113
|
+
[preference] To change preferences in { $browser_name }, visit { $browser_pref_url }.
|
|
114
|
+
*[other] {""}
|
|
115
|
+
}
|
|
113
116
|
*[other] {""}
|
|
114
117
|
}
|
|
115
118
|
|