Skip to content

Commit 36f82aa

Browse files
MikeRalphsonMasterOdin
authored andcommitted
Update JavaScript dependencies (#1248)
Signed-off-by: Mike Ralphson <[email protected]>
1 parent 1b78587 commit 36f82aa

File tree

5 files changed

+4790
-2592
lines changed

5 files changed

+4790
-2592
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,13 @@ Thanks to the following people who have submitted major pull requests:
7979
- [@cvkef](https://github.com/cvkef)
8080

8181
Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles.
82+
<<<<<<< HEAD
83+
=======
84+
85+
Special Thanks
86+
--------------------
87+
- [Middleman](https://github.com/middleman/middleman)
88+
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
89+
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
90+
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
91+
>>>>>>> Update JavaScript dependencies (#1248)

source/javascripts/app/_search.js

+24-20
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,36 @@
88
var highlightOpts = { element: 'span', className: 'search-highlight' };
99
var searchDelay = 0;
1010
var timeoutHandle = 0;
11-
12-
var index = new lunr.Index();
13-
14-
index.ref('id');
15-
index.field('title', { boost: 10 });
16-
index.field('body');
17-
index.pipeline.add(lunr.trimmer, lunr.stopWordFilter);
18-
19-
$(populate);
20-
$(bind);
11+
var index;
2112

2213
function populate() {
23-
$('h1, h2').each(function() {
24-
var title = $(this);
25-
var body = title.nextUntil('h1, h2');
26-
index.add({
27-
id: title.prop('id'),
28-
title: title.text(),
29-
body: body.text()
14+
index = lunr(function(){
15+
16+
this.ref('id');
17+
this.field('title', { boost: 10 });
18+
this.field('body');
19+
this.pipeline.add(lunr.trimmer, lunr.stopWordFilter);
20+
var lunrConfig = this;
21+
22+
$('h1, h2').each(function() {
23+
var title = $(this);
24+
var body = title.nextUntil('h1, h2');
25+
lunrConfig.add({
26+
id: title.prop('id'),
27+
title: title.text(),
28+
body: body.text()
29+
});
3030
});
31-
});
3231

32+
});
3333
determineSearchDelay();
3434
}
35+
36+
$(populate);
37+
$(bind);
38+
3539
function determineSearchDelay() {
36-
if(index.tokenStore.length>5000) {
40+
if (index.tokenSet.toArray().length>5000) {
3741
searchDelay = 300;
3842
}
3943
}
@@ -51,7 +55,7 @@
5155
}();
5256
wait(function(){
5357
search(e);
54-
}, searchDelay );
58+
}, searchDelay);
5559
});
5660
}
5761

source/javascripts/lib/_imagesloaded.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)