Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Updating sidebars to use details/summary #789

Merged
merged 24 commits into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
eba7a81
Updating sidebars to use details/summary
tkadlec Aug 29, 2018
f676677
Updating macros tests
tkadlec Aug 29, 2018
aa59a9a
adding missing closing tags for the list items
tkadlec Sep 9, 2018
4fee422
Merge branch 'bug/258-moztogglr-reflow' of https://github.com/tkadlec…
tkadlec Sep 9, 2018
07dd2ec
Removing empty line, indentation fix
tkadlec Sep 9, 2018
40ee1bf
HTTPS links in the HTML Quick Links sidebar
tkadlec Sep 9, 2018
742c06e
Cleaning up JS, HTTPS and MDN sidebars
tkadlec Sep 9, 2018
621f68a
Clean up nsprapiref sidebar
tkadlec Sep 9, 2018
062fb9c
Tidying up tools and rtc sidebars
tkadlec Sep 9, 2018
0cdcd0f
Adding global attributes section back
tkadlec Sep 9, 2018
e74eea3
Elements to HTMLElements
tkadlec Sep 9, 2018
089f871
Removing unnecssary data-default-state
tkadlec Sep 9, 2018
3e9a346
Closing details tag
tkadlec Sep 9, 2018
00fa08a
adding details element to eventref
tkadlec Sep 9, 2018
f497335
AddOnSidebar fixes
tkadlec Sep 27, 2018
b57999a
Fixing Spider Monkey sidebar
tkadlec Sep 27, 2018
76ea6ca
Fixing ejs errors in eventref
tkadlec Sep 27, 2018
4929ac5
Fixing ejs errors in jsctypes sidebar
tkadlec Sep 27, 2018
6e83b36
HTML Elements toggleable
tkadlec Sep 27, 2018
01d9e2a
Fixing ejs errors on HTTPSidebar
tkadlec Sep 27, 2018
3a5de95
Fixing error in SpiderMonkeySidebar
tkadlec Sep 27, 2018
70cb9f2
Fixing formatting
tkadlec Sep 27, 2018
4cd5ba9
Escaping in HTML sidebar
tkadlec Sep 27, 2018
7d1855e
Merge branch 'master' into bug/258-moztogglr-reflow
tkadlec Sep 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions macros/APIRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ var badges = {
}

function buildSublist(pages, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';
jwhitlock marked this conversation as resolved.
Show resolved Hide resolved

for (var i in pages) {
var aPage = pages[i];
Expand Down Expand Up @@ -201,32 +201,32 @@ function buildSublist(pages, title) {
result += '</li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildIFList(interfaces, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < interfaces.length; i++) {
var url = interfaces[i].replace('()', '').replace('.', '/');
result += '<li><a href="' + APIHref + '/' + url + '"><code>' + interfaces[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildEventList(events, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < events.length; i++) {
result += '<li><a href="' + EventHref + '/' + events[i] + '"><code>' + events[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}
Expand Down
266 changes: 147 additions & 119 deletions macros/AddonSidebar.ejs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions macros/CSSRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ if (slug) {
}

function buildSublist(pages, title, noCodeTags) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the difference for {CSSRef} on the page https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function (👍 correctly converted):

pr 789 cssref

The whitespace is slightly different, and the bold text for the title, but these are not significant changes.

var code = !noCodeTags ? '<code>' : '';
var endcode = !noCodeTags ? '</code>' : '';

Expand Down Expand Up @@ -256,7 +256,7 @@ if (slug) {
result += '</li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}
Expand Down
101 changes: 58 additions & 43 deletions macros/CanvasSidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -102,54 +102,69 @@ var text = mdn.localStringMap({
<section id="Quick_Links">
<ol>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API"><strong><%=text['Canvas_API']%></strong></a></li>
<li data-default-state="open"><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial"><strong><%=text['Canvas_tutorial']%></strong></a>
<ol>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Basic_usage"><%=text['Basic_usage']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes"><%=text['Drawing_shapes']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Applying_styles_and_colors"><%=text['Applying']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Drawing_text"><%=text['Text']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Using_images"><%=text['Using_images']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Transformations"><%=text['Transformations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Compositing"><%=text['Compositing']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Basic_animations"><%=text['Basic_animations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Advanced_animations"><%=text['Advanced_animations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas"><%=text['Pixel_manipulation']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Hit_regions_and_accessibility"><%=text['Hitregions']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas"><%=text['Optimizing']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Finale"><%=text['Finale']%></a></li>
</ol>
<li class="toggle">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the {{CanvasSidebar}} on https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes. It looks good 👍. The section headers are no longer bold, and the spacing is a little different. The scraper always enables the black Jump Bar, but it is off on the production page.

pr 789 canvas sidebar

<details open>
<summary><%=text['Canvas_tutorial']%></summary>
<ol>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Basic_usage"><%=text['Basic_usage']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes"><%=text['Drawing_shapes']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Applying_styles_and_colors"><%=text['Applying']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Drawing_text"><%=text['Text']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Using_images"><%=text['Using_images']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Transformations"><%=text['Transformations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Compositing"><%=text['Compositing']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Basic_animations"><%=text['Basic_animations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Advanced_animations"><%=text['Advanced_animations']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas"><%=text['Pixel_manipulation']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Hit_regions_and_accessibility"><%=text['Hitregions']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas"><%=text['Optimizing']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Tutorial/Finale"><%=text['Finale']%></a></li>
</ol>
</details>
</li>
<li data-default-state="open"><a href="#"><strong><%=text['Examples']%></strong></a>
<ol>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/A_basic_ray-caster"><%=text['raycaster']%></a></li>
<li><a href="/<%=locale%>/Add-ons/Code_snippets/Canvas"><%=text['snippets']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas"><%=text['dom_canvas']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Manipulating_video_using_canvas"><%=text['video_canvas']%></a></li>
</ol>
<li class="toggle">
<details open>
<summary><%=text['Examples']%></summary>
<ol>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/A_basic_ray-caster"><%=text['raycaster']%></a></li>
<li><a href="/<%=locale%>/Add-ons/Code_snippets/Canvas"><%=text['snippets']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas"><%=text['dom_canvas']%></a></li>
<li><a href="/<%=locale%>/docs/Web/API/Canvas_API/Manipulating_video_using_canvas"><%=text['video_canvas']%></a></li>
</ol>
</details>
</li>
<li data-default-state="open"><a href="#"><strong><%=text['Interfaces']%></strong></a>
<ol>
<li><%-template("domxref", ["HTMLCanvasElement"])%></li>
<li><%-template("domxref", ["CanvasRenderingContext2D"])%></li>
<li><%-template("domxref", ["CanvasGradient"])%></li>
<li><%-template("domxref", ["CanvasPattern"])%></li>
<li><%-template("domxref", ["ImageBitmap"])%></li>
<li><%-template("domxref", ["ImageData"])%></li>
<li><%-template("domxref", ["TextMetrics"])%></li>
<li><span class="sidebar-icon"><%-template("ExperimentalBadge", [1])%></span> <%-template("domxref", ["Path2D"])%></li>
</ol>
<li class="toggle">
<details open>
<summary><%=text['Interfaces']%></summary>
<ol>
<li><%-template("domxref", ["HTMLCanvasElement"])%></li>
<li><%-template("domxref", ["CanvasRenderingContext2D"])%></li>
<li><%-template("domxref", ["CanvasGradient"])%></li>
<li><%-template("domxref", ["CanvasPattern"])%></li>
<li><%-template("domxref", ["ImageBitmap"])%></li>
<li><%-template("domxref", ["ImageData"])%></li>
<li><%-template("domxref", ["TextMetrics"])%></li>
<li><span class="sidebar-icon"><%-template("ExperimentalBadge", [1])%></span> <%-template("domxref", ["Path2D"])%></li>
</ol>
</details>
</li>
<li><strong><a href="/<%=locale%>/docs/MDN"><%=text['Documentation']%></a></strong></li>
<li data-default-state="<%=state('Useful lists')%>"><a href="#"><%=text['Useful_lists']%></a>
<ol>
<li><a href="/<%=locale%>/docs/tag/Canvas"><%=text['Canvas_tag']%></a></li>
</ol>
<li class="toggle">
<details <%=state('Useful_lists')%>>
<summary><%=text['Useful_lists']%></summary>
<ol>
<li><a href="/<%=locale%>/docs/tag/Canvas"><%=text['Canvas_tag']%></a></li>
</ol>
</details>
</li>
<li data-default-state="<%=state('Contribute')%>"><a href="#"><%=text['Contribute']%></a>
<ol>
<li><a href="/<%=locale%>/docs/MDN/Doc_status/API/Canvas"><%=text['Doc_status']%></a></li>
<li><a href="/<%=locale%>/docs/MDN"><%=text['The_MDN_project']%></a></li>
</ol>
<li class="toggle">
<details <%=state('Contribute')%>>
<summary><%=text['Contribute']%></summary>
<ol>
<li><a href="/<%=locale%>/docs/MDN/Doc_status/API/Canvas"><%=text['Doc_status']%></a></li>
<li><a href="/<%=locale%>/docs/MDN"><%=text['The_MDN_project']%></a></li>
</ol>
</details>
</li>
</ol>
</section>
12 changes: 6 additions & 6 deletions macros/DefaultAPISidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (webAPIGroups[0][group].overview) {
}

function buildSublist(pages, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the {{DefaultAPISidebar}} sidebar on https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events, it looks correct 👍 with minor whitespace changes:

pr 789 defaultapisidebar


for (var i in pages) {
var aPage = pages[i];
Expand Down Expand Up @@ -75,32 +75,32 @@ function buildSublist(pages, title) {
result += '</li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildIFList(interfaces, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < interfaces.length; i++) {
var url = interfaces[i].replace('()', '').replace('.', '/');
result += '<li><a href="' + APIHref + '/' + url + '"><code>' + interfaces[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildEventList(events, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < events.length; i++) {
result += '<li><a href="' + EventHref + '/' + events[i] + '"><code>' + events[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}
Expand Down
77 changes: 48 additions & 29 deletions macros/DocStatusQuickLinks.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -81,40 +81,59 @@ var titleValues = mdn.localStringMap({
<li><strong><a href="/<%=env.locale%>/docs/MDN/Doc_status/Overview"><%=titleValues['Overview']%></a></strong></li>
<li><strong><%=titleValues['Sections']%>:</strong></li>
<ol>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Accessibility"><%=titleValues['Accessibility']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/API"><%=titleValues['API']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Apps"><%=titleValues['Apps']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/CSS"><%=titleValues['CSS']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/DevTools"><%=titleValues['DevTools']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Firefox_OS"><%=titleValues['Firefox_OS']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Games"><%=titleValues['Games']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/HTML"><%=titleValues['HTML']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/JavaScript"><%=titleValues['JavaScript']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Marketplace"><%=titleValues['Marketplace']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/MathML"><%=titleValues['MathML']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/SVG"><%=titleValues['SVG']%></a>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Accessibility"><%=titleValues['Accessibility']%></a></li>
Copy link
Contributor

@jwhitlock jwhitlock Sep 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{DocStatusQuickLinks}} looks good 👍. Indentation of multi-line summaries is different.

pr 789 docstatusquicklinks

Update Same results on latest code, with the closing </li> tags, on https://developer.mozilla.org/en-US/docs/MDN/Doc_status/Guide:

pr 789 docstatusquicklinks 2

<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/API"><%=titleValues['API']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Apps"><%=titleValues['Apps']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/CSS"><%=titleValues['CSS']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/DevTools"><%=titleValues['DevTools']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Firefox_OS"><%=titleValues['Firefox_OS']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Games"><%=titleValues['Games']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/HTML"><%=titleValues['HTML']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/JavaScript"><%=titleValues['JavaScript']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/Marketplace"><%=titleValues['Marketplace']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/MathML"><%=titleValues['MathML']%></a></li>
<li><a href="/<%=env.locale%>/docs/MDN/Doc_status/SVG"><%=titleValues['SVG']%></a></li>
</ol>
</li>
<li><strong><%=titleValues['Maintenance_pages']%>:</strong></li>
<ol>
<li><a href="/<%=env.locale%>/docs/needs-review/editorial"><%=titleValues['Editorial_reviews']%></a></li>
<li><a href="/<%=env.locale%>/docs/needs-review/technical"><%=titleValues['Technical_reviews']%></a></li>
<li><a href="/<%=env.locale%>/docs/with-errors"><%=titleValues['with-errors']%></a></li>
<li><a href="/<%=env.locale%>/docs/without-parent"><%=titleValues['without-parent']%></a></li>
<li><a href="/<%=env.locale%>/docs/top-level"><%=titleValues['top-level']%></a></li>
</ol>
<li class="toggle">
<details>
<summary><%=titleValues['Maintenance_pages']%>:</summary>
<ol>
<li><a href="/<%=env.locale%>/docs/needs-review/editorial"><%=titleValues['Editorial_reviews']%></a></li>
<li><a href="/<%=env.locale%>/docs/needs-review/technical"><%=titleValues['Technical_reviews']%></a></li>
<li><a href="/<%=env.locale%>/docs/with-errors"><%=titleValues['with-errors']%></a></li>
<li><a href="/<%=env.locale%>/docs/without-parent"><%=titleValues['without-parent']%></a></li>
<li><a href="/<%=env.locale%>/docs/top-level"><%=titleValues['top-level']%></a></li>
</ol>
</details>
</li>
<li class="toggle">
<details>
<summary><%=titleValues['Localizations']%>:</summary>
<ol>
<li><a href="/bn-BD/docs/MDN/Doc_status/Overview">বাংলা (বাংলাদেশ) (bn-BD)</a>
<li><a href="/de/docs/MDN/Doc_status/Overview">Deutsch (de)</a>
<li><a href="/es/docs/MDN/Doc_status/Overview">Español (es)</a>
<li><a href="/fr/docs/MDN/Doc_status/Overview">Français (fr)</a>
<li><a href="/ja/docs/MDN/Doc_status/Overview">日本語 (ja)</a>
<li><a href="/pl/docs/MDN/Doc_status/Overview">Polski (pl)</a>
<li><a href="/pt-BR/docs/MDN/Doc_status/Overview">Português (do Brasil) (pt-BR)</a>
<li><a href="/ru/docs/MDN/Doc_status/Overview">Русский (ru)</a>
<li><a href="/zh-CN/docs/MDN/Doc_status/Overview">中文 (简体) (zh-CN)</a>
tkadlec marked this conversation as resolved.
Show resolved Hide resolved
</ol>
</details>
</li>
<li><strong><%=titleValues['Localizations']%>:</strong></li>
<ol>
<li><a href="/bn-BD/docs/MDN/Doc_status/Overview">বাংলা (বাংলাদেশ) (bn-BD)</a>
<li><a href="/de/docs/MDN/Doc_status/Overview">Deutsch (de)</a>
<li><a href="/es/docs/MDN/Doc_status/Overview">Español (es)</a>
<li><a href="/fr/docs/MDN/Doc_status/Overview">Français (fr)</a>
<li><a href="/ja/docs/MDN/Doc_status/Overview">日本語 (ja)</a>
<li><a href="/pl/docs/MDN/Doc_status/Overview">Polski (pl)</a>
<li><a href="/pt-BR/docs/MDN/Doc_status/Overview">Português (do Brasil) (pt-BR)</a>
<li><a href="/ru/docs/MDN/Doc_status/Overview">Русский (ru)</a>
<li><a href="/zh-CN/docs/MDN/Doc_status/Overview">中文 (简体) (zh-CN)</a>
<li><a href="/bn-BD/docs/MDN/Doc_status/Overview">বাংলা (বাংলাদেশ) (bn-BD)</a></li>
<li><a href="/de/docs/MDN/Doc_status/Overview">Deutsch (de)</a></li>
<li><a href="/es/docs/MDN/Doc_status/Overview">Español (es)</a></li>
<li><a href="/fr/docs/MDN/Doc_status/Overview">Français (fr)</a></li>
<li><a href="/ja/docs/MDN/Doc_status/Overview">日本語 (ja)</a></li>
<li><a href="/pl/docs/MDN/Doc_status/Overview">Polski (pl)</a></li>
<li><a href="/pt-BR/docs/MDN/Doc_status/Overview">Português (do Brasil) (pt-BR)</a></li>
<li><a href="/ru/docs/MDN/Doc_status/Overview">Русский (ru)</a></li>
<li><a href="/zh-CN/docs/MDN/Doc_status/Overview">中文 (简体) (zh-CN)</a></li>
</ol>
</ol>
</section>
12 changes: 6 additions & 6 deletions macros/FirefoxOSAPIRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var badges = {
}

function buildSublist(pages, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{FirefoxOSAPIRef}} is deprecated, and also correct 👍. Screenshot from https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/API/DataStore/get.

pr 789 firefoxosapiref


for (var i in pages) {
var aPage = pages[i];
Expand Down Expand Up @@ -200,34 +200,34 @@ function buildSublist(pages, title) {
result += '</li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildIFList(interfaces, title, slug) {

var slug = slug || APIHref;
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < interfaces.length; i++) {
var url = interfaces[i].replace('()', '').replace('.', '/');
result += '<li><a href="' + slug + '/' + url + '"><code>' + interfaces[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}

function buildEventList(events, title) {
var result = '<li data-default-state="open"><a href="#"><strong>' + title + '</strong></a><ol>';
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';

for (var i = 0; i < events.length; i++) {
result += '<li><a href="' + EventHref + '/' + events[i] + '"><code>' + events[i] + '</code></a></li>';
}

result += '</ol></li>';
result += '</ol></details></li>';

return result;
}
Expand Down
Loading