mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
feat: optional timeline registration
This commit is contained in:
parent
eee17ec0d1
commit
abe91b400d
6 changed files with 38 additions and 14 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "mapplus",
|
||||
"name": "Map+",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.5",
|
||||
"minAppVersion": "1.10.0",
|
||||
"description": "A performant and customizable map inside Bases",
|
||||
"author": "ccmdi",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "mapplus",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mapplus",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@deck.gl/core": "^9.1.15",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mapplus",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.5",
|
||||
"description": "A performant and customizable map inside Bases",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
18
src/main.ts
18
src/main.ts
|
|
@ -33,12 +33,9 @@ export default class MapPlugin extends Plugin {
|
|||
options: () => MapBasesView.getViewOptions(),
|
||||
});
|
||||
|
||||
this.registerBasesView('map-timeline', {
|
||||
name: 'Map Timeline',
|
||||
icon: 'lucide-calendar',
|
||||
factory: (controller, containerEl) => new MapTimelineBasesView(controller, containerEl, this),
|
||||
options: () => MapTimelineBasesView.getViewOptions(),
|
||||
});
|
||||
if (this.settings.enableTimelineView) {
|
||||
this.registerTimelineView();
|
||||
}
|
||||
|
||||
this.addSettingTab(new MapSettingTab(this.app, this));
|
||||
}
|
||||
|
|
@ -60,4 +57,13 @@ export default class MapPlugin extends Plugin {
|
|||
refreshAllMapViews() {
|
||||
this.app.workspace.trigger('map:refresh-all-views');
|
||||
}
|
||||
|
||||
registerTimelineView() {
|
||||
this.registerBasesView('map-timeline', {
|
||||
name: 'Map timeline',
|
||||
icon: 'lucide-calendar',
|
||||
factory: (controller, containerEl) => new MapTimelineBasesView(controller, containerEl, this),
|
||||
options: () => MapTimelineBasesView.getViewOptions(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ export interface MapPluginSettings {
|
|||
enableThumbnailCache: boolean;
|
||||
thumbnailTargetSize: number;
|
||||
tagSettings: MapTagSettings;
|
||||
enableTimelineView: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: MapPluginSettings = {
|
||||
|
|
@ -23,7 +24,8 @@ export const DEFAULT_SETTINGS: MapPluginSettings = {
|
|||
transitionDuration: 1000,
|
||||
enableThumbnailCache: false,
|
||||
thumbnailTargetSize: 25,
|
||||
tagSettings: DEFAULT_MAP_TAG_SETTINGS
|
||||
tagSettings: DEFAULT_MAP_TAG_SETTINGS,
|
||||
enableTimelineView: false
|
||||
};
|
||||
|
||||
export class MapSettingTab extends PluginSettingTab {
|
||||
|
|
@ -223,5 +225,23 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
}
|
||||
|
||||
renderTagCustomizations(containerEl, this.app, this.plugin);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Views')
|
||||
.setHeading();
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Enable map timeline view')
|
||||
.setDesc('Enable the map timeline view for filtering by date range (disable requires restart)')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.enableTimelineView)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.enableTimelineView = value;
|
||||
await this.plugin.saveSettings();
|
||||
|
||||
if (value) {
|
||||
this.plugin.registerTimelineView();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
{
|
||||
"1.0.0": "1.10.0",
|
||||
"1.0.1": "1.10.0",
|
||||
"1.0.2": "1.10.0"
|
||||
"1.0.0": "1.10.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue