mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed initialization of index for localsearch
This commit is contained in:
parent
184e5f24e2
commit
3a25eb46d4
2
material/assets/javascripts/bundle.14729066.min.js
vendored
Normal file
2
material/assets/javascripts/bundle.14729066.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/javascripts/bundle.14729066.min.js.map
Normal file
1
material/assets/javascripts/bundle.14729066.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,10 +1,10 @@
|
||||
{
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.d76ca884.min.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.d76ca884.min.js.map",
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.14729066.min.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.14729066.min.js.map",
|
||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.dd2d8181.min.js",
|
||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.dd2d8181.min.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.edc88caf.min.js",
|
||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.edc88caf.min.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.542c1c70.min.js",
|
||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.542c1c70.min.js.map",
|
||||
"assets/stylesheets/main.css": "assets/stylesheets/main.5ac791a0.min.css",
|
||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.f5f04e6f.min.css"
|
||||
}
|
@ -179,7 +179,7 @@
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/vendor.dd2d8181.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.d76ca884.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.14729066.min.js' | url }}"></script>
|
||||
{%- set translations = {} -%}
|
||||
{%- for key in [
|
||||
"clipboard.copy",
|
||||
@ -202,7 +202,7 @@
|
||||
url: {
|
||||
base: "{{ base_url }}",
|
||||
worker: {
|
||||
search: "{{ 'assets/javascripts/worker/search.edc88caf.min.js' | url }}"
|
||||
search: "{{ 'assets/javascripts/worker/search.542c1c70.min.js' | url }}"
|
||||
}
|
||||
},
|
||||
features: {{ config.theme.features | tojson }}
|
||||
|
@ -20,15 +20,15 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Observable, Subject, from } from "rxjs"
|
||||
import { Observable, Subject, asyncScheduler, from } from "rxjs"
|
||||
import { ajax } from "rxjs/ajax"
|
||||
import {
|
||||
map,
|
||||
observeOn,
|
||||
pluck,
|
||||
shareReplay,
|
||||
switchMap,
|
||||
take,
|
||||
tap,
|
||||
withLatestFrom
|
||||
} from "rxjs/operators"
|
||||
|
||||
@ -151,11 +151,12 @@ export function setupSearchWorker(
|
||||
|
||||
// /* Send index to worker */
|
||||
// index$
|
||||
.pipe<SearchSetupMessage>(
|
||||
map(data => ({
|
||||
.pipe(
|
||||
map((data): SearchSetupMessage => ({
|
||||
type: SearchMessageType.SETUP,
|
||||
data
|
||||
}))
|
||||
})),
|
||||
observeOn(asyncScheduler) // make sure it runs on the next tick
|
||||
)
|
||||
.subscribe(tx$.next.bind(tx$))
|
||||
|
||||
|
@ -63,7 +63,7 @@ function setupLunrLanguages(config: SearchIndexConfig): void {
|
||||
|
||||
/* Load scripts synchronously */
|
||||
if (scripts.length)
|
||||
self.importScripts(
|
||||
importScripts(
|
||||
`${base}/min/lunr.stemmer.support.min.js`,
|
||||
...scripts
|
||||
)
|
||||
@ -109,6 +109,6 @@ export function handler(message: SearchMessage): SearchMessage {
|
||||
* Worker
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
self.addEventListener("message", ev => {
|
||||
self.postMessage(handler(ev.data))
|
||||
addEventListener("message", ev => {
|
||||
postMessage(handler(ev.data))
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user