close
丁斌煌
如欲浏覽完全內容,請至中時新聞網:",
additionalLinkParam = "?from=copy",
additionalLinkUrl = window.location.origin + window.location.pathname + additionalLinkParam;
//題目開放複製,可跨越限制字數,但不能跨越題目自己字數
if ($eventTarget.is(".article-title") && selectedText.length <= $eventTarget.text().length) {
return;
} else {
if (toReturnBlankContent) {
return false;
}
if (selectedText.length <= maxAllowedCopyTextLength) {
return;
}
}
selectedText = selectedText.substr(0, maxAllowedCopyTextLength) + "...";
selectedText += additionalLinkTitle + additionalLinkUrl;
$tempDiv = $("").css({
"position": "absolute",
"left": "-9999px"
}).html(selectedText).appendTo("body");
selectionObj.selectAllChildren($tempDiv.get(0));
document.execCommand("copy");
$tempDiv.remove();
}
});
});