mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-03-26 10:14:06 +08:00
Update JavaScript dependencies (#1248)
Signed-off-by: Mike Ralphson <mike.ralphson@gmail.com>
This commit is contained in:
committed by
Matthew Peveler
parent
1b78587ff1
commit
36f82aa880
10
README.md
10
README.md
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
4
source/javascripts/lib/_imagesloaded.min.js
vendored
4
source/javascripts/lib/_imagesloaded.min.js
vendored
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
Reference in New Issue
Block a user