MCPcopy Index your code
hub / github.com/massCodeIO/massCode / updatePreview

Function updatePreview

integrations/clipper/src/popup.ts:229–254  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227}
228
229function updatePreview(): void {
230 if (!previewInput || !currentPayload) {
231 return
232 }
233
234 if (activeTarget === 'http') {
235 previewInput.value = currentPayload.url
236 updatePreviewLabel()
237 return
238 }
239
240 if (activeTarget === 'notes') {
241 previewInput.value
242 = currentPayload.selectedMarkdown
243 || currentPayload.selectedText
244 || currentPayload.pageMarkdown
245 || currentPayload.pageText
246 || currentPayload.pageTitle
247 updatePreviewLabel()
248 return
249 }
250
251 previewInput.value
252 = currentPayload.selectedText || 'Select text on the page to save a snippet.'
253 updatePreviewLabel()
254}
255
256function canCaptureCurrentTarget(): boolean {
257 if (!currentPayload) {

Callers 2

initFunction · 0.85
bindEventsFunction · 0.85

Calls 1

updatePreviewLabelFunction · 0.85

Tested by

no test coverage detected