|
@@ -1,6 +1,6 @@
|
|
<template lang="pug">
|
|
<template lang="pug">
|
|
q-card.page-properties-dialog
|
|
q-card.page-properties-dialog
|
|
- .floating-sidepanel-quickaccess.animated.fadeIn(v-if='showQuickAccess', style='right: 486px;')
|
|
|
|
|
|
+ .floating-sidepanel-quickaccess.animated.fadeIn(v-if='state.showQuickAccess', style='right: 486px;')
|
|
template(v-for='(qa, idx) of quickaccess', :key='`qa-` + qa.key')
|
|
template(v-for='(qa, idx) of quickaccess', :key='`qa-` + qa.key')
|
|
q-btn(
|
|
q-btn(
|
|
:icon='qa.icon'
|
|
:icon='qa.icon'
|
|
@@ -12,7 +12,7 @@ q-card.page-properties-dialog
|
|
q-tooltip(anchor='center left' self='center right') {{qa.label}}
|
|
q-tooltip(anchor='center left' self='center right') {{qa.label}}
|
|
q-separator(dark, v-if='idx < quickaccess.length - 1')
|
|
q-separator(dark, v-if='idx < quickaccess.length - 1')
|
|
q-toolbar.bg-primary.text-white.flex
|
|
q-toolbar.bg-primary.text-white.flex
|
|
- .text-subtitle2 {{$t('editor.props.pageProperties')}}
|
|
|
|
|
|
+ .text-subtitle2 {{t('editor.props.pageProperties')}}
|
|
q-space
|
|
q-space
|
|
q-btn(
|
|
q-btn(
|
|
icon='las la-times'
|
|
icon='las la-times'
|
|
@@ -22,61 +22,61 @@ q-card.page-properties-dialog
|
|
)
|
|
)
|
|
q-scroll-area(
|
|
q-scroll-area(
|
|
ref='scrollArea'
|
|
ref='scrollArea'
|
|
- :thumb-style='thumbStyle'
|
|
|
|
- :bar-style='barStyle'
|
|
|
|
|
|
+ :thumb-style='siteStore.thumbStyle'
|
|
|
|
+ :bar-style='siteStore.barStyle'
|
|
style='height: calc(100% - 50px);'
|
|
style='height: calc(100% - 50px);'
|
|
)
|
|
)
|
|
- q-card-section(ref='card-info')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-info-circle', size='xs')] {{$t('editor.props.info')}}
|
|
|
|
|
|
+ q-card-section(id='refCardInfo')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-info-circle', size='xs')] {{t('editor.props.info')}}
|
|
q-form.q-gutter-sm
|
|
q-form.q-gutter-sm
|
|
q-input(
|
|
q-input(
|
|
- v-model='title'
|
|
|
|
- :label='$t(`editor.props.title`)'
|
|
|
|
|
|
+ v-model='pageStore.title'
|
|
|
|
+ :label='t(`editor.props.title`)'
|
|
outlined
|
|
outlined
|
|
dense
|
|
dense
|
|
)
|
|
)
|
|
q-input(
|
|
q-input(
|
|
- v-model='description'
|
|
|
|
- :label='$t(`editor.props.shortDescription`)'
|
|
|
|
|
|
+ v-model='pageStore.description'
|
|
|
|
+ :label='t(`editor.props.shortDescription`)'
|
|
outlined
|
|
outlined
|
|
dense
|
|
dense
|
|
)
|
|
)
|
|
- q-card-section.alt-card(ref='card-publishstate')
|
|
|
|
- .text-overline.q-pb-xs.items-center.flex #[q-icon.q-mr-sm(name='las la-power-off', size='xs')] {{$t('editor.props.publishState')}}
|
|
|
|
|
|
+ q-card-section.alt-card(id='refCardPublishState')
|
|
|
|
+ .text-overline.q-pb-xs.items-center.flex #[q-icon.q-mr-sm(name='las la-power-off', size='xs')] {{t('editor.props.publishState')}}
|
|
q-form.q-gutter-md
|
|
q-form.q-gutter-md
|
|
div
|
|
div
|
|
q-btn-toggle(
|
|
q-btn-toggle(
|
|
- v-model='isPublished'
|
|
|
|
|
|
+ v-model='pageStore.isPublished'
|
|
push
|
|
push
|
|
glossy
|
|
glossy
|
|
no-caps
|
|
no-caps
|
|
toggle-color='primary'
|
|
toggle-color='primary'
|
|
:options=`[
|
|
:options=`[
|
|
- { label: $t('editor.props.draft'), value: false },
|
|
|
|
- { label: $t('editor.props.published'), value: true },
|
|
|
|
- { label: $t('editor.props.dateRange'), value: null }
|
|
|
|
|
|
+ { label: t('editor.props.draft'), value: false },
|
|
|
|
+ { label: t('editor.props.published'), value: true },
|
|
|
|
+ { label: t('editor.props.dateRange'), value: null }
|
|
]`
|
|
]`
|
|
)
|
|
)
|
|
- .text-caption(v-if='isPublished'): em {{$t('editor.props.publishedHint')}}
|
|
|
|
- .text-caption(v-else-if='isPublished === false'): em {{$t('editor.props.draftHint')}}
|
|
|
|
- template(v-else-if='isPublished === null')
|
|
|
|
- .text-caption: em {{$t('editor.props.dateRangeHint')}}
|
|
|
|
|
|
+ .text-caption(v-if='pageStore.isPublished'): em {{t('editor.props.publishedHint')}}
|
|
|
|
+ .text-caption(v-else-if='pageStore.isPublished === false'): em {{t('editor.props.draftHint')}}
|
|
|
|
+ template(v-else-if='pageStore.isPublished === null')
|
|
|
|
+ .text-caption: em {{t('editor.props.dateRangeHint')}}
|
|
q-date(
|
|
q-date(
|
|
- v-model='publishingRange'
|
|
|
|
|
|
+ v-model='pageStore.publishingRange'
|
|
range
|
|
range
|
|
flat
|
|
flat
|
|
bordered
|
|
bordered
|
|
landscape
|
|
landscape
|
|
minimal
|
|
minimal
|
|
)
|
|
)
|
|
- q-card-section(ref='card-relations')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-sun', size='xs')] {{$t('editor.props.relations')}}
|
|
|
|
|
|
+ q-card-section(id='refCardRelations')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-sun', size='xs')] {{t('editor.props.relations')}}
|
|
q-list.rounded-borders.q-mb-sm.bg-white(
|
|
q-list.rounded-borders.q-mb-sm.bg-white(
|
|
- v-if='relations.length > 0'
|
|
|
|
|
|
+ v-if='pageStore.relations.length > 0'
|
|
separator
|
|
separator
|
|
bordered
|
|
bordered
|
|
)
|
|
)
|
|
- q-item(v-for='rel of relations', :key='`rel-id-` + rel.id')
|
|
|
|
|
|
+ q-item(v-for='rel of pageStore.relations', :key='`rel-id-` + rel.id')
|
|
q-item-section(side)
|
|
q-item-section(side)
|
|
q-icon(:name='rel.icon')
|
|
q-icon(:name='rel.icon')
|
|
q-item-section
|
|
q-item-section
|
|
@@ -107,130 +107,130 @@ q-card.page-properties-dialog
|
|
@click='removeRelation(rel)'
|
|
@click='removeRelation(rel)'
|
|
)
|
|
)
|
|
q-btn.full-width(
|
|
q-btn.full-width(
|
|
- :label='$t(`editor.props.relationAdd`)'
|
|
|
|
|
|
+ :label='t(`editor.props.relationAdd`)'
|
|
icon='las la-plus'
|
|
icon='las la-plus'
|
|
no-caps
|
|
no-caps
|
|
unelevated
|
|
unelevated
|
|
color='secondary'
|
|
color='secondary'
|
|
@click='newRelation'
|
|
@click='newRelation'
|
|
)
|
|
)
|
|
- q-tooltip {{$t('editor.props.relationAddHint')}}
|
|
|
|
- q-card-section.alt-card(ref='card-scripts')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-code', size='xs')] {{$t('editor.props.scripts')}}
|
|
|
|
|
|
+ q-tooltip {{t('editor.props.relationAddHint')}}
|
|
|
|
+ q-card-section.alt-card(id='refCardScripts')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-code', size='xs')] {{t('editor.props.scripts')}}
|
|
q-btn.full-width(
|
|
q-btn.full-width(
|
|
- :label='$t(`editor.props.jsLoad`)'
|
|
|
|
|
|
+ :label='t(`editor.props.jsLoad`)'
|
|
icon='lab la-js-square'
|
|
icon='lab la-js-square'
|
|
no-caps
|
|
no-caps
|
|
unelevated
|
|
unelevated
|
|
color='secondary'
|
|
color='secondary'
|
|
@click='editScripts(`jsLoad`)'
|
|
@click='editScripts(`jsLoad`)'
|
|
)
|
|
)
|
|
- q-tooltip {{$t('editor.props.jsLoadHint')}}
|
|
|
|
|
|
+ q-tooltip {{t('editor.props.jsLoadHint')}}
|
|
q-btn.full-width.q-mt-sm(
|
|
q-btn.full-width.q-mt-sm(
|
|
- :label='$t(`editor.props.jsUnload`)'
|
|
|
|
|
|
+ :label='t(`editor.props.jsUnload`)'
|
|
icon='lab la-js-square'
|
|
icon='lab la-js-square'
|
|
no-caps
|
|
no-caps
|
|
unelevated
|
|
unelevated
|
|
color='secondary'
|
|
color='secondary'
|
|
@click='editScripts(`jsUnload`)'
|
|
@click='editScripts(`jsUnload`)'
|
|
)
|
|
)
|
|
- q-tooltip {{$t('editor.props.jsUnloadHint')}}
|
|
|
|
|
|
+ q-tooltip {{t('editor.props.jsUnloadHint')}}
|
|
q-btn.full-width.q-mt-sm(
|
|
q-btn.full-width.q-mt-sm(
|
|
- :label='$t(`editor.props.styles`)'
|
|
|
|
|
|
+ :label='t(`editor.props.styles`)'
|
|
icon='lab la-css3-alt'
|
|
icon='lab la-css3-alt'
|
|
no-caps
|
|
no-caps
|
|
unelevated
|
|
unelevated
|
|
color='secondary'
|
|
color='secondary'
|
|
@click='editScripts(`styles`)'
|
|
@click='editScripts(`styles`)'
|
|
)
|
|
)
|
|
- q-tooltip {{$t('editor.props.stylesHint')}}
|
|
|
|
- q-card-section.q-pb-lg(ref='card-sidebar')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-ruler-vertical', size='xs')] {{$t('editor.props.sidebar')}}
|
|
|
|
|
|
+ q-tooltip {{t('editor.props.stylesHint')}}
|
|
|
|
+ q-card-section.q-pb-lg(id='refCardSidebar')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-ruler-vertical', size='xs')] {{t('editor.props.sidebar')}}
|
|
q-form.q-gutter-md.q-pt-sm
|
|
q-form.q-gutter-md.q-pt-sm
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='showSidebar'
|
|
|
|
|
|
+ v-model='pageStore.showSidebar'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.showSidebar`)'
|
|
|
|
|
|
+ :label='t(`editor.props.showSidebar`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-if='showSidebar'
|
|
|
|
- v-model='showToc'
|
|
|
|
|
|
+ v-if='pageStore.showSidebar'
|
|
|
|
+ v-model='pageStore.showToc'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.showToc`)'
|
|
|
|
|
|
+ :label='t(`editor.props.showToc`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
div(
|
|
div(
|
|
- v-if='showSidebar && showToc'
|
|
|
|
|
|
+ v-if='pageStore.showSidebar && pageStore.showToc'
|
|
style='padding-left: 40px;'
|
|
style='padding-left: 40px;'
|
|
)
|
|
)
|
|
- .text-caption {{$t('editor.props.tocMinMaxDepth')}} #[strong (H{{tocDepth.min}} → H{{tocDepth.max}})]
|
|
|
|
|
|
+ .text-caption {{t('editor.props.tocMinMaxDepth')}} #[strong (H{{pageStore.tocDepth.min}} → H{{pageStore.tocDepth.max}})]
|
|
q-range(
|
|
q-range(
|
|
- v-model='tocDepth'
|
|
|
|
|
|
+ v-model='pageStore.tocDepth'
|
|
:min='1'
|
|
:min='1'
|
|
:max='6'
|
|
:max='6'
|
|
color='primary'
|
|
color='primary'
|
|
- :left-label-value='`H` + tocDepth.min'
|
|
|
|
- :right-label-value='`H` + tocDepth.max'
|
|
|
|
|
|
+ :left-label-value='`H` + pageStore.tocDepth.min'
|
|
|
|
+ :right-label-value='`H` + pageStore.tocDepth.max'
|
|
snap
|
|
snap
|
|
label
|
|
label
|
|
markers
|
|
markers
|
|
)
|
|
)
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-if='showSidebar'
|
|
|
|
- v-model='showTags'
|
|
|
|
|
|
+ v-if='pageStore.showSidebar'
|
|
|
|
+ v-model='pageStore.showTags'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.showTags`)'
|
|
|
|
|
|
+ :label='t(`editor.props.showTags`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
- q-card-section.alt-card.q-pb-lg(ref='card-social')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-comments', size='xs')] {{$t('editor.props.social')}}
|
|
|
|
|
|
+ q-card-section.alt-card.q-pb-lg(id='refCardSocial')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-comments', size='xs')] {{t('editor.props.social')}}
|
|
q-form.q-gutter-md.q-pt-sm
|
|
q-form.q-gutter-md.q-pt-sm
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='allowComments'
|
|
|
|
|
|
+ v-model='pageStore.allowComments'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.allowComments`)'
|
|
|
|
|
|
+ :label='t(`editor.props.allowComments`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='allowContributions'
|
|
|
|
|
|
+ v-model='pageStore.allowContributions'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.allowContributions`)'
|
|
|
|
|
|
+ :label='t(`editor.props.allowContributions`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='allowRatings'
|
|
|
|
|
|
+ v-model='pageStore.allowRatings'
|
|
dense
|
|
dense
|
|
- :label='$t(`editor.props.allowRatings`)'
|
|
|
|
|
|
+ :label='t(`editor.props.allowRatings`)'
|
|
color='primary'
|
|
color='primary'
|
|
checked-icon='las la-check'
|
|
checked-icon='las la-check'
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
- q-card-section.q-pb-lg(ref='card-tags')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-tags', size='xs')] {{$t('editor.props.tags')}}
|
|
|
|
|
|
+ q-card-section.q-pb-lg(id='refCardTags')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-tags', size='xs')] {{t('editor.props.tags')}}
|
|
page-tags(edit)
|
|
page-tags(edit)
|
|
- q-card-section.alt-card.q-pb-lg(ref='card-visibility')
|
|
|
|
- .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-eye', size='xs')] {{$t('editor.props.visibility')}}
|
|
|
|
|
|
+ q-card-section.alt-card.q-pb-lg(id='refCardVisibility')
|
|
|
|
+ .text-overline.items-center.flex #[q-icon.q-mr-sm(name='las la-eye', size='xs')] {{t('editor.props.visibility')}}
|
|
q-form.q-gutter-md.q-pt-sm
|
|
q-form.q-gutter-md.q-pt-sm
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='showInTree'
|
|
|
|
|
|
+ v-model='pageStore.showInTree'
|
|
dense
|
|
dense
|
|
:label='$t(`editor.props.showInTree`)'
|
|
:label='$t(`editor.props.showInTree`)'
|
|
color='primary'
|
|
color='primary'
|
|
@@ -239,7 +239,7 @@ q-card.page-properties-dialog
|
|
)
|
|
)
|
|
div
|
|
div
|
|
q-toggle(
|
|
q-toggle(
|
|
- v-model='requirePassword'
|
|
|
|
|
|
+ v-model='state.requirePassword'
|
|
dense
|
|
dense
|
|
:label='$t(`editor.props.requirePassword`)'
|
|
:label='$t(`editor.props.requirePassword`)'
|
|
color='primary'
|
|
color='primary'
|
|
@@ -247,119 +247,118 @@ q-card.page-properties-dialog
|
|
unchecked-icon='las la-times'
|
|
unchecked-icon='las la-times'
|
|
)
|
|
)
|
|
div(
|
|
div(
|
|
- v-if='requirePassword'
|
|
|
|
|
|
+ v-if='state.requirePassword'
|
|
style='padding-left: 40px;'
|
|
style='padding-left: 40px;'
|
|
)
|
|
)
|
|
q-input(
|
|
q-input(
|
|
ref='iptPagePassword'
|
|
ref='iptPagePassword'
|
|
- v-model='password'
|
|
|
|
- :label='$t(`editor.props.password`)'
|
|
|
|
- :hint='$t(`editor.props.passwordHint`)'
|
|
|
|
|
|
+ v-model='state.password'
|
|
|
|
+ :label='t(`editor.props.password`)'
|
|
|
|
+ :hint='t(`editor.props.passwordHint`)'
|
|
outlined
|
|
outlined
|
|
dense
|
|
dense
|
|
)
|
|
)
|
|
q-dialog(
|
|
q-dialog(
|
|
- v-model='showRelationDialog'
|
|
|
|
|
|
+ v-model='state.showRelationDialog'
|
|
)
|
|
)
|
|
- page-relation-dialog(:edit-id='editRelationId')
|
|
|
|
|
|
+ page-relation-dialog(:edit-id='state.editRelationId')
|
|
|
|
|
|
q-dialog(
|
|
q-dialog(
|
|
- v-model='showScriptsDialog'
|
|
|
|
|
|
+ v-model='state.showScriptsDialog'
|
|
)
|
|
)
|
|
- page-scripts-dialog(:mode='pageScriptsMode')
|
|
|
|
|
|
+ page-scripts-dialog(:mode='state.pageScriptsMode')
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
|
-import { get, sync } from 'vuex-pathify'
|
|
|
|
|
|
+<script setup>
|
|
|
|
+import { usePageStore } from 'src/stores/page'
|
|
|
|
+import { useSiteStore } from 'src/stores/site'
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
+import { useQuasar } from 'quasar'
|
|
|
|
+import { nextTick, onMounted, reactive, ref, watch } from 'vue'
|
|
|
|
+
|
|
import PageRelationDialog from './PageRelationDialog.vue'
|
|
import PageRelationDialog from './PageRelationDialog.vue'
|
|
import PageScriptsDialog from './PageScriptsDialog.vue'
|
|
import PageScriptsDialog from './PageScriptsDialog.vue'
|
|
import PageTags from './PageTags.vue'
|
|
import PageTags from './PageTags.vue'
|
|
|
|
|
|
-export default {
|
|
|
|
- components: {
|
|
|
|
- PageRelationDialog,
|
|
|
|
- PageScriptsDialog,
|
|
|
|
- PageTags
|
|
|
|
- },
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- showRelationDialog: false,
|
|
|
|
- showScriptsDialog: false,
|
|
|
|
- publishingRange: {},
|
|
|
|
- requirePassword: false,
|
|
|
|
- password: '',
|
|
|
|
- editRelationId: null,
|
|
|
|
- pageScriptsMode: 'jsLoad',
|
|
|
|
- showQuickAccess: true
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- title: sync('page/title', false),
|
|
|
|
- description: sync('page/description', false),
|
|
|
|
- showInTree: sync('page/showInTree', false),
|
|
|
|
- isPublished: sync('page/isPublished', false),
|
|
|
|
- relations: sync('page/relations', false),
|
|
|
|
- showSidebar: sync('page/showSidebar', false),
|
|
|
|
- showToc: sync('page/showToc', false),
|
|
|
|
- showTags: sync('page/showTags', false),
|
|
|
|
- tocDepth: sync('page/tocDepth', false),
|
|
|
|
- allowComments: sync('page/allowComments', false),
|
|
|
|
- allowContributions: sync('page/allowContributions', false),
|
|
|
|
- allowRatings: sync('page/allowRatings', false),
|
|
|
|
- thumbStyle: get('site/thumbStyle', false),
|
|
|
|
- barStyle: get('site/barStyle', false),
|
|
|
|
- quickaccess () {
|
|
|
|
- return [
|
|
|
|
- { key: 'info', icon: 'las la-info-circle', label: this.$t('editor.props.info') },
|
|
|
|
- { key: 'publishstate', icon: 'las la-power-off', label: this.$t('editor.props.publishState') },
|
|
|
|
- { key: 'relations', icon: 'las la-sun', label: this.$t('editor.props.relations') },
|
|
|
|
- { key: 'scripts', icon: 'las la-code', label: this.$t('editor.props.scripts') },
|
|
|
|
- { key: 'sidebar', icon: 'las la-ruler-vertical', label: this.$t('editor.props.sidebar') },
|
|
|
|
- { key: 'social', icon: 'las la-comments', label: this.$t('editor.props.social') },
|
|
|
|
- { key: 'tags', icon: 'las la-tags', label: this.$t('editor.props.tags') },
|
|
|
|
- { key: 'visibility', icon: 'las la-eye', label: this.$t('editor.props.visibility') }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- requirePassword (newValue) {
|
|
|
|
- if (newValue) {
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.iptPagePassword.focus()
|
|
|
|
- this.$refs.iptPagePassword.$el.scrollIntoView({
|
|
|
|
- behavior: 'smooth'
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.showQuickAccess = true
|
|
|
|
- }, 300)
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- editScripts (mode) {
|
|
|
|
- this.pageScriptsMode = mode
|
|
|
|
- this.showScriptsDialog = true
|
|
|
|
- },
|
|
|
|
- newRelation () {
|
|
|
|
- this.editRelationId = null
|
|
|
|
- this.showRelationDialog = true
|
|
|
|
- },
|
|
|
|
- editRelation (rel) {
|
|
|
|
- this.editRelationId = rel.id
|
|
|
|
- this.showRelationDialog = true
|
|
|
|
- },
|
|
|
|
- removeRelation (rel) {
|
|
|
|
- this.relations = this.$store.get('page/relations').filter(r => r.id !== rel.id)
|
|
|
|
- },
|
|
|
|
- jumpToSection (id) {
|
|
|
|
- this.$refs[`card-${id}`].$el.scrollIntoView({
|
|
|
|
|
|
+// QUASAR
|
|
|
|
+
|
|
|
|
+const $q = useQuasar()
|
|
|
|
+
|
|
|
|
+// STORES
|
|
|
|
+
|
|
|
|
+const pageStore = usePageStore()
|
|
|
|
+const siteStore = useSiteStore()
|
|
|
|
+
|
|
|
|
+// I18N
|
|
|
|
+
|
|
|
|
+const { t } = useI18n()
|
|
|
|
+
|
|
|
|
+// DATA
|
|
|
|
+
|
|
|
|
+const state = reactive({
|
|
|
|
+ showRelationDialog: false,
|
|
|
|
+ showScriptsDialog: false,
|
|
|
|
+ publishingRange: {},
|
|
|
|
+ requirePassword: false,
|
|
|
|
+ password: '',
|
|
|
|
+ editRelationId: null,
|
|
|
|
+ pageScriptsMode: 'jsLoad',
|
|
|
|
+ showQuickAccess: true
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const quickaccess = [
|
|
|
|
+ { key: 'refCardInfo', icon: 'las la-info-circle', label: t('editor.props.info') },
|
|
|
|
+ { key: 'refCardPublishState', icon: 'las la-power-off', label: t('editor.props.publishState') },
|
|
|
|
+ { key: 'refCardRelations', icon: 'las la-sun', label: t('editor.props.relations') },
|
|
|
|
+ { key: 'refCardScripts', icon: 'las la-code', label: t('editor.props.scripts') },
|
|
|
|
+ { key: 'refCardSidebar', icon: 'las la-ruler-vertical', label: t('editor.props.sidebar') },
|
|
|
|
+ { key: 'refCardSocial', icon: 'las la-comments', label: t('editor.props.social') },
|
|
|
|
+ { key: 'refCardTags', icon: 'las la-tags', label: t('editor.props.tags') },
|
|
|
|
+ { key: 'refCardVisibility', icon: 'las la-eye', label: t('editor.props.visibility') }
|
|
|
|
+]
|
|
|
|
+
|
|
|
|
+// WATCHERS
|
|
|
|
+
|
|
|
|
+watch(() => state.requirePassword, (newValue) => {
|
|
|
|
+ if (newValue) {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ this.$refs.iptPagePassword.focus()
|
|
|
|
+ this.$refs.iptPagePassword.$el.scrollIntoView({
|
|
behavior: 'smooth'
|
|
behavior: 'smooth'
|
|
})
|
|
})
|
|
- // this.$refs.scrollArea.setScrollPosition(offset, 600)
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+// METHODS
|
|
|
|
+
|
|
|
|
+function editScripts (mode) {
|
|
|
|
+ state.pageScriptsMode = mode
|
|
|
|
+ state.showScriptsDialog = true
|
|
|
|
+}
|
|
|
|
+function newRelation () {
|
|
|
|
+ state.editRelationId = null
|
|
|
|
+ state.showRelationDialog = true
|
|
|
|
+}
|
|
|
|
+function editRelation (rel) {
|
|
|
|
+ state.editRelationId = rel.id
|
|
|
|
+ state.showRelationDialog = true
|
|
}
|
|
}
|
|
|
|
+function removeRelation (rel) {
|
|
|
|
+ pageStore.relations = pageStore.relations.filter(r => r.id !== rel.id)
|
|
|
|
+}
|
|
|
|
+function jumpToSection (id) {
|
|
|
|
+ document.querySelector(`#${id}`).scrollIntoView({
|
|
|
|
+ behavior: 'smooth'
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// MOUNTED
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ state.showQuickAccess = true
|
|
|
|
+ }, 300)
|
|
|
|
+})
|
|
|
|
+
|
|
</script>
|
|
</script>
|