Copy element text content or input values to the clipboard.
MIT License
Bot releases are visible (Hide)
Full Changelog: https://github.com/github/clipboard-copy-element/compare/v1.2.1...v1.3.0
Published by keithamus over 1 year ago
Fix package exports
Full Changelog: https://github.com/github/clipboard-copy-element/compare/v1.2.0...v1.2.1
Published by keithamus over 1 year ago
Full Changelog: https://github.com/github/clipboard-copy-element/compare/v1.1.2...v1.2.0
https://github.com/github/clipboard-copy-element/compare/v1.1.1...v1.1.2
Published by muan almost 5 years ago
for
-> input.id
not getting copied in < iOS 13 #27Published by muan almost 5 years ago
Add support for Shadow DOM in #26, with thanks to @jorgecasar.
Published by dgraham about 5 years ago
https://github.com/github/clipboard-copy-element/compare/v1.0.5...v1.0.6
https://github.com/github/clipboard-copy-element/compare/v1.0.4...v1.0.5
Published by koddsson about 5 years ago
Copy element text content or input values to the clipboard.
$ npm install --save @github/clipboard-copy-element
import '@github/clipboard-copy-element'
<clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item">
Copy path
</clipboard-copy>
<div id="blob-path">src/index.js</div>
<clipboard-copy value="src/index.js">Copy</clipboard-copy>
<clipboard-copy for="blob-path">Copy</clipboard-copy>
<div id="blob-path">src/index.js</div>
<clipboard-copy for="blob-path">Copy</clipboard-copy>
<input id="blob-path" value="src/index.js">
<clipboard-copy for="blob-path">Copy full URL</clipboard-copy>
<a id="blob-path" href="/path/to#my-blob">Link text will not be copied</a>
After copying to the clipboard, a clipboard-copy
event is dispatched from
the <clipboard-copy>
element:
document.addEventListener('clipboard-copy', function(event) {
const button = event.target
button.classList.add('highlight')
})
Browsers without native custom element support require a polyfill.
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
https://github.com/github/clipboard-copy-element/compare/v1.0.3...v1.0.4
Published by koddsson about 5 years ago
Copy element text content or input values to the clipboard.
$ npm install --save @github/clipboard-copy-element
import '@github/clipboard-copy-element'
<clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item">
Copy path
</clipboard-copy>
<div id="blob-path">src/index.js</div>
<clipboard-copy value="src/index.js">Copy</clipboard-copy>
<clipboard-copy for="blob-path">Copy</clipboard-copy>
<div id="blob-path">src/index.js</div>
<clipboard-copy for="blob-path">Copy</clipboard-copy>
<input id="blob-path" value="src/index.js">
<clipboard-copy for="blob-path">Copy full URL</clipboard-copy>
<a id="blob-path" href="/path/to#my-blob">Link text will not be copied</a>
After copying to the clipboard, a clipboard-copy
event is dispatched from
the <clipboard-copy>
element:
document.addEventListener('clipboard-copy', function(event) {
const button = event.target
button.classList.add('highlight')
})
Browsers without native custom element support require a polyfill.
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
npm audit fix
0cc473anpm update
e3a96e4https://github.com/github/clipboard-copy-element/compare/v1.0.2...v1.0.3
npm update
28f0ad6https://github.com/github/clipboard-copy-element/compare/v1.0.1...v1.0.2
Package has been renamed to include the @github
scope. You can now find it at https://www.npmjs.com/package/@github/clipboard-copy-element on npm.
https://github.com/github/clipboard-copy-element/compare/v1.0.0...v1.0.1
Published by keithamus almost 6 years ago