mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
chore: plugin lint
This commit is contained in:
parent
e8ce9d575e
commit
8839b94829
9 changed files with 33 additions and 52 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import esbuild from "esbuild";
|
||||
import process from "process";
|
||||
import builtins from "builtin-modules";
|
||||
import { builtinModules } from "node:module";
|
||||
|
||||
const banner =
|
||||
`/*
|
||||
|
|
@ -31,7 +31,7 @@ const context = await esbuild.context({
|
|||
"@lezer/common",
|
||||
"@lezer/highlight",
|
||||
"@lezer/lr",
|
||||
...builtins],
|
||||
...builtinModules],
|
||||
format: "cjs",
|
||||
target: "es2020",
|
||||
logLevel: "info",
|
||||
|
|
|
|||
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -15,7 +15,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.6",
|
||||
"builtin-modules": "3.3.0",
|
||||
"esbuild": "0.17.3",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-obsidianmd": "^0.1.7",
|
||||
|
|
@ -2049,19 +2048,6 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/builtin-modules": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
|
||||
"integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.6",
|
||||
"builtin-modules": "3.3.0",
|
||||
"esbuild": "0.17.3",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-obsidianmd": "^0.1.7",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default class MapPlugin extends Plugin {
|
|||
if (this.settings.enableThumbnailCache) {
|
||||
await this.thumbnailCache.loadCache();
|
||||
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
void this.thumbnailCache.generatePendingThumbnails();
|
||||
}, 2000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ export function createMapRenderer(config: MapRendererOptions): Deck<MapViewType[
|
|||
onAfterRender: () => {
|
||||
if (options.onTilesLoaded && !tilesLoadedCalled) {
|
||||
tilesLoadedCalled = true;
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
options.onTilesLoaded?.();
|
||||
}, 200);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
.onChange(async (value) => {
|
||||
this.plugin.settings.latKey = value;
|
||||
await this.plugin.saveSettings();
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
this.plugin.refreshAllMapViews();
|
||||
}, 1000);
|
||||
}));
|
||||
|
|
@ -70,7 +70,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
.onChange(async (value) => {
|
||||
this.plugin.settings.lngKey = value;
|
||||
await this.plugin.saveSettings();
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
this.plugin.refreshAllMapViews();
|
||||
}, 1000);
|
||||
}));
|
||||
|
|
@ -84,7 +84,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
.onChange(async (value) => {
|
||||
this.plugin.settings.strokeWidth = value;
|
||||
await this.plugin.saveSettings();
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
this.plugin.refreshAllMapViews();
|
||||
}, 250);
|
||||
}));
|
||||
|
|
@ -146,7 +146,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
|
||||
if (value) {
|
||||
await this.plugin.thumbnailCache.loadCache();
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
void this.plugin.thumbnailCache.generatePendingThumbnails();
|
||||
}, 500);
|
||||
}
|
||||
|
|
@ -191,7 +191,7 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
const refreshInterval = window.setInterval(() => {
|
||||
updateStatus();
|
||||
if (this.plugin.thumbnailCache.getCacheStats().pending === 0 && !this.plugin.thumbnailCache.isGenerating()) {
|
||||
activeWindow.clearInterval(refreshInterval);
|
||||
window.clearInterval(refreshInterval);
|
||||
this.display();
|
||||
}
|
||||
}, 500);
|
||||
|
|
@ -208,13 +208,13 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
|
||||
// force refresh markers for cover context
|
||||
this.plugin.refreshAllMapViews();
|
||||
await new Promise(resolve => activeWindow.setTimeout(resolve, 1000));
|
||||
await new Promise(resolve => window.setTimeout(resolve, 1000));
|
||||
|
||||
await this.plugin.thumbnailCache.rebuildCache((current, total) => {
|
||||
button.setButtonText(`Rebuilding ${current}/${total}...`);
|
||||
});
|
||||
|
||||
activeWindow.clearInterval(progressInterval);
|
||||
window.clearInterval(progressInterval);
|
||||
button.setButtonText('Rebuild cache');
|
||||
button.setDisabled(false);
|
||||
this.display();
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ export class MapBasesView extends BasesView {
|
|||
constructor(controller: QueryController, scrollEl: HTMLElement, plugin: MapPlugin) {
|
||||
super(controller);
|
||||
this.scrollEl = scrollEl;
|
||||
scrollEl.closest('.bases-view')?.addClass('bases-view-map');
|
||||
this.containerEl = scrollEl.createDiv({ cls: 'bases-map-container is-loading' });
|
||||
this.mapEl = this.containerEl.createDiv('bases-map');
|
||||
this.plugin = plugin;
|
||||
|
|
@ -253,7 +254,7 @@ export class MapBasesView extends BasesView {
|
|||
if (overlayHidden) return;
|
||||
overlayHidden = true;
|
||||
loadingOverlay.addClass('fade-out');
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
loadingOverlay.remove();
|
||||
}, 300);
|
||||
};
|
||||
|
|
@ -310,7 +311,7 @@ export class MapBasesView extends BasesView {
|
|||
this.createSearchBox();
|
||||
}
|
||||
|
||||
activeWindow.setTimeout(() => {
|
||||
window.setTimeout(() => {
|
||||
if (!tilesLoaded) {
|
||||
hideOverlay();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,9 +176,11 @@ export class MapTimelineBasesView extends MapBasesView {
|
|||
if (this.controlsExpanded) {
|
||||
playbackContainer.addClass('expanded');
|
||||
toggleButton.addClass('expanded');
|
||||
sliderContainer.addClass('has-expanded-controls');
|
||||
} else {
|
||||
playbackContainer.removeClass('expanded');
|
||||
toggleButton.removeClass('expanded');
|
||||
sliderContainer.removeClass('has-expanded-controls');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
41
styles.css
41
styles.css
|
|
@ -1,5 +1,5 @@
|
|||
.bases-view:has(.bases-map-container) {
|
||||
padding: 0px;
|
||||
.bases-view.bases-view-map {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.bases-map-container {
|
||||
|
|
@ -365,7 +365,7 @@
|
|||
top: 6px;
|
||||
right: 6px;
|
||||
width: 320px;
|
||||
padding: 12px 16px 8px 16px;
|
||||
padding: 12px 16px 8px;
|
||||
background: var(--background-primary);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
border-radius: 8px;
|
||||
|
|
@ -377,7 +377,7 @@
|
|||
transition: padding-bottom 0.3s ease;
|
||||
}
|
||||
|
||||
.bases-timeline-slider:has(.timeline-playback-controls.expanded) {
|
||||
.bases-timeline-slider.has-expanded-controls {
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
|
|
@ -415,11 +415,11 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.timeline-slider {
|
||||
width: 100% !important;
|
||||
.bases-timeline-slider .timeline-slider {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
margin: 0 0 8px 0 !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 0 8px;
|
||||
padding: 0;
|
||||
border-radius: 3px;
|
||||
background: var(--background-modifier-border);
|
||||
outline: none;
|
||||
|
|
@ -461,13 +461,13 @@
|
|||
justify-content: center;
|
||||
}
|
||||
|
||||
.timeline-toggle-button {
|
||||
.bases-timeline-slider .timeline-toggle-button {
|
||||
width: 100%;
|
||||
height: 14px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
background: transparent !important;
|
||||
background: transparent;
|
||||
color: var(--text-faint);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
|
|
@ -475,18 +475,18 @@
|
|||
justify-content: center;
|
||||
transition: color 0.15s ease;
|
||||
outline: none;
|
||||
box-shadow: none !important;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.timeline-toggle-button:hover {
|
||||
.bases-timeline-slider .timeline-toggle-button:hover {
|
||||
color: var(--text-muted);
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.timeline-toggle-button:active {
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
.bases-timeline-slider .timeline-toggle-button:active {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.timeline-toggle-button svg {
|
||||
|
|
@ -560,13 +560,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* should be specific enough */
|
||||
.input-row:has(input[placeholder="[[minLat, minLng], [maxLat, maxLng]]"]) .input-row-label::after {
|
||||
content: " (local images only)";
|
||||
color: var(--text-muted);
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* Map search box */
|
||||
.bases-map-search-container {
|
||||
|
|
|
|||
Loading…
Reference in a new issue