2018-03-27 19:54:05 +05:30
|
|
|
import $ from 'jquery';
|
|
|
|
import initBlob from '~/blob_edit/blob_bundle';
|
2018-03-17 18:26:18 +05:30
|
|
|
import ShortcutsNavigation from '~/shortcuts_navigation';
|
|
|
|
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';
|
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();
|
2018-03-17 18:26:18 +05:30
|
|
|
});
|