mirror of
https://github.com/rordaz/ColorTab.git
synced 2026-07-22 07:48:53 +00:00
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.
This commit is contained in:
parent
c1efd7439b
commit
5553a7d19c
2 changed files with 24 additions and 3 deletions
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -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.
|
||||
6
main.ts
6
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(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue