2018-02-18 03:18:37 +00:00
|
|
|
<template lang='pug'>
|
2018-12-09 05:46:06 +00:00
|
|
|
v-dialog(
|
2018-07-15 23:16:19 +00:00
|
|
|
v-model='isShown'
|
2018-12-09 05:46:06 +00:00
|
|
|
persistent
|
2019-09-01 02:10:58 +00:00
|
|
|
width='1000'
|
2019-05-18 06:27:30 +00:00
|
|
|
:fullscreen='$vuetify.breakpoint.smAndDown'
|
2018-07-15 23:16:19 +00:00
|
|
|
)
|
|
|
|
.dialog-header
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon(color='white') mdi-tag-text-outline
|
2019-08-04 02:51:29 +00:00
|
|
|
.subtitle-1.white--text.ml-3 {{$t('editor:props.pageProperties')}}
|
2018-02-18 03:18:37 +00:00
|
|
|
v-spacer
|
2018-07-23 01:13:01 +00:00
|
|
|
v-btn.mx-0(
|
2019-08-03 04:48:55 +00:00
|
|
|
outlined
|
2018-07-15 23:16:19 +00:00
|
|
|
dark
|
|
|
|
@click.native='close'
|
|
|
|
)
|
2019-08-03 04:48:55 +00:00
|
|
|
v-icon(left) mdi-check
|
2018-07-23 01:13:01 +00:00
|
|
|
span {{ $t('common:actions.ok') }}
|
2019-08-25 18:23:56 +00:00
|
|
|
v-card(tile)
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tabs(color='white', background-color='blue darken-1', dark, centered, v-model='currentTab')
|
2019-09-01 02:10:58 +00:00
|
|
|
v-tab {{$t('editor:props.info')}}
|
|
|
|
v-tab {{$t('editor:props.scheduling')}}
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab(:disabled='!hasScriptPermission') {{$t('editor:props.scripts')}}
|
2020-06-21 05:04:36 +00:00
|
|
|
v-tab(disabled) {{$t('editor:props.social')}}
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab(:disabled='!hasStylePermission') {{$t('editor:props.styles')}}
|
|
|
|
v-tab-item(transition='fade-transition', reverse-transition='fade-transition')
|
2019-09-01 02:10:58 +00:00
|
|
|
v-card-text.pt-5
|
|
|
|
.overline.pb-5 {{$t('editor:props.pageInfo')}}
|
|
|
|
v-text-field(
|
|
|
|
ref='iptTitle'
|
|
|
|
outlined
|
|
|
|
:label='$t(`editor:props.title`)'
|
|
|
|
counter='255'
|
|
|
|
v-model='title'
|
2018-07-22 04:29:39 +00:00
|
|
|
)
|
2019-09-01 02:10:58 +00:00
|
|
|
v-text-field(
|
|
|
|
outlined
|
|
|
|
:label='$t(`editor:props.shortDescription`)'
|
|
|
|
counter='255'
|
|
|
|
v-model='description'
|
|
|
|
persistent-hint
|
|
|
|
:hint='$t(`editor:props.shortDescriptionHint`)'
|
|
|
|
)
|
|
|
|
v-divider
|
2020-05-08 22:48:07 +00:00
|
|
|
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d3` : `lighten-5`')
|
2019-09-01 02:10:58 +00:00
|
|
|
.overline.pb-5 {{$t('editor:props.path')}}
|
|
|
|
v-container.pa-0(fluid, grid-list-lg)
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex(xs12, md2)
|
|
|
|
v-select(
|
2019-08-04 02:51:29 +00:00
|
|
|
outlined
|
2019-09-01 02:10:58 +00:00
|
|
|
:label='$t(`editor:props.locale`)'
|
|
|
|
suffix='/'
|
|
|
|
:items='namespaces'
|
|
|
|
v-model='locale'
|
|
|
|
hide-details
|
2018-07-16 02:40:41 +00:00
|
|
|
)
|
2019-09-01 02:10:58 +00:00
|
|
|
v-flex(xs12, md10)
|
2019-08-04 02:51:29 +00:00
|
|
|
v-text-field(
|
|
|
|
outlined
|
2019-09-01 02:10:58 +00:00
|
|
|
:label='$t(`editor:props.path`)'
|
|
|
|
append-icon='mdi-folder-search'
|
|
|
|
v-model='path'
|
|
|
|
:hint='$t(`editor:props.pathHint`)'
|
2019-08-04 02:51:29 +00:00
|
|
|
persistent-hint
|
2019-09-01 02:10:58 +00:00
|
|
|
@click:append='showPathSelector'
|
2021-10-10 18:56:20 +00:00
|
|
|
:rules='[rules.required, rules.path]'
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-divider
|
2020-05-08 22:48:07 +00:00
|
|
|
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d5` : `lighten-4`')
|
2019-09-01 02:10:58 +00:00
|
|
|
.overline.pb-5 {{$t('editor:props.categorization')}}
|
2020-02-02 21:24:27 +00:00
|
|
|
v-chip-group.radius-5.mb-5(column, v-if='tags && tags.length > 0')
|
|
|
|
v-chip(
|
|
|
|
v-for='tag of tags'
|
|
|
|
:key='`tag-` + tag'
|
|
|
|
close
|
|
|
|
label
|
|
|
|
color='teal'
|
|
|
|
text-color='teal lighten-5'
|
|
|
|
@click:close='removeTag(tag)'
|
|
|
|
) {{tag}}
|
2019-09-01 02:10:58 +00:00
|
|
|
v-combobox(
|
|
|
|
:label='$t(`editor:props.tags`)'
|
|
|
|
outlined
|
2020-04-10 01:56:24 +00:00
|
|
|
v-model='newTag'
|
2019-09-01 02:10:58 +00:00
|
|
|
:hint='$t(`editor:props.tagsHint`)'
|
2020-02-02 21:24:27 +00:00
|
|
|
:items='newTagSuggestions'
|
|
|
|
:loading='$apollo.queries.newTagSuggestions.loading'
|
2019-09-01 02:10:58 +00:00
|
|
|
persistent-hint
|
2020-02-02 21:24:27 +00:00
|
|
|
hide-no-data
|
|
|
|
:search-input.sync='newTagSearch'
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab-item(transition='fade-transition', reverse-transition='fade-transition')
|
2019-09-01 02:10:58 +00:00
|
|
|
v-card-text
|
2020-06-20 01:00:44 +00:00
|
|
|
.overline {{$t('editor:props.publishState')}}
|
2019-09-01 02:10:58 +00:00
|
|
|
v-switch(
|
|
|
|
:label='$t(`editor:props.publishToggle`)'
|
|
|
|
v-model='isPublished'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`editor:props.publishToggleHint`)'
|
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-divider
|
2020-05-08 22:48:07 +00:00
|
|
|
v-card-text.grey.pt-5(:class='$vuetify.theme.dark ? `darken-3-d3` : `lighten-5`')
|
2019-09-01 02:10:58 +00:00
|
|
|
v-container.pa-0(fluid, grid-list-lg)
|
|
|
|
v-row
|
|
|
|
v-col(cols='6')
|
|
|
|
v-dialog(
|
|
|
|
ref='menuPublishStart'
|
|
|
|
:close-on-content-click='false'
|
|
|
|
v-model='isPublishStartShown'
|
|
|
|
:return-value.sync='publishStartDate'
|
|
|
|
width='460px'
|
2020-06-20 01:00:44 +00:00
|
|
|
:disabled='!isPublished'
|
2019-08-04 02:51:29 +00:00
|
|
|
)
|
2019-09-01 02:10:58 +00:00
|
|
|
template(v-slot:activator='{ on }')
|
|
|
|
v-text-field(
|
|
|
|
v-on='on'
|
|
|
|
:label='$t(`editor:props.publishStart`)'
|
|
|
|
v-model='publishStartDate'
|
|
|
|
prepend-icon='mdi-calendar-check'
|
|
|
|
readonly
|
|
|
|
outlined
|
|
|
|
clearable
|
|
|
|
:hint='$t(`editor:props.publishStartHint`)'
|
|
|
|
persistent-hint
|
2020-06-20 01:00:44 +00:00
|
|
|
:disabled='!isPublished'
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-date-picker(
|
|
|
|
v-model='publishStartDate'
|
|
|
|
:min='(new Date()).toISOString().substring(0, 10)'
|
|
|
|
color='primary'
|
|
|
|
reactive
|
|
|
|
scrollable
|
|
|
|
landscape
|
|
|
|
)
|
|
|
|
v-spacer
|
|
|
|
v-btn(
|
2020-06-21 02:08:59 +00:00
|
|
|
text
|
2019-09-01 02:10:58 +00:00
|
|
|
color='primary'
|
|
|
|
@click='isPublishStartShown = false'
|
|
|
|
) {{$t('common:actions.cancel')}}
|
|
|
|
v-btn(
|
2020-06-21 02:08:59 +00:00
|
|
|
text
|
2019-09-01 02:10:58 +00:00
|
|
|
color='primary'
|
|
|
|
@click='$refs.menuPublishStart.save(publishStartDate)'
|
|
|
|
) {{$t('common:actions.ok')}}
|
|
|
|
v-col(cols='6')
|
|
|
|
v-dialog(
|
|
|
|
ref='menuPublishEnd'
|
|
|
|
:close-on-content-click='false'
|
|
|
|
v-model='isPublishEndShown'
|
|
|
|
:return-value.sync='publishEndDate'
|
|
|
|
width='460px'
|
2020-06-20 01:00:44 +00:00
|
|
|
:disabled='!isPublished'
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
template(v-slot:activator='{ on }')
|
|
|
|
v-text-field(
|
|
|
|
v-on='on'
|
|
|
|
:label='$t(`editor:props.publishEnd`)'
|
|
|
|
v-model='publishEndDate'
|
|
|
|
prepend-icon='mdi-calendar-remove'
|
|
|
|
readonly
|
|
|
|
outlined
|
|
|
|
clearable
|
|
|
|
:hint='$t(`editor:props.publishEndHint`)'
|
|
|
|
persistent-hint
|
2020-06-20 01:00:44 +00:00
|
|
|
:disabled='!isPublished'
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-date-picker(
|
|
|
|
v-model='publishEndDate'
|
|
|
|
:min='(new Date()).toISOString().substring(0, 10)'
|
|
|
|
color='primary'
|
|
|
|
reactive
|
|
|
|
scrollable
|
|
|
|
landscape
|
|
|
|
)
|
|
|
|
v-spacer
|
|
|
|
v-btn(
|
2020-06-21 02:08:59 +00:00
|
|
|
text
|
2019-09-01 02:10:58 +00:00
|
|
|
color='primary'
|
|
|
|
@click='isPublishEndShown = false'
|
|
|
|
) {{$t('common:actions.cancel')}}
|
|
|
|
v-btn(
|
2020-06-21 02:08:59 +00:00
|
|
|
text
|
2019-09-01 02:10:58 +00:00
|
|
|
color='primary'
|
|
|
|
@click='$refs.menuPublishEnd.save(publishEndDate)'
|
|
|
|
) {{$t('common:actions.ok')}}
|
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab-item(:transition='false', :reverse-transition='false')
|
2020-06-20 05:11:05 +00:00
|
|
|
.editor-props-codeeditor-title
|
2020-06-20 20:39:36 +00:00
|
|
|
.overline {{$t('editor:props.html')}}
|
2020-06-20 01:00:44 +00:00
|
|
|
.editor-props-codeeditor
|
|
|
|
textarea(ref='codejs')
|
|
|
|
.editor-props-codeeditor-hint
|
2020-06-20 20:39:36 +00:00
|
|
|
.caption {{$t('editor:props.htmlHint')}}
|
2020-01-05 20:04:16 +00:00
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab-item(transition='fade-transition', reverse-transition='fade-transition')
|
2019-09-01 02:10:58 +00:00
|
|
|
v-card-text
|
2020-06-20 01:00:44 +00:00
|
|
|
.overline {{$t('editor:props.socialFeatures')}}
|
2019-09-01 02:10:58 +00:00
|
|
|
v-switch(
|
|
|
|
:label='$t(`editor:props.allowComments`)'
|
|
|
|
v-model='isPublished'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`editor:props.allowCommentsHint`)'
|
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-switch(
|
|
|
|
:label='$t(`editor:props.allowRatings`)'
|
|
|
|
v-model='isPublished'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`editor:props.allowRatingsHint`)'
|
|
|
|
persistent-hint
|
|
|
|
disabled
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-switch(
|
|
|
|
:label='$t(`editor:props.displayAuthor`)'
|
|
|
|
v-model='isPublished'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`editor:props.displayAuthorHint`)'
|
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
|
|
|
v-switch(
|
|
|
|
:label='$t(`editor:props.displaySharingBar`)'
|
|
|
|
v-model='isPublished'
|
|
|
|
color='primary'
|
|
|
|
:hint='$t(`editor:props.displaySharingBarHint`)'
|
|
|
|
persistent-hint
|
2019-09-01 22:33:36 +00:00
|
|
|
inset
|
2019-09-01 02:10:58 +00:00
|
|
|
)
|
2018-07-16 02:40:41 +00:00
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
v-tab-item(:transition='false', :reverse-transition='false')
|
2020-06-20 05:11:05 +00:00
|
|
|
.editor-props-codeeditor-title
|
|
|
|
.overline {{$t('editor:props.css')}}
|
2020-06-20 01:00:44 +00:00
|
|
|
.editor-props-codeeditor
|
|
|
|
textarea(ref='codecss')
|
|
|
|
.editor-props-codeeditor-hint
|
|
|
|
.caption {{$t('editor:props.cssHint')}}
|
|
|
|
|
2019-10-13 23:59:50 +00:00
|
|
|
page-selector(:mode='pageSelectorMode', v-model='pageSelectorShown', :path='path', :locale='locale', :open-handler='setPath')
|
2018-02-18 03:18:37 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-07-16 02:40:41 +00:00
|
|
|
import _ from 'lodash'
|
2018-07-30 02:23:33 +00:00
|
|
|
import { sync, get } from 'vuex-pathify'
|
2020-02-02 21:24:27 +00:00
|
|
|
import gql from 'graphql-tag'
|
2018-07-15 23:16:19 +00:00
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
import CodeMirror from 'codemirror'
|
|
|
|
import 'codemirror/lib/codemirror.css'
|
2020-06-20 20:39:36 +00:00
|
|
|
import 'codemirror/mode/htmlmixed/htmlmixed.js'
|
2020-06-20 01:00:44 +00:00
|
|
|
import 'codemirror/mode/css/css.js'
|
|
|
|
|
2019-06-22 03:39:04 +00:00
|
|
|
/* global siteLangs, siteConfig */
|
2021-10-10 18:56:20 +00:00
|
|
|
const filenamePattern = /^(?![\#\/\.\$\^\=\*\;\:\&\?\(\)\[\]\{\}\"\'\>\<\,\@\!\%\`\~\s])(?!.*[\#\/\.\$\^\=\*\;\:\&\?\(\)\[\]\{\}\"\'\>\<\,\@\!\%\`\~\s]$)[^\#\.\$\^\=\*\;\:\&\?\(\)\[\]\{\}\"\'\>\<\,\@\!\%\`\~\s]*$/
|
2019-06-22 03:39:04 +00:00
|
|
|
|
2018-02-18 03:18:37 +00:00
|
|
|
export default {
|
2018-12-09 05:46:06 +00:00
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
|
|
|
},
|
2020-06-20 01:00:44 +00:00
|
|
|
data () {
|
2018-02-18 03:18:37 +00:00
|
|
|
return {
|
2018-07-15 23:16:19 +00:00
|
|
|
isPublishStartShown: false,
|
2018-07-16 02:40:41 +00:00
|
|
|
isPublishEndShown: false,
|
2018-12-15 22:15:13 +00:00
|
|
|
pageSelectorShown: false,
|
2020-02-02 21:24:27 +00:00
|
|
|
namespaces: siteLangs.length ? siteLangs.map(ns => ns.code) : [siteConfig.lang],
|
|
|
|
newTag: '',
|
|
|
|
newTagSuggestions: [],
|
2020-06-20 01:00:44 +00:00
|
|
|
newTagSearch: '',
|
|
|
|
currentTab: 0,
|
2021-10-10 18:56:20 +00:00
|
|
|
cm: null,
|
|
|
|
rules: {
|
|
|
|
required: value => !!value || 'This field is required.',
|
|
|
|
path: value => {
|
|
|
|
return filenamePattern.test(value) || 'Invalid path. Please ensure it does not contain special characters, or begin/end in a slash or hashtag string.'
|
|
|
|
}
|
|
|
|
}
|
2018-02-19 20:41:36 +00:00
|
|
|
}
|
|
|
|
},
|
2018-07-15 23:16:19 +00:00
|
|
|
computed: {
|
2018-12-09 05:46:06 +00:00
|
|
|
isShown: {
|
|
|
|
get() { return this.value },
|
|
|
|
set(val) { this.$emit('input', val) }
|
|
|
|
},
|
2018-07-30 02:23:33 +00:00
|
|
|
mode: get('editor/mode'),
|
2018-11-11 04:40:55 +00:00
|
|
|
title: sync('page/title'),
|
|
|
|
description: sync('page/description'),
|
|
|
|
locale: sync('page/locale'),
|
|
|
|
tags: sync('page/tags'),
|
|
|
|
path: sync('page/path'),
|
|
|
|
isPublished: sync('page/isPublished'),
|
|
|
|
publishStartDate: sync('page/publishStartDate'),
|
2019-10-13 23:59:50 +00:00
|
|
|
publishEndDate: sync('page/publishEndDate'),
|
2020-06-20 01:00:44 +00:00
|
|
|
scriptJs: sync('page/scriptJs'),
|
|
|
|
scriptCss: sync('page/scriptCss'),
|
|
|
|
hasScriptPermission: get('page/effectivePermissions@pages.script'),
|
|
|
|
hasStylePermission: get('page/effectivePermissions@pages.style'),
|
2019-10-13 23:59:50 +00:00
|
|
|
pageSelectorMode () {
|
|
|
|
return (this.mode === 'create') ? 'create' : 'move'
|
|
|
|
}
|
2018-07-15 23:16:19 +00:00
|
|
|
},
|
2018-12-09 05:46:06 +00:00
|
|
|
watch: {
|
2020-06-20 01:00:44 +00:00
|
|
|
value (newValue, oldValue) {
|
2019-06-01 05:34:16 +00:00
|
|
|
if (newValue) {
|
2018-12-09 05:46:06 +00:00
|
|
|
_.delay(() => {
|
|
|
|
this.$refs.iptTitle.focus()
|
|
|
|
}, 500)
|
|
|
|
}
|
2020-04-10 01:56:24 +00:00
|
|
|
},
|
2020-06-20 01:00:44 +00:00
|
|
|
newTag (newValue, oldValue) {
|
2020-04-10 01:56:24 +00:00
|
|
|
const tagClean = _.trim(newValue || '').toLowerCase()
|
|
|
|
if (tagClean && tagClean.length > 0) {
|
|
|
|
if (!_.includes(this.tags, tagClean)) {
|
|
|
|
this.tags = [...this.tags, tagClean]
|
|
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.newTag = null
|
|
|
|
})
|
|
|
|
}
|
2020-06-20 01:00:44 +00:00
|
|
|
},
|
|
|
|
currentTab (newValue, oldValue) {
|
|
|
|
if (this.cm) {
|
|
|
|
this.cm.toTextArea()
|
|
|
|
}
|
|
|
|
if (newValue === 2) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
setTimeout(() => {
|
2020-06-20 20:39:36 +00:00
|
|
|
this.loadEditor(this.$refs.codejs, 'html')
|
2020-06-20 01:00:44 +00:00
|
|
|
}, 100)
|
|
|
|
})
|
|
|
|
} else if (newValue === 4) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
this.loadEditor(this.$refs.codecss, 'css')
|
|
|
|
}, 100)
|
|
|
|
})
|
|
|
|
}
|
2018-12-09 05:46:06 +00:00
|
|
|
}
|
2018-02-19 20:41:36 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2020-02-02 21:24:27 +00:00
|
|
|
removeTag (tag) {
|
|
|
|
this.tags = _.without(this.tags, tag)
|
|
|
|
},
|
2018-02-19 20:41:36 +00:00
|
|
|
close() {
|
|
|
|
this.isShown = false
|
2018-07-22 04:29:39 +00:00
|
|
|
},
|
|
|
|
showPathSelector() {
|
2018-12-15 22:15:13 +00:00
|
|
|
this.pageSelectorShown = true
|
|
|
|
},
|
|
|
|
setPath({ path, locale }) {
|
|
|
|
this.locale = locale
|
|
|
|
this.path = path
|
2020-06-20 01:00:44 +00:00
|
|
|
},
|
|
|
|
loadEditor(ref, mode) {
|
|
|
|
this.cm = CodeMirror.fromTextArea(ref, {
|
|
|
|
tabSize: 2,
|
|
|
|
mode: `text/${mode}`,
|
|
|
|
theme: 'wikijs-dark',
|
|
|
|
lineNumbers: true,
|
|
|
|
lineWrapping: true,
|
|
|
|
line: true,
|
|
|
|
styleActiveLine: true,
|
|
|
|
viewportMargin: 50,
|
|
|
|
inputStyle: 'contenteditable',
|
|
|
|
direction: 'ltr'
|
|
|
|
})
|
|
|
|
switch (mode) {
|
2020-06-20 20:39:36 +00:00
|
|
|
case 'html':
|
2020-06-20 01:00:44 +00:00
|
|
|
this.cm.setValue(this.scriptJs)
|
|
|
|
this.cm.on('change', c => {
|
|
|
|
this.scriptJs = c.getValue()
|
|
|
|
})
|
|
|
|
break
|
|
|
|
case 'css':
|
|
|
|
this.cm.setValue(this.scriptCss)
|
|
|
|
this.cm.on('change', c => {
|
|
|
|
this.scriptCss = c.getValue()
|
|
|
|
})
|
|
|
|
break
|
|
|
|
default:
|
|
|
|
console.warn('Invalid Editor Mode')
|
|
|
|
break
|
|
|
|
}
|
|
|
|
this.cm.setSize(null, '500px')
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.cm.refresh()
|
|
|
|
this.cm.focus()
|
|
|
|
})
|
2018-02-18 03:18:37 +00:00
|
|
|
}
|
2020-02-02 21:24:27 +00:00
|
|
|
},
|
|
|
|
apollo: {
|
|
|
|
newTagSuggestions: {
|
|
|
|
query: gql`
|
|
|
|
query ($query: String!) {
|
|
|
|
pages {
|
|
|
|
searchTags (query: $query)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
variables () {
|
|
|
|
return {
|
|
|
|
query: this.newTagSearch
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fetchPolicy: 'cache-first',
|
|
|
|
update: (data) => _.get(data, 'pages.searchTags', []),
|
|
|
|
skip () {
|
|
|
|
return !this.value || _.isEmpty(this.newTagSearch)
|
|
|
|
},
|
|
|
|
throttle: 500
|
|
|
|
}
|
2018-02-18 03:18:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang='scss'>
|
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
.editor-props-codeeditor {
|
|
|
|
background-color: mc('grey', '900');
|
|
|
|
min-height: 500px;
|
|
|
|
|
|
|
|
> textarea {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
2020-06-20 05:11:05 +00:00
|
|
|
&-title {
|
|
|
|
background-color: mc('grey', '900');
|
|
|
|
border-bottom: 1px solid lighten(mc('grey', '900'), 10%);
|
|
|
|
color: #FFF;
|
|
|
|
padding: 10px;
|
|
|
|
}
|
|
|
|
|
2020-06-20 01:00:44 +00:00
|
|
|
&-hint {
|
|
|
|
background-color: mc('grey', '900');
|
|
|
|
border-top: 1px solid lighten(mc('grey', '900'), 5%);
|
|
|
|
color: mc('grey', '500');
|
|
|
|
padding: 5px 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-18 03:18:37 +00:00
|
|
|
</style>
|