Squashed commit of the following:
commit 3b229cad538ad88ef2d366964c4261bc0e02fb7c Author: Simon Cambier <simon.cambier@protonmail.com> Date: Sat Nov 5 14:30:08 2022 +0100 1.8.0-beta.1 commit f43c369b2dd0a1083b171724e3f7466429505629 Author: Simon Cambier <simon.cambier@protonmail.com> Date: Sat Nov 5 13:39:45 2022 +0100 Squashed commit of the following: commit 93508ee95046385baf62475e5bd835ed9fafe6d3 Author: Simon Cambier <simon.cambier@protonmail.com> Date: Sat Nov 5 13:35:56 2022 +0100 Cleaning commit 205e6a7cce4c1939338820f366f7ae8a067ec7fb Author: Simon Cambier <simon.cambier@protonmail.com> Date: Fri Nov 4 08:53:46 2022 +0100 Added logs commit ea19b94e164581829908ac71d09a60e230925a7f Author: Simon Cambier <simon.cambier@protonmail.com> Date: Thu Nov 3 22:27:24 2022 +0100 Notices commit 53ff4e822b3c292a56da150b94a1cfe43e199d44 Author: Simon Cambier <simon.cambier@protonmail.com> Date: Thu Nov 3 22:27:09 2022 +0100 Custom minisearch build + Notice when the cache could be corrupted commit 498408afd1c350dd68969318c3533fff8aa6c172 Author: Simon Cambier <simon.cambier@protonmail.com> Date: Thu Nov 3 22:26:22 2022 +0100 Added a button to manually clear the cache commit 90afe5d3868989626ba4613b064e24ac7efa88be Author: Simon Cambier <simon.cambier@protonmail.com> Date: Thu Nov 3 22:03:41 2022 +0100 Optimized loading minisearch from cache commit 719dcb9c82f09f56dabb828ac13c9c1db7f795bb Author: Simon Cambier <simon.cambier@protonmail.com> Date: Thu Nov 3 21:43:49 2022 +0100 #92 - Refactored cache to make it behave like pre-indexedDb commit 2164ccfa39d83eef23231d01e8aa35ac30e0d31c Author: Simon Cambier <simon.cambier@protonmail.com> Date: Wed Nov 2 23:13:59 2022 +0100 Removed cache & tmp engine commit 50eb33bbd4d074be9a9952eaf871cd8f58b327e6 Author: Simon Cambier <simon.cambier@protonmail.com> Date: Wed Nov 2 22:56:04 2022 +0100 More efficient loading of PDFs commita6342a675fAuthor: Simon Cambier <simon.cambier@protonmail.com> Date: Wed Nov 2 10:34:02 2022 +0100 #120 - Cleaning of old cache databases commitb6890567f3Author: Simon Cambier <simon.cambier@protonmail.com> Date: Mon Oct 31 17:28:17 2022 +0100 Updated Readme
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
Notice,
|
||||
Platform,
|
||||
Plugin,
|
||||
PluginSettingTab,
|
||||
@@ -6,6 +7,7 @@ import {
|
||||
SliderComponent,
|
||||
} from 'obsidian'
|
||||
import { writable } from 'svelte/store'
|
||||
import { database } from './database'
|
||||
import type OmnisearchPlugin from './main'
|
||||
|
||||
interface WeightingSettings {
|
||||
@@ -143,11 +145,10 @@ export class SettingsTab extends PluginSettingTab {
|
||||
})
|
||||
)
|
||||
|
||||
// PDF Indexing - disabled on iOS
|
||||
if (!Platform.isIosApp) {
|
||||
const indexPDFsDesc = new DocumentFragment()
|
||||
indexPDFsDesc.createSpan({}, span => {
|
||||
span.innerHTML = `Omnisearch will include PDFs in search results.
|
||||
// PDF Indexing
|
||||
const indexPDFsDesc = new DocumentFragment()
|
||||
indexPDFsDesc.createSpan({}, span => {
|
||||
span.innerHTML = `Omnisearch will include PDFs in search results.
|
||||
<ul>
|
||||
<li>⚠️ Depending on their size, PDFs can take anywhere from a few seconds to 2 minutes to be processed.</li>
|
||||
<li>⚠️ Texts extracted from PDFs may contain errors such as missing spaces, or spaces in the middle of words.</li>
|
||||
@@ -155,17 +156,17 @@ export class SettingsTab extends PluginSettingTab {
|
||||
<li>This feature is currently a work-in-progress, please report issues that you might experience.</li>
|
||||
</ul>
|
||||
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
||||
})
|
||||
new Setting(containerEl)
|
||||
.setName('BETA - PDF Indexing')
|
||||
.setDesc(indexPDFsDesc)
|
||||
.addToggle(toggle =>
|
||||
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
||||
settings.PDFIndexing = v
|
||||
await saveSettings(this.plugin)
|
||||
})
|
||||
)
|
||||
}
|
||||
})
|
||||
new Setting(containerEl)
|
||||
.setName('BETA - PDF Indexing')
|
||||
.setDesc(indexPDFsDesc)
|
||||
.addToggle(toggle =>
|
||||
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
||||
settings.PDFIndexing = v
|
||||
await saveSettings(this.plugin)
|
||||
})
|
||||
)
|
||||
|
||||
// #endregion Behavior
|
||||
|
||||
// #region User Interface
|
||||
@@ -276,6 +277,29 @@ export class SettingsTab extends PluginSettingTab {
|
||||
.addSlider(cb => this.weightSlider(cb, 'weightH3'))
|
||||
|
||||
// #endregion Results Weighting
|
||||
|
||||
// #region Danger Zone
|
||||
|
||||
new Setting(containerEl).setName('Danger Zone').setHeading()
|
||||
|
||||
const resetCacheDesc = new DocumentFragment()
|
||||
resetCacheDesc.createSpan({}, span => {
|
||||
span.innerHTML = `Erase all Omnisearch cache data.
|
||||
Use this if Omnisearch results are inconsistent, missing, or appear outdated.<br>
|
||||
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
||||
})
|
||||
new Setting(containerEl)
|
||||
.setName('Clear cache data')
|
||||
.setDesc(resetCacheDesc)
|
||||
.addButton(cb => {
|
||||
cb.setButtonText('Clear cache')
|
||||
cb.onClick(async () => {
|
||||
await database.clearCache()
|
||||
new Notice('Omnisearch - Cache cleared. Please restart Obsidian.')
|
||||
})
|
||||
})
|
||||
|
||||
//#endregion Danger Zone
|
||||
}
|
||||
|
||||
weightSlider(cb: SliderComponent, key: keyof WeightingSettings): void {
|
||||
@@ -317,8 +341,6 @@ export const DEFAULT_SETTINGS: OmnisearchSettings = {
|
||||
weightH2: 1.3,
|
||||
weightH3: 1.1,
|
||||
|
||||
// persistCache: false,
|
||||
|
||||
welcomeMessage: '',
|
||||
} as const
|
||||
|
||||
@@ -327,11 +349,6 @@ export let settings = Object.assign({}, DEFAULT_SETTINGS) as OmnisearchSettings
|
||||
export async function loadSettings(plugin: Plugin): Promise<void> {
|
||||
settings = Object.assign({}, DEFAULT_SETTINGS, await plugin.loadData())
|
||||
|
||||
// Make sure that PDF indexing is disabled on iOS
|
||||
if (Platform.isIosApp) {
|
||||
settings.PDFIndexing = false
|
||||
}
|
||||
|
||||
showExcerpt.set(settings.showExcerpt)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user