Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Модуль, который добавляет "Подробнее: ссылка на сайт", если скопировали что-то с сайта


 Share

Recommended Posts

Всем привет! Помогите, пожалуйста, найти модуль.

Что нужно?

Нужен модуль, который добавляет "Подробнее: ссылка на сайт", если скопировали что-то с сайта. В идеале нужно, что бы я мог добавлять любой текст в любом месте скопированного текста.

Пример ниже.

 

Заранее всем спасибо!

Снимок.JPG

Edited by Boombaster
Link to comment
Share on other sites


В инете пишут что-то такое

 


<script type='text/javascript'>

function addLink() {

    if (

window.getSelection().containsNode(

document.getElementsByClassName('entry-content')[0], true)) {

    var body_element = document.getElementsByTagName('body')[0];

    var selection;

    selection = window.getSelection();

    var oldselection = selection

    var pagelink = "Ваша ссылка"; //Change this if you like

    var copy_text = selection + pagelink;

    var new_div = document.createElement('div');

    new_div.style.left='-99999px';

    new_div.style.position='absolute';

    body_element.appendChild(new_div );

    new_div.innerHTML = copy_text ;

    selection.selectAllChildren(new_div );

    window.setTimeout(function() {

        body_element.removeChild(new_div );

    },0);

}

}

document.oncopy = addLink;

</script>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.