Commit 068b47060b315b903ea2097fca9df480c84de261
right click copy embed on images
Matt McKegg committed on 6/28/2018, 11:59:04 PMParent: ef8bbd8ead3c1ca190843d0695258a73898dab24
Files changed
lib/context-menu-and-spellcheck.js | changed |
lib/context-menu-and-spellcheck.js | ||
---|---|---|
@@ -59,8 +59,19 @@ | ||
59 | 59 | clipboard.writeText(extractedRef) |
60 | 60 | } |
61 | 61 | }) |
62 | 62 | menu.append(copyRef) |
63 | + | |
64 | + if (ref.isBlob(extractedRef) && menuInfo.hasImageContents) { | |
65 | + var copyEmbed = new MenuItem({ | |
66 | + label: `Copy Embed Markdown`, | |
67 | + click: () => { | |
68 | + // Omit the mailto: portion of the link; we just want the address | |
69 | + clipboard.writeText(`![${menuInfo.titleText}](${extractedRef})`) | |
70 | + } | |
71 | + }) | |
72 | + menu.append(copyEmbed) | |
73 | + } | |
63 | 74 | } |
64 | 75 | |
65 | 76 | if (this.isSrcUrlValid(menuInfo)) { |
66 | 77 | if (!isFile) this.addSeparator(menu) |
Built with git-ssb-web