Skip to content

Commit

Permalink
Update src/groups/zh/checkuser/MediaWiki:Group-checkuser.js
Browse files Browse the repository at this point in the history
Co-authored-by: AnnAngela <[email protected]>
  • Loading branch information
lovelyCARDINAL and AnnAngela authored Oct 29, 2023
1 parent 2dbb959 commit 7c41a43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/groups/zh/checkuser/MediaWiki:Group-checkuser.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@
const $copyButton = $(`<a class="section-username-list" title="共${userlist.length}个用户名">复制用户列表</a>`);
$bar.find(".mw-editsection-bracket").first().after($divider).after($copyButton);

let lastClicked = -1;
$copyButton.on("click", () => {
navigator.clipboard.writeText(userlist.join("\n"));
$copyButton.text("复制列表成功");
lastClicked = Date.now() + 2000 - 2;
setTimeout(() => {
$copyButton.text("复制用户列表");
if (Date.now() > lastClicked) {
$copyButton.text("复制用户列表");
}
}, 2000);
});

Expand Down

0 comments on commit 7c41a43

Please sign in to comment.