Created
June 23, 2014 18:18
-
-
Save miguel250/34c03afe8aa8cc89e552 to your computer and use it in GitHub Desktop.
Zeroclipboard won't play nice with requirejs and platformjs on firefox.
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
requirejs.config({ | |
"baseUrl": "", | |
"paths": { | |
"ZeroClipboard": "http://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.1/ZeroClipboard" | |
} | |
}); | |
requirejs(['ZeroClipboard'], function(ZeroClipboard) { | |
var client = new ZeroClipboard( document.getElementById("copy-button") ); | |
client.on("error", function(event){ | |
console.log("ZeroClipboard error: "+ event.name + " message: " + event.message) | |
}) | |
client.on( "ready", function( readyEvent ) { | |
alert( "ZeroClipboard SWF is ready!" ); | |
client.on( "aftercopy", function( event ) { | |
alert("Copied text to clipboard: " + event.data["text/plain"] ); | |
}); | |
}); | |
}); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script language="javascript" src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.3.2/platform.js"></script> | |
<script data-main="app" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.11/require.min.js"></script> | |
</head> | |
<body> | |
<button id="copy-button" data-clipboard-text="Copy Me!" title="Click to copy me.">Copy to Clipboard</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment