MCPcopy
hub / github.com/SnapDrop/snapdrop / _onPaste

Method _onPaste

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

Source from the content-addressed store, hash-verified

53 }
54
55 _onPaste(e) {
56 const files = e.clipboardData.files || e.clipboardData.items
57 .filter(i => i.type.indexOf('image') > -1)
58 .map(i => i.getAsFile());
59 const peers = document.querySelectorAll('x-peer');
60 // send the pasted image content to the only peer if there is one
61 // otherwise, select the peer somehow by notifying the client that
62 // "image data has been pasted, click the client to which to send it"
63 // not implemented
64 if (files.length > 0 && peers.length === 1) {
65 Events.fire('files-selected', {
66 files: files,
67 to: $$('x-peer').id
68 });
69 }
70 }
71}
72
73class PeerUI {

Callers 1

constructorMethod · 0.95

Calls 2

$$Function · 0.85
fireMethod · 0.80

Tested by

no test coverage detected