git ssb

10+

Matt McKegg / patchwork



Commit 068b47060b315b903ea2097fca9df480c84de261

right click copy embed on images

Matt McKegg committed on 6/28/2018, 11:59:04 PM
Parent: ef8bbd8ead3c1ca190843d0695258a73898dab24

Files changed

lib/context-menu-and-spellcheck.jschanged
lib/context-menu-and-spellcheck.jsView
@@ -59,8 +59,19 @@
5959 clipboard.writeText(extractedRef)
6060 }
6161 })
6262 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+ }
6374 }
6475
6576 if (this.isSrcUrlValid(menuInfo)) {
6677 if (!isFile) this.addSeparator(menu)

Built with git-ssb-web