Last active
August 29, 2015 14:14
-
-
Save redgoose-dev/b591da6deb42ffd31213 to your computer and use it in GitHub Desktop.
Copy the text to the clipboard
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
/** | |
* Copy the text to the clipboard | |
* | |
* @Param {String} : copy text | |
* @Param {String} : prompt message | |
* @Return void | |
*/ | |
var copyClipboard = function(str, msg) | |
{ | |
if (window.clipboardData) | |
{ | |
window.clipboardData.setData('Text',str); | |
self.alert.open('copied clipboard', 'blue'); | |
} | |
else | |
{ | |
var result = prompt((msg) ? msg : "Press Ctrl+C to copy to your clipboard", str); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment