Skip to content

Commit

Permalink
refactor: rename all classes according to plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
yesjinu committed Oct 16, 2022
1 parent 66f2933 commit d21900f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 37 deletions.
19 changes: 0 additions & 19 deletions components/SampleModal.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {App, PluginSettingTab, Setting} from "obsidian";
import StatusBarQuote from "../main";

class MySettingTab extends PluginSettingTab {
class StatusBarQuoteSettingTab extends PluginSettingTab {
plugin: StatusBarQuote;

constructor(app: App, plugin: StatusBarQuote) {
Expand Down Expand Up @@ -30,4 +30,4 @@ class MySettingTab extends PluginSettingTab {
}
}

export default MySettingTab;
export default StatusBarQuoteSettingTab;
31 changes: 15 additions & 16 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { Plugin } from 'obsidian';
import SampleModal from "./components/SampleModal";
import MySettingTab from "./components/MySettingTab";
import StatusBarQuoteSettingTab from "./components/StatusBarQuoteSettingTab";

interface MyPluginSettings {
interface StatusBarQuoteSettings {
quote: string;
}

const DEFAULT_SETTINGS: MyPluginSettings = {
const DEFAULT_SETTINGS: StatusBarQuoteSettings = {
quote: 'Take chances, make mistakes, get messy.',
}

export default class StatusBarQuote extends Plugin {
settings: MyPluginSettings;
settings: StatusBarQuoteSettings;

async onload() {
await this.loadSettings();
Expand All @@ -20,21 +19,21 @@ export default class StatusBarQuote extends Plugin {
statusBar.createEl("span", { text: `${this.settings.quote} ✍️` });

// TODO: Add ribbon icon that replace quote setting.
const ribbonIconEl = this.addRibbonIcon('dice', 'Replace quote', (evt: MouseEvent) => {
console.log("ribbon clicked")
});
// const ribbonIconEl = this.addRibbonIcon('dice', 'Replace quote', (evt: MouseEvent) => {
// console.log("ribbon clicked")
// });

// TODO: Add command that replace quote setting.
this.addCommand({
id: 'open-modal-replace-quote',
name: 'Replace status bar quote',
callback: () => {
new SampleModal(this.app).open();
}
});
// this.addCommand({
// id: 'open-modal-replace-quote',
// name: 'Replace status bar quote',
// callback: () => {
// new SampleModal(this.app).open();
// }
// });

// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new MySettingTab(this.app, this));
this.addSettingTab(new StatusBarQuoteSettingTab(this.app, this));
}

onunload() {
Expand Down

0 comments on commit d21900f

Please sign in to comment.