Created
November 28, 2011 20:54
-
-
Save jcottrell/1402001 to your computer and use it in GitHub Desktop.
Simple copy example via clippy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <title>Copy Gist</title> | |
| </head> | |
| <body> | |
| Type here then focus-off<br> | |
| <input type="text" /><span id="fl_wrap"></span><br> | |
| <script> | |
| $('input').focusout(function() { | |
| var ct = $(this).val(), | |
| fl_copy = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="110" height="14" id="clippy" ><param name="movie" value="clippy.swf"/><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="text=#{text}"><param name="bgcolor" value="#ffffff"><embed src="clippy.swf" width="110" height="14" name="clippy" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="text=#{text}" bgcolor="#ffffff" /></object>'; | |
| $('#fl_wrap').html(fl_copy.replace(/#\{text\}/g,ct)); | |
| }).focusin(function(){ | |
| if ($('#fl_wrap').length > 0) { | |
| $('#fl_wrap').children().remove(); | |
| } | |
| }); | |
| </script> | |
| <br><br> | |
| Paste area for convenience:<br> | |
| <textarea></textarea> | |
| </body> | |
| </html> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes the popular clippy open source flash tool is in the same directory (obviously).