From 71bd1b7771967d84e4482a97f01f4f51680e71d0 Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 23 Feb 2024 14:50:13 +0100 Subject: [PATCH] minor updates to mount view --- main.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/main.js b/main.js index 782a28c..d9b357d 100644 --- a/main.js +++ b/main.js @@ -312,6 +312,9 @@ class CalendarView extends ItemView this.headEl = container.createEl("div", { cls: "frcal__days frcal__day_head" }); this.weekNumEl = this.headEl.createEl("div", { cls: "frcal__time" }); + this.weekNumEl.addEventListener('click', function(e){ + this.openMountView(); + }.bind(this)); this.dayHeads = [null, null, null, null, null, null, null]; for (let i = 0; i < 7; i++) { @@ -403,8 +406,14 @@ class CalendarView extends ItemView row.createEl("td", { attr: { rowspan: span } }).innerText = DateFormat.month[week.month()]; } - row.createEl('td', { class: 'frcal__week' }).innerText = week.isoWeek(); + row.createEl('td', { class: 'frcal__weekinmonth' }).innerText = week.isoWeek(); + + for (let day=week.dom(); day < week.dom()+7; day++) + { + row.createEl('td', { class: 'frcal__dayinmonth', content: day.ToString()}); + } } + this.monthView.style.display = "block"; } async onClose() @@ -629,20 +638,9 @@ class FRCalander extends Plugin this.registerView(VIEW_TYPE_CALENDAR, (leaf) => { return new CalendarView(leaf, this) }); this.addCommand({ - id: 'fr-calendar-scan-active', + id: 'fr-calendar-scan', name: 'scan active file', repeatable: false, - editorCallback: (editor) => { - //TODO: check if editor is valid - if (this.data == null) this.data = this.loadData(); - this.data = scanEditor(editor, this.data); - this.saveData(this.data); - } - }); - this.addCommand({ - id: 'fr-calendar-scan-test', - name: 'scan active file updated', - repeatable: false, callback: async () => { let file = this.app.workspace.getActiveFile(); if (file !== null)