generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alpha release as intermediate step for new Obisidian API.
- Loading branch information
Showing
12 changed files
with
798 additions
and
279 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"overrides": [ | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"quotes": ["error", "single"], | ||
"semi": ["error", "always"], | ||
"indent": ["error", 4], | ||
"no-multi-space": ["error"] | ||
} | ||
} |
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
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
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,34 @@ | ||
import { | ||
EditorView, | ||
WidgetType | ||
} from '@codemirror/view'; | ||
|
||
import { ParsedImage } from './state_parser'; | ||
|
||
|
||
export class ImageIndexWidget extends WidgetType { | ||
index: number; | ||
info: ParsedImage; | ||
|
||
constructor(index: number, info: ParsedImage) { | ||
super(); | ||
|
||
this.index = index; | ||
this.info = info; | ||
} | ||
|
||
toDOM(view: EditorView): HTMLElement { | ||
const container = document.createElement('data'); | ||
container.addClass('image-caption-data') | ||
container.setAttribute('data-image-caption-index', this.index.toString()); | ||
|
||
return container; | ||
} | ||
|
||
eq(other: ImageIndexWidget): boolean { | ||
return ( | ||
(other.index === this.index) | ||
&& (other.info.embed_type === this.info.embed_type) | ||
); | ||
} | ||
} |
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
Oops, something went wrong.