@teamsparta/blog-system
Version:
34 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shareStoryWithKakao = exports.shareFacebook = exports.copyUrl = void 0;
function copyUrl(currentUrl) {
navigator.clipboard
.writeText(currentUrl)
.then(function () {
alert("링크가 클립보드에 복사되었어요.");
})
.catch(function () {
alert("링크 복사에 문제가 생겼어요.");
});
}
exports.copyUrl = copyUrl;
function shareFacebook(currentUrl) {
window.open("http://www.facebook.com/sharer.php?u=".concat(currentUrl));
}
exports.shareFacebook = shareFacebook;
var shareStoryWithKakao = function (kakaoInfo) {
var storyTitle = kakaoInfo.storyTitle, ogImage = kakaoInfo.ogImage, storyCategory = kakaoInfo.storyCategory, url = kakaoInfo.url;
var Kakao = window.Kakao;
Kakao.Link.sendScrap({
requestUrl: url,
templateId: 86671,
templateArgs: {
storyTitle: storyTitle,
ogImage: ogImage,
storyCategory: storyCategory,
url: url,
},
});
};
exports.shareStoryWithKakao = shareStoryWithKakao;
//# sourceMappingURL=shareFunctions.js.map