diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 2f0c209..cb64810 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -1397,7 +1397,7 @@ export default class ExcalidrawView extends TextFileView { private isLoaded: boolean = false; async setViewData(data: string, clear: boolean = false) { - checkExcalidrawVersion(app); + if(this.plugin.settings.showNewVersionNotification) checkExcalidrawVersion(app); this.isLoaded = false; if (clear) { this.clear(); diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 130c1af..223bfe3 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -91,6 +91,11 @@ export default { RELEASE_NOTES_DESC: "Toggle ON: Display release notes each time you update Excalidraw to a newer version.
" + "Toggle OFF: Silent mode. You can still read release notes on GitHub.", + NEWVERSION_NOTIFICATION_NAME: "Plugin update notification", + NEWVERSION_NOTIFICATION_DESC: + "Toggle ON: Show a notification when a new version of the plugin is avaiable.
" + + "Toggle OFF: Silent mode. You need to check for plugin updates in Community Plugins.", + FOLDER_NAME: "Excalidraw folder", FOLDER_DESC: "Default location for new drawings. If empty, drawings will be created in the Vault root.", @@ -98,8 +103,8 @@ export default { "Use Excalidraw folder when embedding a drawing into the active document", FOLDER_EMBED_DESC: "Define which folder to place the newly inserted drawing into " + - "when using the command palette action: 'Create a new drawing and embed into active document'. " + - "ON: Use Excalidraw folder; OFF: use attachments folder defined in Obsidian settings", + "when using the command palette action: 'Create a new drawing and embed into active document'.
" + + "Toggle ON: Use Excalidraw folder
Toggle OFF: use the attachments folder defined in Obsidian settings.", TEMPLATE_NAME: "Excalidraw template file", TEMPLATE_DESC: "Full filepath to the Excalidraw template. " + @@ -123,7 +128,7 @@ export default { "be saved without compression, so that you can read and edit the JSON string. The drawing will be compressed again " + "once you switch back to Excalidraw view. " + "The setting only has effect 'point forward', meaning, existing drawings will not be effected by the setting " + - "until you open them and save them. ", + "until you open them and save them.
Toggle ON: Compress drawing JSON
Toggle OFF: Leave drawing JSON uncompressed", AUTOSAVE_NAME: "Enable Autosave", AUTOSAVE_DESC: "Automatically save the active drawing, in case there are changes, every 15, 30 seconds, or 1, 2, 3, 4, or 5 minute. Save normally happens when you close Excalidraw or Obsidian, or move " + @@ -144,8 +149,8 @@ export default { "Filename prefix when embedding a new drawing into a markdown note", FILENAME_PREFIX_EMBED_DESC: "Should the filename of the newly inserted drawing start with the name of the active markdown note " + - "when using the command palette action: Create a new drawing and embed into active document? " + - "ON: Yes, OFF: Not", + "when using the command palette action: Create a new drawing and embed into active document?
" + + "Toggle ON: Yes, the filename of a new drawing should start with filename of the active document
Toggle OFF: No, filename of a new drawing should not include the filename of the active document", FILENAME_POSTFIX_NAME: "Custom text after markdown Note's name when embedding", FILENAME_POSTFIX_DESC: @@ -156,26 +161,25 @@ export default { FILENAME_EXCALIDRAW_EXTENSION_NAME: ".excalidraw.md or .md", FILENAME_EXCALIDRAW_EXTENSION_DESC: "This setting does not apply if you use Excalidraw in compatibility mode, " + - "i.e. you are not using Excalidraw markdown files. Toggle ON = filename ends with .excalidraw.md, Toggle OFF = filename ends with .md", - /*SVG_IN_MD_NAME: "SVG Snapshot to markdown file", - SVG_IN_MD_DESC: "If the switch is 'on' Excalidraw will include an SVG snapshot in the markdown file. "+ - "When SVG snapshots are saved to the Excalidraw.md file, drawings that include large png, jpg, gif images may take extreme long time to open in markdown view. " + - "On the other hand, SVG snapshots provide some level of platform independence and longevity to your drawings. Even if Excalidraw will no longer exist, the snapshot " + - "can be opened with an app that reads SVGs. In addition hover previews will be less resource intensive if SVG snapshots are enabled.",*/ + "i.e. you are not using Excalidraw markdown files.
Toggle ON: filename ends with .excalidraw.md
Toggle OFF: filename ends with .md", DISPLAY_HEAD: "Display", LEFTHANDED_MODE_NAME: "Left-handed mode", LEFTHANDED_MODE_DESC: - "Currently only has effect in tray-mode. If turned on, the tray will be on the right side.", + "Currently only has effect in tray-mode. If turned on, the tray will be on the right side." + + "
Toggle ON: Left-handed mode.
Toggle OFF: Right-handed moded", MATCH_THEME_NAME: "New drawing to match Obsidian theme", MATCH_THEME_DESC: "If theme is dark, new drawing will be created in dark mode. This does not apply when you use a template for new drawings. " + - "Also this will not effect when you open an existing drawing. Those will follow the theme of the template/drawing respectively.", + "Also this will not effect when you open an existing drawing. Those will follow the theme of the template/drawing respectively." + + "
Toggle ON: Follow Obsidian Theme
Toggle OFF:Follow theme defined in your template", MATCH_THEME_ALWAYS_NAME: "Existing drawings to match Obsidian theme", MATCH_THEME_ALWAYS_DESC: - "If theme is dark, drawings will be opened in dark mode. If your theme is light, they will be opened in light mode. ", + "If theme is dark, drawings will be opened in dark mode. If your theme is light, they will be opened in light mode. " + + "
Toggle ON: Match Obsidian theme
Toggle OFF: Open with the same theme as last saved", MATCH_THEME_TRIGGER_NAME: "Excalidraw to follow when Obsidian Theme changes", MATCH_THEME_TRIGGER_DESC: - "If this option is enabled open Excalidraw pane will switch to light/dark mode when Obsidian theme changes. ", + "If this option is enabled open Excalidraw pane will switch to light/dark mode when Obsidian theme changes. " + + "
Toggle ON: Follow theme changes
Toggle OFF: Drawings are not effected by Obsidian theme changes", DEFAULT_OPEN_MODE_NAME: "Default mode when opening Excalidraw", DEFAULT_OPEN_MODE_DESC: "Specifies the mode how Excalidraw opens: Normal, Zen, or View mode. You may also set this behavior on a file level by " + @@ -184,7 +188,8 @@ export default { DEFAULT_PEN_MODE_DESC: "Should pen mode be automatically enabled when opening Excalidraw?", ZOOM_TO_FIT_NAME: "Zoom to fit on view resize", - ZOOM_TO_FIT_DESC: "Zoom to fit drawing when the pane is resized", + ZOOM_TO_FIT_DESC: "Zoom to fit drawing when the pane is resized" + + "
Toggle ON: Zoom to fit
Toggle OFF: Auto zoom disabled", ZOOM_TO_FIT_MAX_LEVEL_NAME: "Zoom to fit max ZOOM level", ZOOM_TO_FIT_MAX_LEVEL_DESC: "Set the maximum level to which zoom to fit will enlarge the drawing. Minimum is 0.5 (50%) and maximum is 10 (1000%).", @@ -301,7 +306,8 @@ export default { "For a number of reasons, the same approach cannot be used to expedite the loading of drawings with many embedded objects. See demonstration here.", EMBED_PREVIEW_SVG_NAME: "Display SVG in markdown preview", EMBED_PREVIEW_SVG_DESC: - "The default is to display drawings as SVG images in the markdown preview. Turning this feature off, the markdown preview will display the drawing as an embedded PNG image.", + "Toggle ON: Embed drawing as an SVG image into the markdown preview.
" + + "Toggle OFF: Embedd drawing as a PNG image. Note, that some of the image block referencing features do not work with PNG embeds.", PREVIEW_MATCH_OBSIDIAN_NAME: "Excalidraw preview to match Obsidian theme", PREVIEW_MATCH_OBSIDIAN_DESC: "Image preview in documents should match the Obsidian theme. If enabled, when Obsidian is in dark mode, Excalidraw images will render in dark mode. " + diff --git a/src/settings.ts b/src/settings.ts index adfa741..2ee7759 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -101,6 +101,7 @@ export interface ExcalidrawSettings { defaultTrayMode: boolean; previousRelease: string; showReleaseNotes: boolean; + showNewVersionNotification: boolean; mathjaxSourceURL: string; } @@ -182,6 +183,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = { defaultTrayMode: false, previousRelease: "1.6.13", showReleaseNotes: true, + showNewVersionNotification: true, mathjaxSourceURL: "https://cdn.jsdelivr.net/npm/mathjax@3.2.1/es5/tex-svg.js" }; @@ -269,6 +271,18 @@ export class ExcalidrawSettingTab extends PluginSettingTab { }), ); + new Setting(containerEl) + .setName(t("NEWVERSION_NOTIFICATION_NAME")) + .setDesc(fragWithHTML(t("NEWVERSION_NOTIFICATION_DESC"))) + .addToggle((toggle) => + toggle + .setValue(this.plugin.settings.showNewVersionNotification) + .onChange(async (value) => { + this.plugin.settings.showNewVersionNotification = value; + this.applySettingsUpdate(); + }), + ); + new Setting(containerEl) .setName(t("FOLDER_NAME")) .setDesc(fragWithHTML(t("FOLDER_DESC")))