diff --git a/web/src/portico/help.js b/web/src/portico/help.js index 4e584ebba0..9978b4e26d 100644 --- a/web/src/portico/help.js +++ b/web/src/portico/help.js @@ -14,13 +14,13 @@ function registerCodeSection($codeSection) { const $blocks = $codeSection.find(".blocks div"); $li.on("click", function () { - const language = this.dataset.language; + const tab_key = this.dataset.tabKey; $li.removeClass("active"); - $li.filter("[data-language=" + language + "]").addClass("active"); + $li.filter("[data-tab-key=" + tab_key + "]").addClass("active"); $blocks.removeClass("active"); - $blocks.filter("[data-language=" + language + "]").addClass("active"); + $blocks.filter("[data-tab-key=" + tab_key + "]").addClass("active"); }); $li.on("keydown", (e) => { diff --git a/web/src/portico/tabbed-instructions.ts b/web/src/portico/tabbed-instructions.ts index 68facbdef2..f8cd20113e 100644 --- a/web/src/portico/tabbed-instructions.ts +++ b/web/src/portico/tabbed-instructions.ts @@ -31,25 +31,25 @@ export function activate_correct_tab($codeSection: JQuery): void { const $blocks = $codeSection.find(".blocks div"); $li.each(function () { - const language = this.dataset.language; + const tab_key = this.dataset.tabKey; $(this).removeClass("active"); - if (language === user_os) { + if (tab_key === user_os) { $(this).addClass("active"); } - if (desktop_os.has(user_os) && language === "desktop-web") { + if (desktop_os.has(user_os) && tab_key === "desktop-web") { $(this).addClass("active"); } }); $blocks.each(function () { - const language = this.dataset.language; + const tab_key = this.dataset.tabKey; $(this).removeClass("active"); - if (language === user_os) { + if (tab_key === user_os) { $(this).addClass("active"); } - if (desktop_os.has(user_os) && language === "desktop-web") { + if (desktop_os.has(user_os) && tab_key === "desktop-web") { $(this).addClass("active"); } }); @@ -58,9 +58,9 @@ export function activate_correct_tab($codeSection: JQuery): void { const $active_list_items = $li.filter(".active"); if (!$active_list_items.length) { $li.first().addClass("active"); - const language = $li.first()[0].dataset.language; - if (language) { - $blocks.filter("[data-language=" + language + "]").addClass("active"); + const tab_key = $li.first()[0].dataset.tabKey; + if (tab_key) { + $blocks.filter("[data-tab-key=" + tab_key + "]").addClass("active"); } else { blueslip.error("Tabbed instructions widget has no tabs to activate!"); } diff --git a/zerver/lib/markdown/tabbed_sections.py b/zerver/lib/markdown/tabbed_sections.py index 1dc27fd384..555b8d1d62 100644 --- a/zerver/lib/markdown/tabbed_sections.py +++ b/zerver/lib/markdown/tabbed_sections.py @@ -27,11 +27,11 @@ NAV_BAR_TEMPLATE = """ """.strip() NAV_LIST_ITEM_TEMPLATE = """ -
  • {label}
  • +
  • {label}
  • """.strip() DIV_TAB_CONTENT_TEMPLATE = """ -
    +
    {content}
    """.strip() diff --git a/zerver/tests/test_templates.py b/zerver/tests/test_templates.py index a920baafe2..7c658585bd 100644 --- a/zerver/tests/test_templates.py +++ b/zerver/tests/test_templates.py @@ -38,14 +38,14 @@ header

    -

    +

    iOS instructions

    -

    +

    Desktop/browser instructions

    @@ -56,14 +56,14 @@ header

    -

    +

    Desktop/browser instructions

    -

    +

    Android instructions

    @@ -74,10 +74,10 @@ header

    -

    +

    Instructions for all platforms