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
document.addEventListener('paste', function (event) { | |
var clip = event.clipboardData.getData('text/plain'); | |
var urlRegex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; | |
var urlq = clip.match(urlRegex); | |
if (urlq != null) { | |
event.preventDefault(); | |
var anchored = clip.replace(urlRegex, function(url) { | |
return '<a href="' + url + | |
'" style="cursor:pointer" onclick="window.open(this.href);return false">' + | |
url + '</a>'; |
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
// default exports | |
export default 42; | |
export default {}; | |
export default []; | |
export default foo; | |
export default function () {} | |
export default class {} | |
export default function foo () {} | |
export default class foo {} |