debian-mirror-gitlab/app/assets/javascripts/pages/projects/show/index.js

58 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-03-27 19:54:05 +05:30
import $ from 'jquery';
import initBlob from '~/blob_edit/blob_bundle';
2018-12-05 23:21:45 +05:30
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
2018-03-17 18:26:18 +05:30
import NotificationsForm from '~/notifications_form';
import UserCallout from '~/user_callout';
import TreeView from '~/tree';
import BlobViewer from '~/blob/viewer/index';
import Activities from '~/activities';
import { ajaxGet } from '~/lib/utils/common_utils';
2018-11-18 11:00:15 +05:30
import GpgBadges from '~/gpg_badges';
2018-11-20 20:47:30 +05:30
import initReadMore from '~/read_more';
2019-07-31 22:56:46 +05:30
import leaveByUrl from '~/namespaces/leave_by_url';
2018-03-17 18:26:18 +05:30
import Star from '../../../star';
import notificationsDropdown from '../../../notifications_dropdown';
document.addEventListener('DOMContentLoaded', () => {
2018-11-20 20:47:30 +05:30
initReadMore();
2018-03-17 18:26:18 +05:30
new Star(); // eslint-disable-line no-new
notificationsDropdown();
new ShortcutsNavigation(); // eslint-disable-line no-new
new NotificationsForm(); // eslint-disable-line no-new
2018-11-20 20:47:30 +05:30
// eslint-disable-next-line no-new
new UserCallout({
2018-11-18 11:00:15 +05:30
setCalloutPerProject: false,
2018-03-17 18:26:18 +05:30
className: 'js-autodevops-banner',
});
2018-03-27 19:54:05 +05:30
// Project show page loads different overview content based on user preferences
const treeSlider = document.querySelector('#tree-slider');
if (treeSlider) {
new TreeView(); // eslint-disable-line no-new
initBlob();
}
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
}
$(treeSlider).waitForImages(() => {
2018-03-17 18:26:18 +05:30
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);
});
2018-11-18 11:00:15 +05:30
GpgBadges.fetch();
2019-07-31 22:56:46 +05:30
leaveByUrl('project');
2019-09-04 21:01:54 +05:30
if (document.getElementById('js-tree-list')) {
2019-12-26 22:10:19 +05:30
import('ee_else_ce/repository')
2019-09-04 21:01:54 +05:30
.then(m => m.default())
.catch(e => {
throw e;
});
}
2018-03-17 18:26:18 +05:30
});