From 5553a7d19c252b69db20965b676e87935ae6a5d0 Mon Sep 17 00:00:00 2001 From: rordaz Date: Mon, 15 Jun 2026 12:49:26 -0500 Subject: [PATCH] Complying with Obsidian guidelines. License added, and some code refactored to be more efficient. Also added a new function to handle user input more effectively. --- LICENSE | 21 +++++++++++++++++++++ main.ts | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2342f85 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Rafael Ordaz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/main.ts b/main.ts index 5564afb..cad5900 100644 --- a/main.ts +++ b/main.ts @@ -76,7 +76,7 @@ export default class ColorTabPlugin extends Plugin { private registerColorCommands() { this.settings.colors.forEach(({ name, color }) => { this.addCommand({ - id: `color-tab-set-${name.toLowerCase().replace(/\s+/g, "-")}`, + id: `set-${name.toLowerCase().replace(/\s+/g, "-")}`, name: `Set tab color: ${name}`, checkCallback: (checking: boolean) => { const leaf = this.app.workspace.activeLeaf; @@ -88,7 +88,7 @@ export default class ColorTabPlugin extends Plugin { }); this.addCommand({ - id: "color-tab-remove", + id: "remove", name: "Remove tab color", checkCallback: (checking: boolean) => { const leaf = this.app.workspace.activeLeaf; @@ -99,7 +99,7 @@ export default class ColorTabPlugin extends Plugin { }); this.addCommand({ - id: "color-tab-remove-all", + id: "remove-all", name: "Remove all tabs' color", callback: () => this.removeAllTabColors(), });