It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

function addLink() {
        var body_element = document.getElementsByTagName("body")[0];
        var selection = window.getSelection();
        var pagelink = '\n\nLicense: CC Attribution-Share Alike 3.0 Unported\nSource:\n'; 
        var copytext = selection + pagelink;
        var newdiv = document.createElement('pre'); = 'absolute'; = '-99999px';
        newdiv.innerHTML = copytext;
        window.setTimeout(function () {
        }, 0);
    document.oncopy = addLink;

Make this dependent on a setting. Under the “license” (Under which license should your content be released?) add an input line to accept any text string and have 2 plceholders:

  • %s for the base URL of the site
  • %u for the URL of the page copied from
  • %l for the license that the site uses

The default can be:

\n\nLicense: %l\nSource: %u\n

TODO: think about how to make the language dependent.

devel/ideas/add_license_text_to_copy_n_pasted_content.txt · Last modified: 2014-05-25 09:39 by Pallieter