Sha256: d6a915887c59a09a53127320184b3cffad201c2aa8c80c47ac27c34d81c12db5
Contents?: true
Size: 1005 Bytes
Versions: 1
Compression:
Stored size: 1005 Bytes
Contents
class CopyrightLink @addLink: ()-> body_element = document.body copyright copyright = "Read more: #{document.location.href}" # " Copyright #{document.getElementsByClassName('copyright')[0].textContent}" selection = window.getSelection() if window.clipboardData # IE browsers copytext = "#{selection}\r\n\r\n#{copyright}" window.clipboardData.setData "Text", copytext return false else # All others copytext = "#{selection}<br/><br/><p>#{copyright}</p>" newdiv = document.createElement "div" newdiv.style.position="absolute" newdiv.style.left="-999999px" body_element.appendChild newdiv newdiv.innerHTML = copytext selection.selectAllChildren newdiv window.setTimeout(-> body_element.removeChild newdiv , 0) window.CopyrightLink = CopyrightLink document.oncopy = CopyrightLink.addLink window.onload = -> document.oncopy = undefined document.body.oncopy = CopyrightLink.addLink
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
translation_cms-0.1.5 | app/assets/javascripts/utils/copyright_link.js.coffee |