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

index.js « show « projects « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c65cc3e4c571079768218b78d381797b541fa334 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import initBlob from '~/blob_edit/blob_bundle';
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import NotificationsForm from '~/notifications_form';
import UserCallout from '~/user_callout';
import BlobViewer from '~/blob/viewer/index';
import Activities from '~/activities';
import initReadMore from '~/read_more';
import leaveByUrl from '~/namespaces/leave_by_url';
import Star from '../../../star';
import notificationsDropdown from '../../../notifications_dropdown';
import { showLearnGitLabProjectPopover } from '~/onboarding_issues';
import initTree from 'ee_else_ce/repository';

document.addEventListener('DOMContentLoaded', () => {
  initReadMore();
  new Star(); // eslint-disable-line no-new
  notificationsDropdown();
  new ShortcutsNavigation(); // eslint-disable-line no-new
  new NotificationsForm(); // eslint-disable-line no-new
  // eslint-disable-next-line no-new
  new UserCallout({
    setCalloutPerProject: false,
    className: 'js-autodevops-banner',
  });

  // Project show page loads different overview content based on user preferences
  const treeSlider = document.getElementById('js-tree-list');
  if (treeSlider) {
    initBlob();
    initTree();
  }

  if (document.querySelector('.blob-viewer')) {
    new BlobViewer(); // eslint-disable-line no-new
  }

  if (document.querySelector('.project-show-activity')) {
    new Activities(); // eslint-disable-line no-new
  }

  leaveByUrl('project');

  showLearnGitLabProjectPopover();
});