diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 15:07:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 15:07:52 +0000 |
commit | afe2b984524ae4b0c8a0636db7ec5b2c452f0734 (patch) | |
tree | 3de39f954c7239e09a9afe84263a64e7042b2b60 /app/assets/javascripts/pages | |
parent | 5a6b36b60502c50ab59c0bc3c345793b70a3d548 (diff) | |
download | gitlab-ce-afe2b984524ae4b0c8a0636db7ec5b2c452f0734.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pages')
-rw-r--r-- | app/assets/javascripts/pages/projects/wikis/wikis.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/pages/projects/wikis/wikis.js b/app/assets/javascripts/pages/projects/wikis/wikis.js index 6b02a074abf..93afdc54ce1 100644 --- a/app/assets/javascripts/pages/projects/wikis/wikis.js +++ b/app/assets/javascripts/pages/projects/wikis/wikis.js @@ -1,6 +1,13 @@ import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import { s__, sprintf } from '~/locale'; +const MARKDOWN_LINK_TEXT = { + markdown: '[Link Title](page-slug)', + rdoc: '{Link title}[link:page-slug]', + asciidoc: 'link:page-slug[Link title]', + org: '[[page-slug]]', +}; + export default class Wikis { constructor() { this.sidebarEl = document.querySelector('.js-wiki-sidebar'); @@ -28,6 +35,15 @@ export default class Wikis { window.addEventListener('resize', () => this.renderSidebar()); this.renderSidebar(); + + const changeFormatSelect = document.querySelector('#wiki_format'); + const linkExample = document.querySelector('.js-markup-link-example'); + + if (changeFormatSelect) { + changeFormatSelect.addEventListener('change', e => { + linkExample.innerHTML = MARKDOWN_LINK_TEXT[e.target.value]; + }); + } } handleWikiTitleChange(e) { |