2015-04-24 00:18:35 +03:00
|
|
|
function getSearchTerm()
|
|
|
|
{
|
|
|
|
var sPageURL = window.location.search.substring(1);
|
|
|
|
var sURLVariables = sPageURL.split('&');
|
|
|
|
for (var i = 0; i < sURLVariables.length; i++)
|
|
|
|
{
|
|
|
|
var sParameterName = sURLVariables[i].split('=');
|
|
|
|
if (sParameterName[0] == 'q')
|
|
|
|
{
|
|
|
|
return sParameterName[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
|
|
var initialise_search = function(){
|
|
|
|
require.config({"baseUrl":"/mkdocs/js"});
|
|
|
|
require(["search",]);
|
|
|
|
}
|
|
|
|
|
|
|
|
var search_term = getSearchTerm();
|
|
|
|
if(search_term){
|
|
|
|
$('#mkdocs_search_modal').modal();
|
|
|
|
}
|
2014-12-10 14:33:30 +03:00
|
|
|
|
|
|
|
$('pre code').parent().addClass('prettyprint well');
|
|
|
|
|
2015-04-24 00:18:35 +03:00
|
|
|
$(document).on("submit", "#mkdocs_search_modal form", function (e) {
|
2015-05-31 20:29:11 +03:00
|
|
|
$("#mkdocs-search-results").html("Searching...");
|
2015-04-24 00:18:35 +03:00
|
|
|
initialise_search();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2014-12-10 14:33:30 +03:00
|
|
|
});
|