From 10a9a4c58c852ce801c5e8146e41e90d04937220 Mon Sep 17 00:00:00 2001 From: Gabriele Cannata Date: Mon, 21 Aug 2023 16:54:53 +0200 Subject: [PATCH] Removed empty code --- LICENSE | 19 +-------------- src/Settings.ts | 2 -- src/main.ts | 62 +++---------------------------------------------- 3 files changed, 4 insertions(+), 79 deletions(-) diff --git a/LICENSE b/LICENSE index ed64ab4..daf488f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) [2022] [Gabriele Cannata] +Copyright (c) [2023] [Gabriele Cannata] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,20 +19,3 @@ 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. -Copy license text to clipboard -Suggest this license -Make a pull request to suggest this license for a project that is not licensed. Please be polite: see if a license has already been suggested, try to suggest a license fitting for the project’s community, and keep your communication with project maintainers friendly. - -Enter GitHub repository URL -How to apply this license -Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders. - -Optional steps -Add MIT to your project’s package description, if applicable (e.g., Node.js, Ruby, and Rust). This will ensure the license is displayed in package directories. - - Source -Who’s using this license? -Babel -.NET -Rails -About Terms of Service Help improve this page diff --git a/src/Settings.ts b/src/Settings.ts index a1a8e7f..3bcf55a 100644 --- a/src/Settings.ts +++ b/src/Settings.ts @@ -1,12 +1,10 @@ export interface SheetsSettings { - addRibbonIcon: boolean; enableSaveToFile: boolean; autoSave: boolean; } export const DEFAULT_SETTINGS: SheetsSettings = { - addRibbonIcon: false, enableSaveToFile: false, autoSave: true } diff --git a/src/main.ts b/src/main.ts index 891f379..7a80fc3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -34,60 +34,14 @@ export default class SheetjsPlugin extends Plugin { addIcon("sheet",sheetSVG); - if (this.settings.addRibbonIcon) { - // This creates an icon in the left ribbon. - const ribbonIconEl = this.addRibbonIcon( - "sheet", - "Add Sheet", - (evt: MouseEvent) => { - this.addTable(); - } - ); - // Perform additional things with the ribbon - ribbonIconEl.addClass("Sheetjs-ribbon-class"); - } - - this.addCommand({ - id: "add-sheet-table", - name: "Add Sheet Table", - callback: () => this.addTable(), - }); - - - this.app.workspace.onLayoutReady(() => { - - }); - this.registerCodeBlock(); - this.registerPostProcessor(); - this.registerEditorExtensions(); - - this.app.workspace.on( - "active-leaf-change", - (leaf: WorkspaceLeaf | null) => { - if (leaf?.view instanceof MarkdownView) { - // @ts-expect-error, not typed - const editorView = leaf.view.editor.cm as EditorView; - - } - }, - this - ); - - this.app.workspace.on( - "codemirror", - (cm: CodeMirror.Editor) => { - }, - this - ); + this.addSettingTab(new SheetjsSettingsTab(this.app, this)); } - addTable() { - throw new Error("Method not implemented."); - } + onunload() { } @@ -108,8 +62,7 @@ export default class SheetjsPlugin extends Plugin { async registerCodeBlock() { - await loadMathJax(); - await finishRenderMath(); + this.registerMarkdownCodeBlockProcessor( "sheet", (source, el, ctx) => { @@ -118,15 +71,6 @@ export default class SheetjsPlugin extends Plugin { ); } - async registerPostProcessor() { - // await loadMathJax(); - // await finishRenderMath(); - // this.registerMarkdownPostProcessor(getPostPrcessor(this.settings)); - } - - async registerEditorExtensions() { - // this.registerEditorExtension([resultField, SheetjsConfigField]); - } }