2021-01-22 09:08:53 +00:00
|
|
|
import setHighlightClass from 'ee_else_ce/search/highlight_blob_search_result';
|
2021-02-14 18:09:20 +00:00
|
|
|
import { queryToObject } from '~/lib/utils/url_utility';
|
2021-01-22 09:08:53 +00:00
|
|
|
import Project from '~/pages/projects/project';
|
2021-02-12 09:08:48 +00:00
|
|
|
import refreshCounts from '~/pages/search/show/refresh_counts';
|
2020-11-06 06:08:51 +00:00
|
|
|
import { initSidebar } from './sidebar';
|
2021-02-02 18:09:42 +00:00
|
|
|
import { initSearchSort } from './sort';
|
2021-02-14 18:09:20 +00:00
|
|
|
import createStore from './store';
|
|
|
|
import { initTopbar } from './topbar';
|
2020-10-08 18:08:32 +00:00
|
|
|
|
2020-11-17 00:09:16 +00:00
|
|
|
export const initSearchApp = () => {
|
2021-06-11 15:09:58 +00:00
|
|
|
const query = queryToObject(window.location.search);
|
2021-01-22 09:08:53 +00:00
|
|
|
|
|
|
|
const store = createStore({ query });
|
2020-11-11 00:08:58 +00:00
|
|
|
|
2020-12-03 21:09:35 +00:00
|
|
|
initTopbar(store);
|
2020-11-17 00:09:16 +00:00
|
|
|
initSidebar(store);
|
2021-02-02 18:09:42 +00:00
|
|
|
initSearchSort(store);
|
2021-01-22 09:08:53 +00:00
|
|
|
|
|
|
|
setHighlightClass(query.search); // Code Highlighting
|
2021-02-12 09:08:48 +00:00
|
|
|
refreshCounts(); // Other Scope Tab Counts
|
2021-01-22 09:08:53 +00:00
|
|
|
Project.initRefSwitcher(); // Code Search Branch Picker
|
2020-10-08 18:08:32 +00:00
|
|
|
};
|