From 9c5978e85bd85a02a115acd1657e622cbb0e2fc0 Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Thu, 19 Sep 2024 02:09:46 +0530 Subject: [PATCH] copy: Use redesigned copy button in codeblocks of /help docs. Fixes #28700. --- web/src/portico/help.ts | 30 +++++++++-------------- web/styles/portico/markdown.css | 32 +++++++++++++++++++++++-- web/templates/copy_to_clipboard_svg.hbs | 3 --- web/templates/zulip_copy_icon.hbs | 1 + 4 files changed, 42 insertions(+), 24 deletions(-) delete mode 100644 web/templates/copy_to_clipboard_svg.hbs create mode 100644 web/templates/zulip_copy_icon.hbs diff --git a/web/src/portico/help.ts b/web/src/portico/help.ts index a448a10797..395d0ad464 100644 --- a/web/src/portico/help.ts +++ b/web/src/portico/help.ts @@ -1,10 +1,12 @@ import ClipboardJS from "clipboard"; import $ from "jquery"; +import assert from "minimalistic-assert"; import SimpleBar from "simplebar"; import * as tippy from "tippy.js"; -import copy_to_clipboard_svg from "../../templates/copy_to_clipboard_svg.hbs"; +import zulip_copy_icon from "../../templates/zulip_copy_icon.hbs"; import * as common from "../common"; +import {show_copied_confirmation} from "../copied_tooltip"; import * as util from "../util"; import {activate_correct_tab} from "./tabbed-instructions"; @@ -33,8 +35,8 @@ function register_tabbed_section($tabbed_section: JQuery): void { // Display the copy-to-clipboard button inside the .codehilite element // within the API and Help Center docs using clipboard.js function add_copy_to_clipboard_element($codehilite: JQuery): void { - const $copy_button = $("