This commit is contained in:
ThatOneCalculator 2023-07-03 01:13:33 -07:00
parent c304242e56
commit 681a9c01af
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 12 additions and 8 deletions

View file

@ -48,7 +48,7 @@ const props = withDefaults(
} }
); );
const codeblock = `<iframe src="https://${host}/notes/${props.id}/embed" class="embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe><scr` + `ipt src="https://${host}/static-assets/embed.js" async="async"></scr` + `ipt>`; const codeblock = `<iframe src="https://${host}/notes/${props.id}/embed" class="embed" style="max-width: 100%; border: 0" width="400" height="600" allowfullscreen="allowfullscreen"></iframe><scr` + `ipt src="https://${host}/static-assets/embed.js" async="async"></scr` + `ipt>`;
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -108,6 +108,12 @@ export function getNoteMenu(props: {
os.success(); os.success();
} }
function embed(): void {
os.showEmbedDialog({
id: appearNote.id,
})
}
function copyOriginal(): void { function copyOriginal(): void {
copyToClipboard(appearNote.url ?? appearNote.uri); copyToClipboard(appearNote.url ?? appearNote.uri);
os.success(); os.success();
@ -462,6 +468,11 @@ export function getNoteMenu(props: {
text: i18n.ts.copyLink, text: i18n.ts.copyLink,
action: copyLink, action: copyLink,
}, },
{
icon: "ph-code ph-bold ph-lg",
text: i18n.ts.embed,
action: embed,
},
appearNote.url || appearNote.uri appearNote.url || appearNote.uri
? { ? {
icon: "ph-link-simple ph-bold ph-lg", icon: "ph-link-simple ph-bold ph-lg",
@ -476,13 +487,6 @@ export function getNoteMenu(props: {
action: share, action: share,
} }
: undefined, : undefined,
{
icon: "ph-code ph-bold ph-lg",
text: i18n.ts.embed,
action: os.showEmbedDialog({
id: appearNote.id,
}),
},
].filter((x) => x !== undefined); ].filter((x) => x !== undefined);
} }