Created
December 23, 2014 10:12
-
-
Save AbhishekGhosh/bda8e68c0ca507821da8 to your computer and use it in GitHub Desktop.
copy-paste-notice.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript">/*<![CDATA[*/function addLink(){var body_element=document.getElementsByTagName('body')[0];var selection;selection=window.getSelection();var pagelink="<br /><br /> Read more at: <a href='"+document.location.href+"'>"+document.location.href+"</a><br />Copyright © Richard M. Stallman";var copytext=selection+pagelink;var newdiv=document.createElement('div');newdiv.style.position='absolute';newdiv.style.left='-99999px';body_element.appendChild(newdiv);newdiv.innerHTML=copytext;selection.selectAllChildren(newdiv);window.setTimeout(function(){body_element.removeChild(newdiv);},0);} | |
document.oncopy=addLink;/*]]>*/</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change that Copyright © Richard M. Stallman to your name. Be careful about " and variant of curly quotation. You need to paste this within
<head></head>
to get backlink from copied text.