public
Description: rails plugin to provide click_to_copy_text_field helper
Homepage:
Clone URL: git://github.com/ayn/click_to_copy_text_field.git
100644 20 lines (12 sloc) 0.773 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ClickToCopyTextfield
====================
 
click textfield to copy to clipboard, note that this plugin requires jQuery (or jrails).
 
This uses the Clipboard 2.0 jQuery plugin [http://plugins.jquery.com/project/clipboard]
 
This probably won't work with Flash 10 as Adobe has changed permissions in Flash. The author of jQuery Clipboard plans to fix it for Flash 10. In the meantime, you can use this instead for click to copy: http://github.com/mojombo/clippy/tree/master
 
Example
=======
 
in your view or layout, include the javascript:
<%= javascript_include_tag 'jquery.clipboard.min.js' %>
 
and then do something like this:
<%= click_to_copy_text_field_tag 'share-link-1', "http://some_link", :size => 10 %>
 
Copyright (c) 2008 Andrew Ng, released under the MIT license