feat(pay): show 点击复制{copy name} tooltip on the remark button

Hovering the remark gave no affordance hint that it copies anything. The
reference theme titles the same button 点击复制{copy name} and omits the
tooltip entirely when no copy name is configured.

Emit data-toggle="tooltip" with that title on both copy buttons, gated on a
non-empty copy name, and mirror it on the paid-card helper so the two
surfaces agree. Bootstrap's tooltip init already runs in auto_fun() on load,
which is where the clipboard lib is required too.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 21:30:05 +08:00
co-authored by Claude Sonnet 4.6
parent 63b5edd901
commit 7f60071460
3 changed files with 15 additions and 1 deletions
@@ -62,6 +62,18 @@ test('the download box renders direct anchors with inline extract codes', () =>
// Mobile download bar scopes its own copy-button rule.
assert.match(css, /\.resource-mobile-download-bar \.resource-download-box__btn--extract \{/);
// Hovering the remark shows 点击复制{copy name}, matching the reference theme,
// and only when a copy name exists.
assert.match(box, /\$has_copy && \$copy_key !== ''\) : \?>/);
assert.match(box, /sprintf\(__\('点击复制%s', 'aksrt'\), \$copy_key\)/);
assert.match(box, /data-toggle="tooltip"/);
const pay = read('inc/helpers/aksrt-pay.php');
assert.match(pay, /sprintf\(__\('点击复制%s', 'aksrt'\), \$copy_key\)/);
// Bootstrap tooltips must be initialized for the attribute to do anything.
const main = read('assets/js/runtime/main.js');
assert.match(main, /jQuery\("\[data-toggle='tooltip'\]"\)\.tooltip\(/);
assert.match(main, /^auto_fun\(\);/m);
// The login gate keeps its own anchor.
assert.match(box, /\$btn_href = \$login_url;/);
});