Last active
September 30, 2015 16:01
-
-
Save bjoerntx/3b741e6185f058fdb4bc to your computer and use it in GitHub Desktop.
This file contains 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
// this function attaches the ZeroClipboard plugin | |
// to the newly created button and handles the events | |
function attachZeroClipboard() { | |
var sRTFToCopy = $("#TextBox1").val(); | |
var client = new ZeroClipboard(document.getElementById('clipboardDropDown')); | |
client.on('ready', function (event) { | |
client.on('copy', function (event) { | |
event.clipboardData.setData('application/rtf', sRTFToCopy); | |
}); | |
client.on('aftercopy', function (event) { | |
showMessage("Formatted content has been copied to the client clipboard."); | |
$("#clipboardDropDown").css("visibility", "hidden"); | |
}); | |
}); | |
client.on('error', function (event) { | |
ZeroClipboard.destroy(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment