diff --git a/ea-scripts/Excalidraw Collaboration Frame.md b/ea-scripts/Excalidraw Collaboration Frame.md new file mode 100644 index 0000000..08e790f --- /dev/null +++ b/ea-scripts/Excalidraw Collaboration Frame.md @@ -0,0 +1,12 @@ +/* +Creates a new Excalidraw.com collaboration room and places the link to the room on the clipboard. +```js*/ +const room = Array.from(window.crypto.getRandomValues(new Uint8Array(10))).map((byte) => `0${byte.toString(16)}`.slice(-2)).join(""); +const key = (await window.crypto.subtle.exportKey("jwk",await window.crypto.subtle.generateKey({name:"AES-GCM",length:128},true,["encrypt", "decrypt"]))).k; +const link = `https://excalidraw.com/#room=${room},${key}`; + +ea.addIFrame(0,0,800,600,link); +ea.addElementsToView(true,true); + +window.navigator.clipboard.writeText(link); +new Notice("The collaboration room link is available on the clipboard.",4000); \ No newline at end of file diff --git a/ea-scripts/Excalidraw Collaboration Frame.svg b/ea-scripts/Excalidraw Collaboration Frame.svg new file mode 100644 index 0000000..e56654d --- /dev/null +++ b/ea-scripts/Excalidraw Collaboration Frame.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/dialogs/SuggesterInfo.ts b/src/dialogs/SuggesterInfo.ts index f6c4904..11ada8d 100644 --- a/src/dialogs/SuggesterInfo.ts +++ b/src/dialogs/SuggesterInfo.ts @@ -247,7 +247,7 @@ export const EXCALIDRAW_AUTOMATE_INFO: SuggesterInfo[] = [ after: "", }, { - field: "addImage", + field: "addIFrame", code: "addIFrame(topX: number, topY: number, width: number, height: number, url?: string, file?: TFile): string;", desc: "Adds an iframe to the drawing. If url is not null then the iframe will be loaded from the url. The url maybe a markdown link to an note in the Vault or a weblink. If url is null then the iframe will be loaded from the file. Both the url and the file may not be null.", after: "",