2018-05-09 12:01:36 +05:30
|
|
|
import $ from 'jquery';
|
2018-11-08 19:23:39 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import Translate from '~/vue_shared/translate';
|
|
|
|
import csrf from '~/lib/utils/csrf';
|
2018-03-17 18:26:18 +05:30
|
|
|
import Wikis from './wikis';
|
|
|
|
import ShortcutsWiki from '../../../shortcuts_wiki';
|
|
|
|
import ZenMode from '../../../zen_mode';
|
|
|
|
import GLForm from '../../../gl_form';
|
2018-11-08 19:23:39 +05:30
|
|
|
import deleteWikiModal from './components/delete_wiki_modal.vue';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2018-03-17 18:26:18 +05:30
|
|
|
new Wikis(); // eslint-disable-line no-new
|
|
|
|
new ShortcutsWiki(); // eslint-disable-line no-new
|
|
|
|
new ZenMode(); // eslint-disable-line no-new
|
2018-11-08 19:23:39 +05:30
|
|
|
new GLForm($('.wiki-form')); // eslint-disable-line no-new
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
const deleteWikiModalWrapperEl = document.getElementById('delete-wiki-modal-wrapper');
|
2018-11-08 19:23:39 +05:30
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
if (deleteWikiModalWrapperEl) {
|
2018-11-08 19:23:39 +05:30
|
|
|
Vue.use(Translate);
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
const { deleteWikiUrl, pageTitle } = deleteWikiModalWrapperEl.dataset;
|
|
|
|
|
|
|
|
new Vue({ // eslint-disable-line no-new
|
|
|
|
el: deleteWikiModalWrapperEl,
|
2018-11-08 19:23:39 +05:30
|
|
|
data: {
|
|
|
|
deleteWikiUrl: '',
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(deleteWikiModal, {
|
|
|
|
props: {
|
|
|
|
pageTitle,
|
|
|
|
deleteWikiUrl,
|
|
|
|
csrfToken: csrf.token,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2018-03-27 19:54:05 +05:30
|
|
|
});
|