Updated labels and incidentally "fixes" #147

This commit is contained in:
Simon Cambier
2022-12-11 21:37:56 +01:00
parent da2dd90374
commit 3bdbfe12bf
2 changed files with 9 additions and 12 deletions

View File

@@ -148,7 +148,7 @@ async function populateIndex(): Promise<void> {
) )
} }
if (diff.toAdd.length >= 500) { if (diff.toAdd.length >= 1000 && !Platform.isIosApp) {
new Notice( new Notice(
`Omnisearch - ${diff.toAdd.length} files need to be indexed. Obsidian may experience stutters and freezes during the process`, `Omnisearch - ${diff.toAdd.length} files need to be indexed. Obsidian may experience stutters and freezes during the process`,
10_000 10_000
@@ -165,7 +165,7 @@ async function populateIndex(): Promise<void> {
} }
console.timeEnd('Omnisearch - Indexing total time') console.timeEnd('Omnisearch - Indexing total time')
if (diff.toAdd.length >= 500) { if (diff.toAdd.length >= 1000) {
new Notice(`Omnisearch - Your files have been indexed.`) new Notice(`Omnisearch - Your files have been indexed.`)
} }
indexingStep.set(IndexingStepType.Done) indexingStep.set(IndexingStepType.Done)

View File

@@ -87,13 +87,8 @@ export class SettingsTab extends PluginSettingTab {
if (!Platform.isMobileApp) { if (!Platform.isMobileApp) {
const indexPDFsDesc = new DocumentFragment() const indexPDFsDesc = new DocumentFragment()
indexPDFsDesc.createSpan({}, span => { indexPDFsDesc.createSpan({}, span => {
span.innerHTML = `Omnisearch will include PDFs in search results. span.innerHTML = `Omnisearch will include PDFs in search results.<br>
<ul> ⚠️ PDFs first need to be processed. This can take anywhere from a few seconds to 2 minutes, then the resulting text is cached.</li>
<li>⚠️ Each PDF 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>
<li>⚠️ Some PDFs can't be processed correctly and will return an empty text.</li>
<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>` <strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
}) })
new Setting(containerEl) new Setting(containerEl)
@@ -131,8 +126,10 @@ export class SettingsTab extends PluginSettingTab {
// Additional files to index // Additional files to index
const indexedFileTypesDesc = new DocumentFragment() const indexedFileTypesDesc = new DocumentFragment()
indexedFileTypesDesc.createSpan({}, span => { indexedFileTypesDesc.createSpan({}, span => {
span.innerHTML = `In addition to standard <code>md</code> files, Omnisearch can also index other plain text files.<br/> span.innerHTML = `In addition to standard <code>md</code> files, Omnisearch can also index other <strong style="color: var(--text-accent)">plaintext</strong> files.<br/>
Add extensions separated by a space, without the dot. Example: "<code>txt org</code>".<br /> Add extensions separated by a space, without the dot. Example: "<code>txt org</code>".<br />
⚠️ <span style="color: var(--text-accent)">Using extensions of non-plaintext files (like .docx or .pptx) WILL cause crashes,
because Omnisearch will try to index their content.</span><br />
<strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>` <strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>`
}) })
new Setting(containerEl) new Setting(containerEl)
@@ -172,8 +169,8 @@ export class SettingsTab extends PluginSettingTab {
const diacriticsDesc = new DocumentFragment() const diacriticsDesc = new DocumentFragment()
diacriticsDesc.createSpan({}, span => { diacriticsDesc.createSpan({}, span => {
span.innerHTML = `Normalize diacritics in search terms. Words like "brûlée" or "žluťoučký" will be indexed as "brulee" and "zlutoucky".<br/> span.innerHTML = `Normalize diacritics in search terms. Words like "brûlée" or "žluťoučký" will be indexed as "brulee" and "zlutoucky".<br/>
<strong style="color: var(--text-accent)"><em>You probably shouldn't disable this</em>.<br> ⚠️<span style="color: var(--text-accent)">You probably should NOT disable this.</span><br>
Needs a restart to fully take effect.</strong> <strong style="color: var(--text-accent)">Needs a restart to fully take effect.</strong>
` `
}) })
new Setting(containerEl) new Setting(containerEl)