#120 - Disabling PDF Indexing on iOS
This commit is contained in:
@@ -143,27 +143,29 @@ export class SettingsTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
// PDF Indexing
|
// PDF Indexing - disabled on iOS
|
||||||
const indexPDFsDesc = new DocumentFragment()
|
if (!Platform.isIosApp) {
|
||||||
indexPDFsDesc.createSpan({}, span => {
|
const indexPDFsDesc = new DocumentFragment()
|
||||||
span.innerHTML = `Omnisearch will include PDFs in search results.
|
indexPDFsDesc.createSpan({}, span => {
|
||||||
<ul>
|
span.innerHTML = `Omnisearch will include PDFs in search results.
|
||||||
<li>⚠️ Depending on their size, PDFs can take anywhere from a few seconds to 2 minutes to be processed.</li>
|
<ul>
|
||||||
<li>⚠️ Texts extracted from PDFs may contain errors such as missing spaces, or spaces in the middle of words.</li>
|
<li>⚠️ Depending on their size, PDFs can take anywhere from a few seconds to 2 minutes to be processed.</li>
|
||||||
<li>⚠️ Some PDFs can't be processed correctly and will return an empty text.</li>
|
<li>⚠️ Texts extracted from PDFs may contain errors such as missing spaces, or spaces in the middle of words.</li>
|
||||||
<li>This feature is currently a work-in-progress, please report issues that you might experience.</li>
|
<li>⚠️ Some PDFs can't be processed correctly and will return an empty text.</li>
|
||||||
</ul>
|
<li>This feature is currently a work-in-progress, please report issues that you might experience.</li>
|
||||||
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
</ul>
|
||||||
})
|
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
|
||||||
new Setting(containerEl)
|
})
|
||||||
.setName('BETA - PDF Indexing')
|
new Setting(containerEl)
|
||||||
.setDesc(indexPDFsDesc)
|
.setName('BETA - PDF Indexing')
|
||||||
.addToggle(toggle =>
|
.setDesc(indexPDFsDesc)
|
||||||
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
.addToggle(toggle =>
|
||||||
settings.PDFIndexing = v
|
toggle.setValue(settings.PDFIndexing).onChange(async v => {
|
||||||
await saveSettings(this.plugin)
|
settings.PDFIndexing = v
|
||||||
})
|
await saveSettings(this.plugin)
|
||||||
)
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
// #endregion Behavior
|
// #endregion Behavior
|
||||||
|
|
||||||
// #region User Interface
|
// #region User Interface
|
||||||
@@ -324,6 +326,12 @@ export let settings = Object.assign({}, DEFAULT_SETTINGS) as OmnisearchSettings
|
|||||||
|
|
||||||
export async function loadSettings(plugin: Plugin): Promise<void> {
|
export async function loadSettings(plugin: Plugin): Promise<void> {
|
||||||
settings = Object.assign({}, DEFAULT_SETTINGS, await plugin.loadData())
|
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)
|
showExcerpt.set(settings.showExcerpt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user