diff --git a/web/src/portico/help.ts b/web/src/portico/help.ts index 6e9aaa3f66..e658f6deb5 100644 --- a/web/src/portico/help.ts +++ b/web/src/portico/help.ts @@ -9,8 +9,6 @@ import * as common from "../common.ts"; import {show_copied_confirmation} from "../copied_tooltip.ts"; import * as util from "../util.ts"; -import {activate_correct_tab} from "./tabbed-instructions.ts"; - function register_tabbed_section($tabbed_section: JQuery): void { const $li = $tabbed_section.find("ul.nav li"); const $blocks = $tabbed_section.find(".blocks div"); @@ -66,7 +64,6 @@ function add_copy_to_clipboard_element($codehilite: JQuery): void { function render_tabbed_sections(): void { $(".tabbed-section").each(function () { - activate_correct_tab($(this)); register_tabbed_section($(this)); }); diff --git a/web/src/portico/tabbed-instructions.ts b/web/src/portico/tabbed-instructions.ts index f4a588eedc..b49349e14a 100644 --- a/web/src/portico/tabbed-instructions.ts +++ b/web/src/portico/tabbed-instructions.ts @@ -1,8 +1,4 @@ -import $ from "jquery"; - -import * as blueslip from "../blueslip.ts"; import * as common from "../common.ts"; -import * as util from "../util.ts"; export type UserOS = "android" | "ios" | "mac" | "windows" | "linux"; @@ -24,50 +20,3 @@ export function detect_user_os(): UserOS { } return "mac"; // if unable to determine OS return Mac by default } - -export function activate_correct_tab($tabbed_section: JQuery): void { - const user_os = detect_user_os(); - const desktop_os = new Set(["mac", "linux", "windows"]); - const $li = $tabbed_section.find("ul.nav li"); - const $blocks = $tabbed_section.find(".blocks div"); - - $li.each(function () { - const tab_key = this.dataset.tabKey; - $(this).removeClass("active"); - if (tab_key === user_os) { - $(this).addClass("active"); - } - - if (desktop_os.has(user_os) && tab_key === "desktop-web") { - $(this).addClass("active"); - } - }); - - $blocks.each(function () { - const tab_key = this.dataset.tabKey; - $(this).removeClass("active"); - if (tab_key === user_os) { - $(this).addClass("active"); - } - - if (desktop_os.has(user_os) && tab_key === "desktop-web") { - $(this).addClass("active"); - } - }); - - // if no tab was activated, just activate the first one - const $active_list_items = $li.filter(".active"); - if ($active_list_items.length === 0) { - $li.first().addClass("active"); - const tab_key = util.the($li.first()).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!"); - } - } -} - -$(".tabbed-section").each(function () { - activate_correct_tab($(this)); -}); diff --git a/web/webpack.assets.json b/web/webpack.assets.json index 0ab41dbf2f..85d131672e 100644 --- a/web/webpack.assets.json +++ b/web/webpack.assets.json @@ -49,8 +49,7 @@ "./src/bundles/portico.ts", "simplebar/dist/simplebar.css", "simplebar", - "./src/portico/help.ts", - "./src/portico/tabbed-instructions.ts" + "./src/portico/help.ts" ], "landing-page": [ "./src/bundles/portico.ts", diff --git a/zerver/lib/markdown/tabbed_sections.py b/zerver/lib/markdown/tabbed_sections.py index 41cad230d3..ad6aa5b8c0 100644 --- a/zerver/lib/markdown/tabbed_sections.py +++ b/zerver/lib/markdown/tabbed_sections.py @@ -29,11 +29,11 @@ NAV_BAR_TEMPLATE = """ """.strip() NAV_LIST_ITEM_TEMPLATE = """ -
iOS instructions
Desktop/browser instructions
Instructions for all platforms