Update JavaScript dependencies (#1248)

Signed-off-by: Mike Ralphson <mike.ralphson@gmail.com>
This commit is contained in:
Mike Ralphson
2020-06-09 00:55:30 +01:00
committed by Matthew Peveler
parent 1b78587ff1
commit 36f82aa880
5 changed files with 4924 additions and 2726 deletions

View File

@@ -79,3 +79,13 @@ Thanks to the following people who have submitted major pull requests:
- [@cvkef](https://github.com/cvkef)
Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles.
<<<<<<< HEAD
=======
Special Thanks
--------------------
- [Middleman](https://github.com/middleman/middleman)
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
>>>>>>> Update JavaScript dependencies (#1248)

View File

@@ -8,32 +8,36 @@
var highlightOpts = { element: 'span', className: 'search-highlight' };
var searchDelay = 0;
var timeoutHandle = 0;
var index;
var index = new lunr.Index();
function populate() {
index = lunr(function(){
index.ref('id');
index.field('title', { boost: 10 });
index.field('body');
index.pipeline.add(lunr.trimmer, lunr.stopWordFilter);
this.ref('id');
this.field('title', { boost: 10 });
this.field('body');
this.pipeline.add(lunr.trimmer, lunr.stopWordFilter);
var lunrConfig = this;
$('h1, h2').each(function() {
var title = $(this);
var body = title.nextUntil('h1, h2');
lunrConfig.add({
id: title.prop('id'),
title: title.text(),
body: body.text()
});
});
});
determineSearchDelay();
}
$(populate);
$(bind);
function populate() {
$('h1, h2').each(function() {
var title = $(this);
var body = title.nextUntil('h1, h2');
index.add({
id: title.prop('id'),
title: title.text(),
body: body.text()
});
});
determineSearchDelay();
}
function determineSearchDelay() {
if(index.tokenStore.length>5000) {
if (index.tokenSet.toArray().length>5000) {
searchDelay = 300;
}
}
@@ -51,7 +55,7 @@
}();
wait(function(){
search(e);
}, searchDelay );
}, searchDelay);
});
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff