2020-06-23 00:09:42 +05:30
|
|
|
import $ from 'jquery';
|
|
|
|
import Vue from 'vue';
|
|
|
|
import ShortcutsWiki from '~/behaviors/shortcuts/shortcuts_wiki';
|
2021-03-11 19:13:27 +05:30
|
|
|
import csrf from '~/lib/utils/csrf';
|
|
|
|
import Translate from '~/vue_shared/translate';
|
2020-06-23 00:09:42 +05:30
|
|
|
import GLForm from '../../../gl_form';
|
2021-03-11 19:13:27 +05:30
|
|
|
import ZenMode from '../../../zen_mode';
|
2020-06-23 00:09:42 +05:30
|
|
|
import deleteWikiModal from './components/delete_wiki_modal.vue';
|
2021-03-11 19:13:27 +05:30
|
|
|
import Wikis from './wikis';
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
export default () => {
|
|
|
|
new Wikis(); // eslint-disable-line no-new
|
|
|
|
new ShortcutsWiki(); // eslint-disable-line no-new
|
|
|
|
new ZenMode(); // eslint-disable-line no-new
|
|
|
|
new GLForm($('.wiki-form')); // eslint-disable-line no-new
|
|
|
|
|
|
|
|
const deleteWikiModalWrapperEl = document.getElementById('delete-wiki-modal-wrapper');
|
|
|
|
|
|
|
|
if (deleteWikiModalWrapperEl) {
|
|
|
|
Vue.use(Translate);
|
|
|
|
|
|
|
|
const { deleteWikiUrl, pageTitle } = deleteWikiModalWrapperEl.dataset;
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el: deleteWikiModalWrapperEl,
|
|
|
|
data: {
|
|
|
|
deleteWikiUrl: '',
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(deleteWikiModal, {
|
|
|
|
props: {
|
|
|
|
pageTitle,
|
|
|
|
deleteWikiUrl,
|
|
|
|
csrfToken: csrf.token,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|