mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
search: remove jQuery #452
This commit is contained in:
parent
f322e58ddd
commit
7c6a48f6c6
1 changed files with 14 additions and 8 deletions
|
@ -80,14 +80,20 @@ function initLunrJson() {
|
||||||
// backward compatiblity if the user did not
|
// backward compatiblity if the user did not
|
||||||
// define the SEARCH output format for the homepage
|
// define the SEARCH output format for the homepage
|
||||||
if( window.index_json_url && !window.index_js_url ){
|
if( window.index_json_url && !window.index_js_url ){
|
||||||
$.getJSON(index_json_url)
|
xhr = new XMLHttpRequest;
|
||||||
.done(function(index) {
|
xhr.onreadystatechange = function(){
|
||||||
initLunrIndex(index);
|
if( xhr.readyState == 4 ){
|
||||||
})
|
if( xhr.status == 200 ){
|
||||||
.fail(function(jqxhr, textStatus, error) {
|
initLunrIndex( JSON.parse( xhr.responseText ) );
|
||||||
var err = textStatus + ', ' + error;
|
}
|
||||||
console.error('Error getting Hugo index file:', err);
|
else{
|
||||||
});
|
var err = xhr.status;
|
||||||
|
console.error( 'Error getting Hugo index file: ', err );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.open( 'GET', index_json_url );
|
||||||
|
xhr.send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue