Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prashaantt/liveclipboard-jquery
Automatically exported from code.google.com/p/liveclipboard-jquery
https://github.com/prashaantt/liveclipboard-jquery
Last synced: 2 days ago
JSON representation
Automatically exported from code.google.com/p/liveclipboard-jquery
- Host: GitHub
- URL: https://github.com/prashaantt/liveclipboard-jquery
- Owner: prashaantt
- Created: 2015-08-12T10:49:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-12T11:51:24.000Z (over 9 years ago)
- Last Synced: 2023-03-30T04:52:46.718Z (almost 2 years ago)
- Language: JavaScript
- Size: 184 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# liveclipboard-jquery
Automatically exported from code.google.com/p/liveclipboard-jquery
## Overview
This jQuery plugin adds feature of copying/pasting structured data across web applications and even desktop applications. In web applications, as you know, accessing OS clipboard is very limited. IE have clipboardData object but raising alert dialog by default, also Flash restricts automatic copy without user interaction.
The idea is similar to old-day Microsoft Live Clipboard, but it enables much easier integration by providing as a jQuery plugin.
##Usage
Register callback functions to jQuery objects to add clipboard feature.
```
$('.clippable').clipboard({/* Return copying string data to clipboard */
copy : function() {
// return $(this).text();
},/* Process pasted string data from clipboard */
paste : function(data) {
// $(this).text(data);
},/* Process delete signal */
del : function() {
// $(this).remove();
}
// "cut" command is "copy" + "del" combination});
```When right-clicking the target element, it shows browser's native context menu to copy / cut / paste / delete.
If you choose menu item it will callback the registered function.
If there's no paste or del function defined, it is regarded as read only and menu items other than copy will become disabled.
It also supports shortcut key, Ctrl(Command in MacOS) + CXV.
## Example
[Live preview](http://htmlpreview.github.io/?https://github.com/prashaantt/liveclipboard-jquery/blob/master/videosearch.html)
## Note
Live Clipboard in jQuery is actually creating transparent textarea element layered over the target element (position:absolute), so you should notify by calling $.trackClipboards() method when the position of the target element is changing or being removed.