2022-06-20 08:38:49 +00:00
|
|
|
<template><MkStickyContainer>
|
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
<MkSpacer :content-max="700">
|
2021-12-04 09:27:31 +00:00
|
|
|
<div class="jqqmcavi">
|
2021-10-23 19:03:07 +00:00
|
|
|
<MkButton v-if="pageId" class="button" inline link :to="`/@${ author.username }/pages/${ currentName }`"><i class="fas fa-external-link-square-alt"></i> {{ $ts._pages.viewPage }}</MkButton>
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkButton v-if="!readonly" inline primary class="button" @click="save"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
|
|
|
<MkButton v-if="pageId" inline class="button" @click="duplicate"><i class="fas fa-copy"></i> {{ $ts.duplicate }}</MkButton>
|
|
|
|
<MkButton v-if="pageId && !readonly" inline class="button" danger @click="del"><i class="fas fa-trash-alt"></i> {{ $ts.delete }}</MkButton>
|
2021-10-23 19:03:07 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-if="tab === 'settings'">
|
2021-12-04 09:27:31 +00:00
|
|
|
<div class="_formRoot">
|
2021-10-23 19:03:07 +00:00
|
|
|
<MkInput v-model="title" class="_formBlock">
|
|
|
|
<template #label>{{ $ts._pages.title }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
|
|
|
<MkInput v-model="summary" class="_formBlock">
|
|
|
|
<template #label>{{ $ts._pages.summary }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
|
|
|
<MkInput v-model="name" class="_formBlock">
|
|
|
|
<template #prefix>{{ url }}/@{{ author.username }}/pages/</template>
|
|
|
|
<template #label>{{ $ts._pages.url }}</template>
|
|
|
|
</MkInput>
|
|
|
|
|
|
|
|
<MkSwitch v-model="alignCenter" class="_formBlock">{{ $ts._pages.alignCenter }}</MkSwitch>
|
|
|
|
|
|
|
|
<MkSelect v-model="font" class="_formBlock">
|
|
|
|
<template #label>{{ $ts._pages.font }}</template>
|
|
|
|
<option value="serif">{{ $ts._pages.fontSerif }}</option>
|
|
|
|
<option value="sans-serif">{{ $ts._pages.fontSansSerif }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
|
|
|
|
<MkSwitch v-model="hideTitleWhenPinned" class="_formBlock">{{ $ts._pages.hideTitleWhenPinned }}</MkSwitch>
|
2019-07-06 21:56:13 +00:00
|
|
|
|
2021-10-23 19:03:07 +00:00
|
|
|
<div class="eyeCatch">
|
|
|
|
<MkButton v-if="eyeCatchingImageId == null && !readonly" @click="setEyeCatchingImage"><i class="fas fa-plus"></i> {{ $ts._pages.eyeCatchingImageSet }}</MkButton>
|
|
|
|
<div v-else-if="eyeCatchingImage">
|
|
|
|
<img :src="eyeCatchingImage.url" :alt="eyeCatchingImage.name" style="max-width: 100%;"/>
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkButton v-if="!readonly" @click="removeEyeCatchingImage()"><i class="fas fa-trash-alt"></i> {{ $ts._pages.eyeCatchingImageRemove }}</MkButton>
|
2020-11-15 04:42:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-10 03:40:50 +00:00
|
|
|
</div>
|
2021-10-23 19:03:07 +00:00
|
|
|
</div>
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2021-10-23 19:03:07 +00:00
|
|
|
<div v-else-if="tab === 'contents'">
|
2021-12-04 09:27:31 +00:00
|
|
|
<div>
|
2021-11-19 10:36:12 +00:00
|
|
|
<XBlocks v-model="content" class="content" :hpml="hpml"/>
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkButton v-if="!readonly" @click="add()"><i class="fas fa-plus"></i></MkButton>
|
2021-04-10 03:40:50 +00:00
|
|
|
</div>
|
2021-10-23 19:03:07 +00:00
|
|
|
</div>
|
2019-05-01 11:48:56 +00:00
|
|
|
|
2021-10-23 19:03:07 +00:00
|
|
|
<div v-else-if="tab === 'variables'">
|
|
|
|
<div class="qmuvgica">
|
2021-11-19 10:36:12 +00:00
|
|
|
<XDraggable v-show="variables.length > 0" v-model="variables" tag="div" class="variables" item-key="name" handle=".drag-handle" :group="{ name: 'variables' }" animation="150" swap-threshold="0.5">
|
2021-10-23 19:03:07 +00:00
|
|
|
<template #item="{element}">
|
|
|
|
<XVariable
|
2022-06-20 08:38:49 +00:00
|
|
|
:model-value="element"
|
2021-10-23 19:03:07 +00:00
|
|
|
:removable="true"
|
|
|
|
:hpml="hpml"
|
|
|
|
:name="element.name"
|
|
|
|
:title="element.name"
|
|
|
|
:draggable="true"
|
2021-11-19 10:36:12 +00:00
|
|
|
@remove="() => removeVariable(element)"
|
2021-10-23 19:03:07 +00:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</XDraggable>
|
|
|
|
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkButton v-if="!readonly" class="add" @click="addVariable()"><i class="fas fa-plus"></i></MkButton>
|
2021-04-10 03:40:50 +00:00
|
|
|
</div>
|
2021-10-23 19:03:07 +00:00
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2021-10-23 19:03:07 +00:00
|
|
|
<div v-else-if="tab === 'script'">
|
|
|
|
<div>
|
2021-11-19 10:36:12 +00:00
|
|
|
<MkTextarea v-model="script" class="_code"/>
|
2021-04-10 03:40:50 +00:00
|
|
|
</div>
|
2021-10-02 15:33:29 +00:00
|
|
|
</div>
|
2022-06-20 08:38:49 +00:00
|
|
|
</MkSpacer></MkStickyContainer>
|
2019-04-29 00:11:57 +00:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { defineComponent, defineAsyncComponent, computed, provide, watch } from 'vue';
|
2020-08-21 23:03:11 +00:00
|
|
|
import 'prismjs';
|
|
|
|
import { highlight, languages } from 'prismjs/components/prism-core';
|
|
|
|
import 'prismjs/components/prism-clike';
|
|
|
|
import 'prismjs/components/prism-javascript';
|
2020-04-17 11:36:51 +00:00
|
|
|
import 'prismjs/themes/prism-okaidia.css';
|
2020-08-21 23:03:11 +00:00
|
|
|
import 'vue-prism-editor/dist/prismeditor.min.css';
|
2020-01-29 19:37:25 +00:00
|
|
|
import { v4 as uuid } from 'uuid';
|
2019-04-29 00:11:57 +00:00
|
|
|
import XVariable from './page-editor.script-block.vue';
|
2019-05-02 08:55:59 +00:00
|
|
|
import XBlocks from './page-editor.blocks.vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import MkTextarea from '@/components/form/textarea.vue';
|
|
|
|
import MkContainer from '@/components/ui/container.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import MkSelect from '@/components/form/select.vue';
|
|
|
|
import MkSwitch from '@/components/form/switch.vue';
|
|
|
|
import MkInput from '@/components/form/input.vue';
|
|
|
|
import { blockDefs } from '@/scripts/hpml/index';
|
|
|
|
import { HpmlTypeChecker } from '@/scripts/hpml/type-checker';
|
|
|
|
import { url } from '@/config';
|
|
|
|
import { collectPageVars } from '@/scripts/collect-page-vars';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { selectFile } from '@/scripts/select-file';
|
2022-06-20 08:38:49 +00:00
|
|
|
import { mainRouter } from '@/router';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
import { $i } from '@/account';
|
|
|
|
const XDraggable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
initPageId?: string;
|
|
|
|
initPageName?: string;
|
|
|
|
initUser?: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
let tab = $ref('settings');
|
|
|
|
let author = $ref($i);
|
|
|
|
let readonly = $ref(false);
|
|
|
|
let page = $ref(null);
|
|
|
|
let pageId = $ref(null);
|
|
|
|
let currentName = $ref(null);
|
|
|
|
let title = $ref('');
|
|
|
|
let summary = $ref(null);
|
|
|
|
let name = $ref(Date.now().toString());
|
|
|
|
let eyeCatchingImage = $ref(null);
|
|
|
|
let eyeCatchingImageId = $ref(null);
|
|
|
|
let font = $ref('sans-serif');
|
|
|
|
let content = $ref([]);
|
|
|
|
let alignCenter = $ref(false);
|
|
|
|
let hideTitleWhenPinned = $ref(false);
|
|
|
|
let variables = $ref([]);
|
|
|
|
let hpml = $ref(null);
|
|
|
|
let script = $ref('');
|
|
|
|
|
|
|
|
provide('readonly', readonly);
|
|
|
|
provide('getScriptBlockList', getScriptBlockList);
|
|
|
|
provide('getPageBlockList', getPageBlockList);
|
|
|
|
|
|
|
|
watch($$(eyeCatchingImageId), async () => {
|
|
|
|
if (eyeCatchingImageId == null) {
|
|
|
|
eyeCatchingImage = null;
|
|
|
|
} else {
|
|
|
|
eyeCatchingImage = await os.api('drive/files/show', {
|
|
|
|
fileId: eyeCatchingImageId,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function getSaveOptions() {
|
|
|
|
return {
|
|
|
|
title: tatitle.trim(),
|
|
|
|
name: taname.trim(),
|
|
|
|
summary: tasummary,
|
|
|
|
font: tafont,
|
|
|
|
script: tascript,
|
|
|
|
hideTitleWhenPinned: tahideTitleWhenPinned,
|
|
|
|
alignCenter: taalignCenter,
|
|
|
|
content: tacontent,
|
|
|
|
variables: tavariables,
|
|
|
|
eyeCatchingImageId: taeyeCatchingImageId,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
const options = tagetSaveOptions();
|
|
|
|
|
|
|
|
const onError = err => {
|
|
|
|
if (err.id == '3d81ceae-475f-4600-b2a8-2bc116157532') {
|
|
|
|
if (err.info.param == 'name') {
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
|
|
|
title: i18n.ts._pages.invalidNameTitle,
|
|
|
|
text: i18n.ts._pages.invalidNameText,
|
2019-04-29 00:11:57 +00:00
|
|
|
});
|
|
|
|
}
|
2022-06-20 08:38:49 +00:00
|
|
|
} else if (err.code == 'NAME_ALREADY_EXISTS') {
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
|
|
|
text: i18n.ts._pages.nameAlreadyExists,
|
2019-05-24 10:19:43 +00:00
|
|
|
});
|
|
|
|
}
|
2022-06-20 08:38:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (tapageId) {
|
|
|
|
options.pageId = tapageId;
|
|
|
|
os.api('pages/update', options)
|
|
|
|
.then(page => {
|
|
|
|
tacurrentName = taname.trim();
|
|
|
|
os.alert({
|
|
|
|
type: 'success',
|
|
|
|
text: i18n.ts._pages.updated,
|
2019-04-29 00:11:57 +00:00
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
}).catch(onError);
|
|
|
|
} else {
|
|
|
|
os.api('pages/create', options)
|
|
|
|
.then(created => {
|
|
|
|
tapageId = created.id;
|
|
|
|
tacurrentName = name.trim();
|
|
|
|
os.alert({
|
|
|
|
type: 'success',
|
|
|
|
text: i18n.ts._pages.created,
|
2020-12-19 12:41:00 +00:00
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
mainRouter.push(`/pages/edit/${pageId}`);
|
|
|
|
}).catch(onError);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function del() {
|
|
|
|
os.confirm({
|
|
|
|
type: 'warning',
|
|
|
|
text: i18n.t('removeAreYouSure', { x: title.trim() }),
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
os.api('pages/delete', {
|
|
|
|
pageId: pageId,
|
|
|
|
}).then(() => {
|
|
|
|
os.alert({
|
|
|
|
type: 'success',
|
|
|
|
text: i18n.ts._pages.deleted,
|
2019-04-29 00:11:57 +00:00
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
mainRouter.push('/pages');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function duplicate() {
|
|
|
|
tatitle = tatitle + ' - copy';
|
|
|
|
taname = taname + '-copy';
|
|
|
|
os.api('pages/create', tagetSaveOptions()).then(created => {
|
|
|
|
tapageId = created.id;
|
|
|
|
tacurrentName = taname.trim();
|
|
|
|
os.alert({
|
|
|
|
type: 'success',
|
|
|
|
text: i18n.ts._pages.created,
|
|
|
|
});
|
|
|
|
mainRouter.push(`/pages/edit/${pageId}`);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async function add() {
|
|
|
|
const { canceled, result: type } = await os.select({
|
|
|
|
type: null,
|
|
|
|
title: i18n.ts._pages.chooseBlock,
|
|
|
|
groupedItems: tagetPageBlockList(),
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
const id = uuid();
|
|
|
|
tacontent.push({ id, type });
|
|
|
|
}
|
|
|
|
|
|
|
|
async function addVariable() {
|
|
|
|
let { canceled, result: name } = await os.inputText({
|
|
|
|
title: i18n.ts._pages.enterVariableName,
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
name = name.trim();
|
|
|
|
|
|
|
|
if (tahpml.isUsedName(name)) {
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
|
|
|
text: i18n.ts._pages.variableNameIsAlreadyUsed,
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
const id = uuid();
|
|
|
|
tavariables.push({ id, name, type: null });
|
|
|
|
}
|
|
|
|
|
|
|
|
function removeVariable(v) {
|
|
|
|
tavariables = tavariables.filter(x => x.name !== v.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
function getPageBlockList() {
|
|
|
|
return [{
|
|
|
|
label: i18n.ts._pages.contentBlocks,
|
|
|
|
items: [
|
|
|
|
{ value: 'section', text: i18n.ts._pages.blocks.section },
|
|
|
|
{ value: 'text', text: i18n.ts._pages.blocks.text },
|
|
|
|
{ value: 'image', text: i18n.ts._pages.blocks.image },
|
|
|
|
{ value: 'textarea', text: i18n.ts._pages.blocks.textarea },
|
|
|
|
{ value: 'note', text: i18n.ts._pages.blocks.note },
|
|
|
|
{ value: 'canvas', text: i18n.ts._pages.blocks.canvas },
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
label: i18n.ts._pages.inputBlocks,
|
|
|
|
items: [
|
|
|
|
{ value: 'button', text: i18n.ts._pages.blocks.button },
|
|
|
|
{ value: 'radioButton', text: i18n.ts._pages.blocks.radioButton },
|
|
|
|
{ value: 'textInput', text: i18n.ts._pages.blocks.textInput },
|
|
|
|
{ value: 'textareaInput', text: i18n.ts._pages.blocks.textareaInput },
|
|
|
|
{ value: 'numberInput', text: i18n.ts._pages.blocks.numberInput },
|
|
|
|
{ value: 'switch', text: i18n.ts._pages.blocks.switch },
|
|
|
|
{ value: 'counter', text: i18n.ts._pages.blocks.counter },
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
label: i18n.ts._pages.specialBlocks,
|
|
|
|
items: [
|
|
|
|
{ value: 'if', text: i18n.ts._pages.blocks.if },
|
|
|
|
{ value: 'post', text: i18n.ts._pages.blocks.post },
|
|
|
|
],
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
|
|
|
|
function getScriptBlockList(type: string = null) {
|
|
|
|
const list = [];
|
|
|
|
|
|
|
|
const blocks = blockDefs.filter(block => type === null || block.out === null || block.out === type || typeof block.out === 'number');
|
|
|
|
|
|
|
|
for (const block of blocks) {
|
|
|
|
const category = list.find(x => x.category === block.category);
|
|
|
|
if (category) {
|
|
|
|
category.items.push({
|
|
|
|
value: block.type,
|
|
|
|
text: i18n.t(`_pages.script.blocks.${block.type}`),
|
2019-04-29 00:11:57 +00:00
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
} else {
|
|
|
|
list.push({
|
|
|
|
category: block.category,
|
|
|
|
label: i18n.t(`_pages.script.categories.${block.category}`),
|
|
|
|
items: [{
|
|
|
|
value: block.type,
|
|
|
|
text: i18n.t(`_pages.script.blocks.${block.type}`),
|
|
|
|
}],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
const userFns = variables.filter(x => x.type === 'fn');
|
|
|
|
if (userFns.length > 0) {
|
|
|
|
list.unshift({
|
|
|
|
label: i18n.t('_pages.script.categories.fn'),
|
|
|
|
items: userFns.map(v => ({
|
|
|
|
value: 'fn:' + v.name,
|
|
|
|
text: v.name,
|
|
|
|
})),
|
|
|
|
});
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setEyeCatchingImage(e) {
|
|
|
|
selectFile(e.currentTarget ?? e.target, null).then(file => {
|
|
|
|
eyeCatchingImageId = file.id;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function removeEyeCatchingImage() {
|
|
|
|
taeyeCatchingImageId = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
function highlighter(code) {
|
|
|
|
return highlight(code, languages.js, 'javascript');
|
|
|
|
}
|
|
|
|
|
|
|
|
async function init() {
|
|
|
|
hpml = new HpmlTypeChecker();
|
|
|
|
|
|
|
|
watch($$(variables), () => {
|
|
|
|
hpml.variables = variables;
|
|
|
|
}, { deep: true });
|
|
|
|
|
|
|
|
watch($$(content), () => {
|
|
|
|
hpml.pageVars = collectPageVars(content);
|
|
|
|
}, { deep: true });
|
|
|
|
|
|
|
|
if (props.initPageId) {
|
|
|
|
page = await os.api('pages/show', {
|
|
|
|
pageId: props.initPageId,
|
|
|
|
});
|
|
|
|
} else if (props.initPageName && props.initUser) {
|
|
|
|
page = await os.api('pages/show', {
|
|
|
|
name: props.initPageName,
|
|
|
|
username: props.initUser,
|
|
|
|
});
|
|
|
|
readonly = true;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
if (page) {
|
|
|
|
author = page.user;
|
|
|
|
pageId = page.id;
|
|
|
|
title = page.title;
|
|
|
|
name = page.name;
|
|
|
|
currentName = page.name;
|
|
|
|
summary = page.summary;
|
|
|
|
font = page.font;
|
|
|
|
script = page.script;
|
|
|
|
hideTitleWhenPinned = page.hideTitleWhenPinned;
|
|
|
|
alignCenter = page.alignCenter;
|
|
|
|
content = page.content;
|
|
|
|
variables = page.variables;
|
|
|
|
eyeCatchingImageId = page.eyeCatchingImageId;
|
|
|
|
} else {
|
|
|
|
const id = uuid();
|
|
|
|
content = [{
|
|
|
|
id,
|
|
|
|
type: 'text',
|
|
|
|
text: 'Hello World!',
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
init();
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
const headerActions = $computed(() => []);
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
const headerTabs = $computed(() => []);
|
2020-08-21 23:03:11 +00:00
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
definePageMetadata(computed(() => {
|
|
|
|
let title = i18n.ts._pages.newPage;
|
|
|
|
if (props.initPageId) {
|
|
|
|
title = i18n.ts._pages.editPage;
|
2019-04-29 00:11:57 +00:00
|
|
|
}
|
2022-06-20 08:38:49 +00:00
|
|
|
else if (props.initPageName && props.initUser) {
|
|
|
|
title = i18n.ts._pages.readPage;
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
title: title,
|
|
|
|
icon: 'fas fa-pencil-alt',
|
|
|
|
bg: 'var(--bg)',
|
|
|
|
tabs: [{
|
|
|
|
active: tab === 'settings',
|
|
|
|
title: i18n.ts._pages.pageSetting,
|
|
|
|
icon: 'fas fa-cog',
|
|
|
|
onClick: () => { tab = 'settings'; },
|
|
|
|
}, {
|
|
|
|
active: tab === 'contents',
|
|
|
|
title: i18n.ts._pages.contents,
|
|
|
|
icon: 'fas fa-sticky-note',
|
|
|
|
onClick: () => { tab = 'contents'; },
|
|
|
|
}, {
|
|
|
|
active: tab === 'variables',
|
|
|
|
title: i18n.ts._pages.variables,
|
|
|
|
icon: 'fas fa-magic',
|
|
|
|
onClick: () => { tab = 'variables'; },
|
|
|
|
}, {
|
|
|
|
active: tab === 'script',
|
|
|
|
title: i18n.ts.script,
|
|
|
|
icon: 'fas fa-code',
|
|
|
|
onClick: () => { tab = 'script'; },
|
|
|
|
}],
|
|
|
|
};
|
|
|
|
}));
|
2019-04-29 00:11:57 +00:00
|
|
|
</script>
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<style lang="scss" scoped>
|
2021-10-11 16:04:50 +00:00
|
|
|
.jqqmcavi {
|
|
|
|
> .button {
|
|
|
|
& + .button {
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
.gwbmwxkm {
|
2020-10-17 11:12:00 +00:00
|
|
|
position: relative;
|
2020-01-29 19:37:25 +00:00
|
|
|
|
|
|
|
> header {
|
|
|
|
> .title {
|
|
|
|
z-index: 1;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0 16px;
|
|
|
|
line-height: 42px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
font-weight: bold;
|
2020-04-15 15:39:21 +00:00
|
|
|
box-shadow: 0 1px rgba(#000, 0.07);
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2021-04-20 14:22:59 +00:00
|
|
|
> i {
|
2020-01-29 19:37:25 +00:00
|
|
|
margin-right: 6px;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .buttons {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 2;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 0;
|
|
|
|
width: 42px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
line-height: 42px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> section {
|
|
|
|
padding: 0 32px 32px 32px;
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
@media (max-width: 500px) {
|
|
|
|
padding: 0 16px 16px 16px;
|
|
|
|
}
|
2019-04-29 05:46:35 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .view {
|
|
|
|
display: inline-block;
|
|
|
|
margin: 16px 0 0 0;
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .content {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .eyeCatch {
|
|
|
|
margin-bottom: 16px;
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> div {
|
|
|
|
> img {
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
.qmuvgica {
|
2021-10-11 16:04:50 +00:00
|
|
|
padding: 16px;
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .variables {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
> .add {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
2019-04-29 00:11:57 +00:00
|
|
|
</style>
|