mirror of
https://github.com/uthvah/sync-embeds.git
synced 2026-07-22 06:43:40 +00:00
parent
675ca16fa9
commit
ead4157754
4 changed files with 39 additions and 0 deletions
14
main.js
14
main.js
|
|
@ -1311,6 +1311,10 @@ var require_settings = __commonJS({
|
|||
this.plugin.settings.showFocusHighlight = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
new Setting(containerEl).setName("Hide linked mentions").setDesc("Hide the linked mentions panel that appears at the bottom of embedded notes").addToggle((toggle) => toggle.setValue(this.plugin.settings.hideLinkedMentions).onChange(async (value) => {
|
||||
this.plugin.settings.hideLinkedMentions = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
containerEl.createEl("h3", { text: "Header Management" });
|
||||
new Setting(containerEl).setName("Show header hints").setDesc("Display helpful notices when header creation is blocked in section embeds").addToggle((toggle) => toggle.setValue(this.plugin.settings.showHeaderHints).onChange(async (value) => {
|
||||
this.plugin.settings.showHeaderHints = value;
|
||||
|
|
@ -1470,6 +1474,7 @@ var DEFAULT_SETTINGS = {
|
|||
showFocusHighlight: true,
|
||||
showHeaderHints: true,
|
||||
// NEW: Header hints (enforcement is always on)
|
||||
hideLinkedMentions: true,
|
||||
debugMode: false
|
||||
};
|
||||
module.exports = class SyncEmbedPlugin extends Plugin {
|
||||
|
|
@ -1530,6 +1535,7 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
this.registerDomEvent(document, "focusout", this.trackFocusLoss.bind(this));
|
||||
this.addSettingTab(new SyncEmbedsSettingTab(this.app, this));
|
||||
this.updateFocusHighlight();
|
||||
this.updateLinkedMentions();
|
||||
this.log("Sync Embeds plugin loaded successfully");
|
||||
}
|
||||
onunload() {
|
||||
|
|
@ -1669,6 +1675,7 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
await this.saveData(this.settings);
|
||||
this.refreshAllEmbeds();
|
||||
this.updateFocusHighlight();
|
||||
this.updateLinkedMentions();
|
||||
}
|
||||
updateFocusHighlight() {
|
||||
if (this.settings.showFocusHighlight) {
|
||||
|
|
@ -1677,6 +1684,13 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
document.body.addClass("sync-embeds-no-focus-highlight");
|
||||
}
|
||||
}
|
||||
updateLinkedMentions() {
|
||||
if (this.settings.hideLinkedMentions) {
|
||||
document.body.addClass("sync-embeds-hide-linked-mentions");
|
||||
} else {
|
||||
document.body.removeClass("sync-embeds-hide-linked-mentions");
|
||||
}
|
||||
}
|
||||
refreshAllEmbeds() {
|
||||
document.querySelectorAll(".sync-container").forEach((container) => {
|
||||
container.style.setProperty("--sync-embed-height", this.settings.embedHeight);
|
||||
|
|
|
|||
11
src/main.js
11
src/main.js
|
|
@ -15,6 +15,7 @@ const DEFAULT_SETTINGS = {
|
|||
lazyLoadThreshold: '100px',
|
||||
showFocusHighlight: true,
|
||||
showHeaderHints: true, // NEW: Header hints (enforcement is always on)
|
||||
hideLinkedMentions: true,
|
||||
debugMode: false
|
||||
};
|
||||
|
||||
|
|
@ -90,6 +91,7 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
|
||||
// Apply focus highlight setting
|
||||
this.updateFocusHighlight();
|
||||
this.updateLinkedMentions();
|
||||
|
||||
// Log successful load
|
||||
this.log('Sync Embeds plugin loaded successfully');
|
||||
|
|
@ -271,6 +273,7 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
await this.saveData(this.settings);
|
||||
this.refreshAllEmbeds();
|
||||
this.updateFocusHighlight();
|
||||
this.updateLinkedMentions();
|
||||
}
|
||||
|
||||
updateFocusHighlight() {
|
||||
|
|
@ -281,6 +284,14 @@ module.exports = class SyncEmbedPlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
updateLinkedMentions() {
|
||||
if (this.settings.hideLinkedMentions) {
|
||||
document.body.addClass('sync-embeds-hide-linked-mentions');
|
||||
} else {
|
||||
document.body.removeClass('sync-embeds-hide-linked-mentions');
|
||||
}
|
||||
}
|
||||
|
||||
refreshAllEmbeds() {
|
||||
// Update CSS variables for all sync containers
|
||||
document.querySelectorAll('.sync-container').forEach(container => {
|
||||
|
|
|
|||
|
|
@ -168,6 +168,16 @@ class SyncEmbedsSettingTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Hide linked mentions')
|
||||
.setDesc('Hide the linked mentions panel that appears at the bottom of embedded notes')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.hideLinkedMentions)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.hideLinkedMentions = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
// === HEADER MANAGEMENT SECTION ===
|
||||
containerEl.createEl('h3', { text: 'Header Management' });
|
||||
|
||||
|
|
|
|||
|
|
@ -301,6 +301,10 @@ body.sync-embeds-no-focus-highlight .sync-embed:focus-within {
|
|||
outline-color: transparent;
|
||||
}
|
||||
|
||||
body.sync-embeds-hide-linked-mentions .sync-embed .embedded-backlinks {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* === SCROLLBAR === */
|
||||
.sync-embed::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
|
|
|
|||
Loading…
Reference in a new issue