Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yy4382 committed May 15, 2024
1 parent 3ceed26 commit a04afb2
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,57 @@ export default class Ob2StaticPlugin extends Plugin {
settings: StaticExporterSettings;

async onload(): Promise<void> {
await this.loadSettings();
// await this.loadSettings();

// This creates an icon in the left ribbon.
this.addRibbonIcon(
"file-up",
"Current file - Static Site MD Export",
async (evt: MouseEvent) => {
// Called when the user clicks the icon.
new Notice("Starting process");
const tFiles = [this.app.workspace.getActiveFile() as TFile];
if (tFiles[0] === null) {
new Notice("No file active");
return;
}
await this.process(tFiles);
}
);
this.addRibbonIcon(
"folder-up",
"All validate files - Static Site MD Export",
async (evt: MouseEvent) => {
// Called when the user clicks the icon.
new Notice("Starting process");
const tFiles = this.app.vault.getFiles();
await this.process(tFiles);
}
);
this.addRibbonIcon(
"play-square",
"Trigger GitHub Action deploy",
(evt: MouseEvent) => {
// Called when the user clicks the icon.
triggerGitHubDispatchEvent(
this.settings.build.webhook_token,
this.settings.build.user,
this.settings.build.repo,
this.settings.build.event_type
);
new Notice("Sent GitHub Action deploy Webhook");
}
).setAttribute("id", "rb-sse-deploy-icon");
// // This creates an icon in the left ribbon.
// this.addRibbonIcon(
// "file-up",
// "Current file - Static Site MD Export",
// async (evt: MouseEvent) => {
// // Called when the user clicks the icon.
// new Notice("Starting process");
// const tFiles = [this.app.workspace.getActiveFile() as TFile];
// if (tFiles[0] === null) {
// new Notice("No file active");
// return;
// }
// await this.process(tFiles);
// }
// );
// this.addRibbonIcon(
// "folder-up",
// "All validate files - Static Site MD Export",
// async (evt: MouseEvent) => {
// // Called when the user clicks the icon.
// new Notice("Starting process");
// const tFiles = this.app.vault.getFiles();
// await this.process(tFiles);
// }
// );
// this.addRibbonIcon(
// "play-square",
// "Trigger GitHub Action deploy",
// (evt: MouseEvent) => {
// // Called when the user clicks the icon.
// triggerGitHubDispatchEvent(
// this.settings.build.webhook_token,
// this.settings.build.user,
// this.settings.build.repo,
// this.settings.build.event_type
// );
// new Notice("Sent GitHub Action deploy Webhook");
// }
// ).setAttribute("id", "rb-sse-deploy-icon");

if (!this.settings.build.enable) {
// Don't know why i need to use setTimeout to remove the icon
setTimeout(() => {
document.getElementById("rb-sse-deploy-icon")?.remove();
}, 100);
}
// if (!this.settings.build.enable) {
// // Don't know why i need to use setTimeout to remove the icon
// setTimeout(() => {
// document.getElementById("rb-sse-deploy-icon")?.remove();
// }, 100);
// }

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

onunload(): void {}
Expand Down

0 comments on commit a04afb2

Please sign in to comment.