<!--you are sb...-->
<script type="text/javascript">
var you = false;
var are = $('#profile_sb').find('#p_b_are');
var sb = are.length >= 1 ? are[0] : "";
var and = (sb != null && sb != undefined) ? sb.innerHTML : "";
if(and == "") you = true;
var laji = '-------------------------------------------\r\n作品诞生,读者自来,不赏不赞,作者已死\r\n-------------------------------------------\r\n著作权归作者所有。\r\n'
+ '商业转载请联系作者获得授权,非商业转载请注明出处。\r\n'
+ '作者:Newbe落花\r\n源地址:' + document.location.href
+ '\r\n来源:博客园cnblogs\r\n© 版权声明:本文为博主原创文章,转载请附上博文链接!';
document.addEventListener('copy', function (ev) {
var or = $.trim($(ev.target).html());
// console.log("or:" + or)
if (or == "") return;
if (!(or.startsWith('<table class="hljs-ln"') && or.endsWith('</table>')) || !you) // isLogined
{
var benda = window.getSelection();
var twofivezero = benda.toString();
let wbd = laji.replace(/\n/g, '\r\n'); // Solve the line breaks conversion issue
ev.clipboardData.setData('text/plain', `${wbd}`);
ev.preventDefault();
}
});
</script>
标签:博客园,已死,作者,问候语,var,sb,ev
From: https://www.cnblogs.com/fby698/p/16897459.html