function toggleShare(position, nobtn) { var content = _$("shareTpl").innerHTML; popUtil.open({ title: _locModel.T.T_Share, body: content, btnOpt: (nobtn?0:4), position: position }); } function twitterShare(contentId) { u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; window.open("https://twitter.com/share/?text=" + encodeURIComponent(t) + "&url=" + encodeUrlWithUnicode(u)); } function encodeUrlWithUnicode(u) { var reg = /([\u0100-\uFFFF]+)/g; var sp = u.split(reg); var url = ""; for (var i = 0; i < sp.length; i++) { if (reg.test(sp[i])) { url += encodeURIComponent(encodeURIComponent(sp[i])); } else { url += encodeURIComponent(sp[i]); } } return url; } function fbShare(contentId) { u = document.getElementsByClassName("share_url")[0].content; t = document.getElementsByClassName("share_title")[0].content; window.open("http://www.facebook.com/sharer.php?u=" + encodeURIComponent(u) + "&t=" + encodeURIComponent(t)); } function lnShare(contentId) { u = location.href;//document.getElementsByClassName("share_url")[0].content; window.open("https://social-plugins.line.me/lineit/share?url=" + encodeURIComponent(u)); } function copyLink(url) { var txtUrl = document.createElement("textarea"); txtUrl.innerHTML = url || window.location.href; document.body.appendChild(txtUrl); txtUrl.select(); document.execCommand("Copy"); document.body.removeChild(txtUrl); //popUtil.open(popUtil.option(_locModel.T.T_Share, _locModel.T.T_LinkCopied, 1)); popUtil.bubble(_locModel.T.T_LinkCopied); } function whatsapp(url, title) { var u = url || location.href; var t = title || ""; window.open("https://wa.me/?text=" + encodeURIComponent(t) + "%20" + encodeURIComponent(u)); } function telegram(url, title) { var u = url || location.href; var t = title || ""; window.open("https://t.me/share/url?url=" + encodeURIComponent(u) + "&text=" + encodeURIComponent(t)); };