minor updates to mount view

This commit is contained in:
2024-02-23 14:50:13 +01:00
parent bc761fb09a
commit 71bd1b7771

24
main.js
View File

@@ -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)