Welcome to mirror list, hosted at ThFree Co, Russian Federation.

404.js « javascripts « assets « content - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 756d466d7fd817f38476941335a61b9c61c3aaa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
document.addEventListener('DOMContentLoaded', function() {
  var el = document.getElementById('search-input');
  var path = window.location.pathname
    .replace(/^\/((\d+)\.(\d+)?)(\/?(ee|ce)?)\//, '')
    .split(/[-/_]/)
    .join(' ')
    .trim()
    .replace(/\.[a-zA-Z]+$/, '');

  el.value = path;
  el.focus();
  el.dispatchEvent(new Event('input'));
});