Skip to content

Commit 9542ccd

Browse files
committed
Update clog.js
1 parent 287f3bd commit 9542ccd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎js/clog.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,16 +564,21 @@ function handleScrollProgress() {
564564

565565
function shareCurrentPost() {
566566
if (!currentArticleId) return;
567+
567568
const dbEntry = indexData.find(item => item.Article === currentArticleId);
568569
const shareTitle = dbEntry ? dbEntry.Name : "MainRoute Core Clog";
569570
const shareUrl = window.location.href;
571+
572+
const shareText = `Read ${shareTitle}\n==>\n${shareUrl}`;
573+
570574
if (navigator.share) {
571575
navigator.share({
572576
title: shareTitle,
577+
text: shareText,
573578
url: shareUrl
574579
}).catch(() => { });
575580
} else {
576-
navigator.clipboard.writeText(shareUrl).then(() => {
581+
navigator.clipboard.writeText(shareText).then(() => {
577582
const btn = document.querySelector('#full-meta-block button[onclick="shareCurrentPost()"]');
578583
if (btn) {
579584
const originalText = btn.innerHTML;

0 commit comments

Comments
 (0)