MCPcopy Index your code
hub / github.com/SnapDrop/snapdrop / _onText

Method _onText

client/scripts/ui.js:360–374  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

358 }
359
360 _onText(e) {
361 this.$text.innerHTML = '';
362 const text = e.text;
363 if (isURL(text)) {
364 const $a = document.createElement('a');
365 $a.href = text;
366 $a.target = '_blank';
367 $a.textContent = text;
368 this.$text.appendChild($a);
369 } else {
370 this.$text.textContent = text;
371 }
372 this.show();
373 window.blop.play();
374 }
375
376 async _onCopy() {
377 await navigator.clipboard.writeText(this.$text.textContent);

Callers 1

constructorMethod · 0.95

Calls 2

isURLFunction · 0.85
showMethod · 0.80

Tested by

no test coverage detected