diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 84b8a66..0000000 --- a/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -# top-most EditorConfig file -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 4 -tab_width = 4 diff --git a/.gitignore b/.gitignore index 4c82e3c..d901fd1 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ package-lock.json # JetBrains IDE .idea/ +.editorconfig # Unit test reports TEST*.xml diff --git a/manifest.json b/manifest.json index 7da97b9..55e432a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "reclipped-official", "name": "ReClipped Official", - "version": "1.0.3", + "version": "1.0.4", "minAppVersion": "0.12.10", "description": "Official ReClipped and Obsidian integration", "author": "ReClipped", diff --git a/package.json b/package.json index 5e946a8..f634852 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reclipped-official", - "version": "1.0.0", + "version": "1.0.4", "description": "Automatically syncs your ReClipped annotations with Obsidian.", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index 4c300d2..39fe8ae 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,6 +69,7 @@ interface ReclippedPluginSettings { isSyncing: boolean; frequency: string; triggerOnLoad: boolean; + createCPFolders: boolean; lastSyncFailed: boolean; lastSyncedTimeEpoch: number; refreshVideos: boolean, @@ -90,6 +91,7 @@ const DEFAULT_SETTINGS: ReclippedPluginSettings = { reclippedDir: "ReClipped", frequency: "0", // manual by default triggerOnLoad: true, + createCPFolders: true, isSyncing: false, lastSyncFailed: false, lastSyncedTimeEpoch: 0, @@ -311,7 +313,9 @@ export default class ReclippedPlugin extends Plugin { this.notice(`Saving file ${cleanedFileName}`, false, 30); const processedFileName = normalizePath(this.settings.reclippedDir + '/' + cleanedFileName + '.md'); try { - await this.createChannelPlatformConnections(channelDict, platform, this.fs); + if (this.settings.createCPFolders) { + await this.createChannelPlatformConnections(channelDict, platform, this.fs); + } // write the actual files const contentToSave = json.annotations; let originalName = processedFileName; @@ -812,9 +816,26 @@ class ReclippedSettingTab extends PluginSettingTab { await this.plugin.saveSettings(); })); + new Setting(containerEl) + .setName("Create Platform and Channel folders") + .setDesc("If enabled, ReClipped will create Platform and Channel folders") + .addToggle((toggle) => { + toggle.setValue(this.plugin.settings.createCPFolders); + toggle.onChange((val) => { + this.plugin.settings.createCPFolders = val; + this.plugin.saveSettings(); + if (val){ + containerEl.getElementsByClassName("cp_folder")[0].removeAttribute("style"); + } else { + containerEl.getElementsByClassName("cp_folder")[0].setAttribute("style", "display:none"); + } + }); + }); + new Setting(containerEl) .setName("Customize Channel and Platform folder") .setDesc("Plugin will use /Channels, and /Platforms folder respectively by default ") + .setClass("cp_folder") .addButton((button) => { button.setButtonText("Customize").onClick(() => { window.open(`${baseURL}/account/sync_obsidian`); @@ -899,6 +920,9 @@ class ReclippedSettingTab extends PluginSettingTab { let el = containerEl.createEl("div", {cls: "rc-info-container"}); containerEl.find(".rc-setting-connect > .setting-item-control ").prepend(el); } + if (!this.plugin.settings.createCPFolders){ + containerEl.getElementsByClassName("cp_folder")[0].setAttribute("style", "display:none"); + } const help = containerEl.createEl('p', {text: "Question? Please see our "}); help.createEl('a', {text: "Documentation", href:"https://blog.reclipped.com/"}); help.createEl('span', {text:" or email us at "});