Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kennethkalmer/jquery-copyfriendly
Unobtrusive jQuery plugin to place the text of any element in an invisible text field, making sure no unnecessary whitespace is copied with to the clipboard
https://github.com/kennethkalmer/jquery-copyfriendly
Last synced: about 15 hours ago
JSON representation
Unobtrusive jQuery plugin to place the text of any element in an invisible text field, making sure no unnecessary whitespace is copied with to the clipboard
- Host: GitHub
- URL: https://github.com/kennethkalmer/jquery-copyfriendly
- Owner: kennethkalmer
- License: mit
- Created: 2009-07-10T06:56:24.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-07-10T07:16:05.000Z (over 15 years ago)
- Last Synced: 2024-04-16T05:35:25.890Z (7 months ago)
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE.txt
Awesome Lists containing this project
README
h1. jQuery copyfriendly
A simple jQuery plugin that extracts the text from an HTML element and places it into an "invisible" text field. This makes selecting and copying the text much easier since no surrounding whitespace is copied by the browser.
The plugin works unobtrusively, so nothing happens in the absense of Javascript.
h2. Usage
Include jquery.copyfriendly.js as fire it off like this:
$(document).ready(function(){
$('.copyme').copyfriendly();
});Then mark your required elements with the specified class:
Hello
Or
Heyah2. Options
copyfriendly() takes on parameter currently, which is optional:
copyfriendly( {
klass: "borderless"
} );The 'klass' option tells copyfriendly which CSS class to apply to the inputs generated.
h2. Sample CSS
You can make the inputs generated by copyfriendly invisible using this sample CSS:
input.borderless {
border: none;
}Do be warned that it might take a little more to align the appearance of the remaining text with the surrounding text in the document.
h2. License
(MIT LICENSE) in LICENSE.txt