2020-03-13 15:44:24 +05:30
|
|
|
<script>
|
2020-04-22 19:07:51 +05:30
|
|
|
import { GlFormInputGroup, GlDeprecatedButton, GlIcon } from '@gitlab/ui';
|
2020-03-13 15:44:24 +05:30
|
|
|
import { __ } from '~/locale';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
GlFormInputGroup,
|
2020-04-22 19:07:51 +05:30
|
|
|
GlDeprecatedButton,
|
2020-03-13 15:44:24 +05:30
|
|
|
GlIcon,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
url: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
optionValues: [
|
|
|
|
// eslint-disable-next-line no-useless-escape
|
|
|
|
{ name: __('Embed'), value: `<script src='${this.url}.js'><\/script>` },
|
|
|
|
{ name: __('Share'), value: this.url },
|
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<gl-form-input-group
|
|
|
|
id="embeddable-text"
|
|
|
|
:predefined-options="optionValues"
|
|
|
|
readonly
|
|
|
|
select-on-click
|
|
|
|
>
|
|
|
|
<template #append>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-deprecated-button new-style data-clipboard-target="#embeddable-text">
|
2020-03-13 15:44:24 +05:30
|
|
|
<gl-icon name="copy-to-clipboard" :title="__('Copy')" />
|
2020-04-22 19:07:51 +05:30
|
|
|
</gl-deprecated-button>
|
2020-03-13 15:44:24 +05:30
|
|
|
</template>
|
|
|
|
</gl-form-input-group>
|
|
|
|
</template>
|