-
Notifications
You must be signed in to change notification settings - Fork 1k
Add support for HTML and RichText (RTF) clipboard sections #143
Comments
James, can you clarify what the "known limitations" are for HTML/RichText support? In an earlier build of ZC, copy/pasting HTML/RichText is not a problem on my linux systems. If I am not experiencing issues with 1.0.7, should I expect the proposed build to work? |
@pkbarbiedoll:
As I understand it from Issue #78, Linux poses a unique problem in that it has several different clipboard buffers. The Flash 9 implementation (plain text only) puts the data into 1+ clipboard buffers ( You can read more details on Issue #78, the Adobe bug I filed, and Wikipedia. If you truly didn't have any issues pasting into the Terminal, then please please please let me know so we can look into your Linux system's configuration (e.g. did you have |
@JamesMGreene - I am still running the old version of ZC (1.0.7) and can confirm that I am not able to paste copied HTML data into Terminal. This is not a problem as my users paste into a rich text entry form. |
@pkbarbiedoll: Thank you very much for confirming! |
@pkbarbiedoll: Though, just to clarify, nothing gets pasted into the Terminal, right? Not even the "plain text" (raw markup)? |
@JamesMGreene: That is correct. Nothing is pasted in Terminal. Same rich content pastes as expected (retains markup) in a RTE. |
Thanks much, @pkbarbiedoll. :) |
Hi Everybody, ZeroClipboard.setMoviePath('ZeroClipboard11.swf')
//create client
var clip = new ZeroClipboard.Client();
clip.addEventListener('mousedown', function () {
clip.setHTML($('#box-content').html());
// clip.setData({
// "text": "Hello",
// "html": "<b>Hello</b>",
// "richText": "{\\rtf1\\ansi\n{\\b Hello}}",
// "MyAwesomeCustomFormat": "0xDEADBEEF"
// });
// clip.setText($('#box-content').html());
});
clip.addEventListener('complete', function (client, htmlText) {
alert('copied: ' + htmlText);
});
clip.glue('copy'); Thanks in advance!! |
@jaindeepti The EnhancedClipboard isn't implemented yet, thus why this issue is still open. It will be available in the The code sample you provided appears to be using a very old version of ZeroClipboard. Please consider upgrading to the latest version. |
Thanks James!! I am trying to implement the newer version of code too but it is not working. Kindly help me in this. Following is the code snippet which I am using:
HTML: <button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button> Code: var clip = new ZeroClipboard(document.getElementById("copy-button"), {
moviePath: "ZeroClipboard11.swf"
});
clip.on("load", function (client) {
// alert( "movie is loaded" );
clip.on("complete", function (clip, args) {
// `this` is the element that was clicked
this.style.display = "none";
alert("Copied text to clipboard: " + args.text);
});
}); When I click on the copy button, nothing happens.Please let me know if anything is wrong. This I have implemented from the following URL: Thanks in advance!! |
@jaindeepti: Please open a new issue instead of hijacking this high profile issue. Thanks! |
Tasks:
setHtml
method to theZeroClipboard
JS client instancessetRichText
method to theZeroClipboard
JS client instancessetHtml
on the Flash sidesetRichText
on the Flash sideOptional Tasks:
htmlToRtf
method in a demo or docs (not in the ZeroClipboard library itself)Related:
The text was updated successfully, but these errors were encountered: