• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » How to add Copy script
How to add Copy script
mribbiza
Posts: 25
Reputation: 0

Message # 1 | 11:06 AM
How to add
When a user copy text, add link to this..

example:

Lorem ipsum, lorem ipsum lorem ipsum lorem ipsum lorem ipsum
lorem ipsum lorem ipsum lorem ipsum lorem ipsum
lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum

Text copyed. Read more at: http://forum.ucoz.com/forum

Looking for Peoples (HadeS)
http://wattmt2.ucoz.com
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 2 | 1:22 PM
mribbiza, you'll need to use JavaScript and client-side scripting for these purposes. We don't provide support on such scripting measures here. wink You can ask in the Custom Solutions board, however, there is unfortunately rare chance of an answer.
Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Raver
Posts: 100
Reputation: 15

Message # 3 | 1:53 PM
mribbiza, you can join the uCoz Forum in Romanian and get support in your native language if it's easier for you. Our users from there provide support in terms of scripting, sometimes, so feel free to register, search first and ask there if you haven't found an answer yet.
Sunny
Posts: 9296
Reputation: 456

Message # 4 | 11:04 AM
mribbiza, Paradox is right, we don't usually provide help with third-party scripts as it is beyond the duties of our support team. But in this case I can give the script you need:

Code
<script type="text/javascript">
function addLink() {
var body_element = document.getElementsByTagName('body')[0];
var selection;
selection = window.getSelection();
var pagelink = "<br /><br /> Source: <a href='"+document.location.href+"'>"+document.location.href+"</a><br />© Jemand.ru"; // 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>


It should be pasted before the </head> tag in each templates of the Customize Design section.

I'm not active on the forum anymore. Please contact other forum staff.
mribbiza
Posts: 25
Reputation: 0

Message # 5 | 7:56 PM
thanks a lot Sunny!
Looking for Peoples (HadeS)
http://wattmt2.ucoz.com
uCoz Community » For Webmasters » Custom Solutions » How to add Copy script
  • Page 1 of 1
  • 1
Search: