generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upload existing local image with context menu
Add possibility to upload existing local image from Markdown editor with right-click context menu #32
- Loading branch information
Showing
3 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
export const IMGUR_PLUGIN_CLIENT_ID = '5d3647b14ed585f' | ||
export const IMGUR_API_BASE = 'https://api.imgur.com/3' | ||
export const IMGUR_ACCESS_TOKEN_LOCALSTORAGE_KEY = 'imgur-access_token' | ||
|
||
export const IMGUR_POTENTIALLY_SUPPORTED_FILES_EXTENSIONS = [ | ||
'jpeg', | ||
'png', | ||
'gif', | ||
'apng', | ||
'tiff', | ||
'mp4', | ||
'mpeg', | ||
'avi', | ||
'webm', | ||
'mov', | ||
'mkv', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ClickableToken, EditorPosition } from 'obsidian' | ||
|
||
export function localEmbeddedImageExpectedBoundaries( | ||
from: ClickableToken, | ||
): [EditorPosition, EditorPosition] { | ||
return [ | ||
{ ...from.start, ch: from.start.ch - 3 }, | ||
{ ...from.end, ch: from.end.ch + 2 }, | ||
] | ||
} |