  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() {
  
 
</s> remove }
 </s> add   }
}; </s> remove $(function() {

    var initialise_search = function(){
        require.config({"baseUrl":"/mkdocs/js"});
        require(["search",]);
    }
 </s> add var initilizeSearch = function() {
  require.config({ baseUrl: '/mkdocs/js' });
  require(['search']);
}; </s> remove     var search_term = getSearchTerm();
    if(search_term){
        $('#mkdocs_search_modal').modal();
    }
 </s> add $(function() {
  var searchTerm = getSearchTerm(),
    $searchModal = $('#mkdocs_search_modal'),
    $searchQuery = $searchModal.find('#mkdocs-search-query'),
    $searchResults = $searchModal.find('#mkdocs-search-results'); </s> remove     $(document).on("submit", "#mkdocs_search_modal form", function (e) {
        $("#mkdocs-search-results").html("Searching...");
        initialise_search();
        return false;
    });
 </s> add   if (searchTerm) {
    $searchQuery.val(searchTerm);
    $searchResults.text('Searching...');
    $searchModal.modal();
  } </s> remove     $('pre code').parent().addClass('prettyprint well');
 </s> add   $('pre code').parent().addClass('prettyprint well');
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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];
var getSearchTerm = function() {
  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() {
  
replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Fix weird search behavior. Closes #3197 
docs_theme/js/theme.js