mirror of
https://github.com/alberti42/obsidian-plugins-annotations.git
synced 2026-07-22 10:10:24 +00:00
Allow markdown and html annotations.
This commit is contained in:
parent
7f03224672
commit
9b7c73d4b6
3 changed files with 16 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "plugins-annotations",
|
||||
"name": "Plugins Annotations",
|
||||
"version": "1.1.1",
|
||||
"version": "1.2.0",
|
||||
"minAppVersion": "1.5.0",
|
||||
"description": "Allows adding personal comments to each installed plugin.",
|
||||
"author": "Andrea Alberti",
|
||||
|
|
|
|||
14
src/main.ts
14
src/main.ts
|
|
@ -272,8 +272,8 @@ export default class PluginsAnnotations extends Plugin {
|
|||
if (descriptionDiv) {
|
||||
const commentDiv = descriptionDiv.querySelector('.plugin-comment');
|
||||
if (!commentDiv) {
|
||||
const comment_container = document.createElement('div');
|
||||
comment_container.className = 'plugin-comment';
|
||||
const annotation_container = document.createElement('div');
|
||||
annotation_container.className = 'plugin-comment';
|
||||
|
||||
const annotation_div = document.createElement('div');
|
||||
annotation_div.className = 'plugin-comment-annotation';
|
||||
|
|
@ -285,7 +285,7 @@ export default class PluginsAnnotations extends Plugin {
|
|||
if (isPlaceholder) {
|
||||
annotation_div.classList.add('plugin-comment-placeholder');
|
||||
if (this.settings.hide_placeholders) {
|
||||
comment_container.classList.add('plugin-comment-placeholder');
|
||||
annotation_container.classList.add('plugin-comment-placeholder');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ export default class PluginsAnnotations extends Plugin {
|
|||
}
|
||||
annotation_div.classList.remove('plugin-comment-placeholder');
|
||||
if (this.settings.hide_placeholders) {
|
||||
comment_container.classList.remove('plugin-comment-placeholder');
|
||||
annotation_container.classList.remove('plugin-comment-placeholder');
|
||||
}
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(annotation_div);
|
||||
|
|
@ -339,7 +339,7 @@ export default class PluginsAnnotations extends Plugin {
|
|||
annotation_div.innerText = placeholder;
|
||||
annotation_div.classList.add('plugin-comment-placeholder');
|
||||
if (this.settings.hide_placeholders) {
|
||||
comment_container.classList.add('plugin-comment-placeholder');
|
||||
annotation_container.classList.add('plugin-comment-placeholder');
|
||||
}
|
||||
isPlaceholder = true;
|
||||
} else {
|
||||
|
|
@ -370,8 +370,8 @@ export default class PluginsAnnotations extends Plugin {
|
|||
this.debouncedSaveAnnotations();
|
||||
});
|
||||
|
||||
comment_container.appendChild(annotation_div);
|
||||
descriptionDiv.appendChild(comment_container);
|
||||
annotation_container.appendChild(annotation_div);
|
||||
descriptionDiv.appendChild(annotation_container);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,12 +24,17 @@
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Show comment container when hovering over the plugin container */
|
||||
.setting-item:hover .plugin-comment.plugin-comment-placeholder {
|
||||
display: block;
|
||||
.plugin-comment-annotation::after {
|
||||
content: "" !important;
|
||||
}
|
||||
|
||||
.plugin-comment-annotation {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Show comment container when hovering over the plugin container */
|
||||
.setting-item:hover .plugin-comment.plugin-comment-placeholder {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue