Welcome to mirror list, hosted at ThFree Co, Russian Federation.

show.js « wikis « shared « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9bc399d07b3682b466a1a1935537a175c2b465a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import Vue from 'vue';
import Wikis from './wikis';
import WikiContent from './components/wiki_content.vue';
import WikiExport from './components/wiki_export.vue';

const mountWikiContentApp = () => {
  const el = document.querySelector('.js-async-wiki-page-content');

  if (el) {
    const { getWikiContentUrl } = el.dataset;

    // eslint-disable-next-line no-new
    new Vue({
      el,
      render(createElement) {
        return createElement(WikiContent, {
          props: { getWikiContentUrl },
        });
      },
    });
  }
};

const mountWikiExportApp = () => {
  const el = document.querySelector('#js-export-actions');

  if (!el) return false;
  const { target, title, stylesheet } = JSON.parse(el.dataset.options);

  return new Vue({
    el,
    provide: {
      target,
      title,
      stylesheet,
    },
    render(createElement) {
      return createElement(WikiExport);
    },
  });
};

export const mountApplications = () => {
  // eslint-disable-next-line no-new
  new Wikis();
  mountWikiContentApp();
  mountWikiExportApp();
};