2020-09-09 21:08:33 +00:00
|
|
|
import $ from 'jquery';
|
2017-03-27 01:37:25 +00:00
|
|
|
import './autosize';
|
|
|
|
import './bind_in_out';
|
2018-03-20 04:01:17 +00:00
|
|
|
import './markdown/render_gfm';
|
|
|
|
import initCopyAsGFM from './markdown/copy_as_gfm';
|
2017-11-28 21:34:51 +00:00
|
|
|
import initCopyToClipboard from './copy_to_clipboard';
|
2017-06-27 05:54:34 +00:00
|
|
|
import installGlEmojiElement from './gl_emoji';
|
2017-03-27 01:37:25 +00:00
|
|
|
import './quick_submit';
|
|
|
|
import './requires_input';
|
2018-09-13 22:14:39 +00:00
|
|
|
import initPageShortcuts from './shortcuts';
|
2017-03-27 01:37:25 +00:00
|
|
|
import './toggler_behavior';
|
2018-09-13 21:57:38 +00:00
|
|
|
import './preview_markdown';
|
2020-06-19 00:09:12 +00:00
|
|
|
import initCollapseSidebarOnWindowResize from './collapse_sidebar_on_window_resize';
|
|
|
|
import initSelect2Dropdowns from './select2';
|
2020-09-25 21:09:51 +00:00
|
|
|
import { loadStartupCSS } from './load_startup_css';
|
|
|
|
|
|
|
|
loadStartupCSS();
|
2017-03-27 01:37:25 +00:00
|
|
|
|
|
|
|
installGlEmojiElement();
|
2020-09-09 21:08:33 +00:00
|
|
|
|
2017-10-12 21:31:47 +00:00
|
|
|
initCopyAsGFM();
|
2017-11-28 21:34:51 +00:00
|
|
|
initCopyToClipboard();
|
2020-09-09 21:08:33 +00:00
|
|
|
|
2018-09-13 22:14:39 +00:00
|
|
|
initPageShortcuts();
|
2020-06-19 00:09:12 +00:00
|
|
|
initCollapseSidebarOnWindowResize();
|
|
|
|
initSelect2Dropdowns();
|
2020-09-09 21:08:33 +00:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
window.requestIdleCallback(
|
|
|
|
() => {
|
|
|
|
// Check if we have to Load GFM Input
|
|
|
|
const $gfmInputs = $('.js-gfm-input:not(.js-gfm-input-initialized)');
|
|
|
|
if ($gfmInputs.length) {
|
|
|
|
import(/* webpackChunkName: 'initGFMInput' */ './markdown/gfm_auto_complete')
|
|
|
|
.then(({ default: initGFMInput }) => {
|
|
|
|
initGFMInput($gfmInputs);
|
|
|
|
})
|
|
|
|
.catch(() => {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ timeout: 500 },
|
|
|
|
);
|
|
|
|
});
|