MCPcopy Create free account
hub / github.com/arfct/itty-bitty / handlePaste

Function handlePaste

docs/edit.js:218–226  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

216
217var codepenRE = /(https:\/\/codepen\.io\/[\w]+\/(\w+)\/(\w+))/;
218function handlePaste(e) {
219 var clipboard = window.clipboardData || e.clipboardData;
220 var text = clipboard.getData("Text") || clipboard.getData("text/plain");
221 if (!text) return;
222 let match = text.match(codepenRE);
223 if (match) {
224 fetchCodepen(match[0]);
225 }
226}
227
228var TEMPLATE_MARKER = "/*use-itty-bitty-template*/";
229function fetchCodepen(url) {

Callers

nothing calls this directly

Calls 1

fetchCodepenFunction · 0.70

Tested by

no test coverage detected