summaryrefslogtreecommitdiff
path: root/src/client/pages/page-editor/page-editor.script-block.vue
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-04-20 21:35:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-04-20 21:35:27 +0900
commit2ee0e07bb6346d29bc5e57ec8aac348143e2d50f (patch)
treeb85c6ac241e440606a5cd3094d2afe102a582f15 /src/client/pages/page-editor/page-editor.script-block.vue
parentMerge pull request #6282 from syuilo/patch/autogen/v11 (diff)
downloadmisskey-2ee0e07bb6346d29bc5e57ec8aac348143e2d50f.tar.gz
misskey-2ee0e07bb6346d29bc5e57ec8aac348143e2d50f.tar.bz2
misskey-2ee0e07bb6346d29bc5e57ec8aac348143e2d50f.zip
refactor(client): :sparkles:
Diffstat (limited to 'src/client/pages/page-editor/page-editor.script-block.vue')
-rw-r--r--src/client/pages/page-editor/page-editor.script-block.vue24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/client/pages/page-editor/page-editor.script-block.vue b/src/client/pages/page-editor/page-editor.script-block.vue
index 7e3bbf0c88..9eafd5daa0 100644
--- a/src/client/pages/page-editor/page-editor.script-block.vue
+++ b/src/client/pages/page-editor/page-editor.script-block.vue
@@ -24,15 +24,15 @@
</section>
<section v-else-if="value.type === 'ref'" class="hpdwcrvs">
<select v-model="value.value">
- <option v-for="v in aoiScript.getVarsByType(getExpectedType ? getExpectedType() : null).filter(x => x.name !== name)" :value="v.name">{{ v.name }}</option>
+ <option v-for="v in hpml.getVarsByType(getExpectedType ? getExpectedType() : null).filter(x => x.name !== name)" :value="v.name">{{ v.name }}</option>
<optgroup :label="$t('_pages.script.argVariables')">
<option v-for="v in fnSlots" :value="v.name">{{ v.name }}</option>
</optgroup>
<optgroup :label="$t('_pages.script.pageVariables')">
- <option v-for="v in aoiScript.getPageVarsByType(getExpectedType ? getExpectedType() : null)" :value="v">{{ v }}</option>
+ <option v-for="v in hpml.getPageVarsByType(getExpectedType ? getExpectedType() : null)" :value="v">{{ v }}</option>
</optgroup>
<optgroup :label="$t('_pages.script.enviromentVariables')">
- <option v-for="v in aoiScript.getEnvVarsByType(getExpectedType ? getExpectedType() : null)" :value="v">{{ v }}</option>
+ <option v-for="v in hpml.getEnvVarsByType(getExpectedType ? getExpectedType() : null)" :value="v">{{ v }}</option>
</optgroup>
</select>
</section>
@@ -44,13 +44,13 @@
<span>{{ $t('_pages.script.blocks._fn.slots') }}</span>
<template #desc>{{ $t('_pages.script.blocks._fn.slots-info') }}</template>
</mk-textarea>
- <x-v v-if="value.value.expression" v-model="value.value.expression" :title="$t(`_pages.script.blocks._fn.arg1`)" :get-expected-type="() => null" :aoi-script="aoiScript" :fn-slots="value.value.slots" :name="name"/>
+ <x-v v-if="value.value.expression" v-model="value.value.expression" :title="$t(`_pages.script.blocks._fn.arg1`)" :get-expected-type="() => null" :hpml="hpml" :fn-slots="value.value.slots" :name="name"/>
</section>
<section v-else-if="value.type.startsWith('fn:')" class="" style="padding:16px;">
- <x-v v-for="(x, i) in value.args" v-model="value.args[i]" :title="aoiScript.getVarByName(value.type.split(':')[1]).value.slots[i].name" :get-expected-type="() => null" :aoi-script="aoiScript" :name="name" :key="i"/>
+ <x-v v-for="(x, i) in value.args" v-model="value.args[i]" :title="hpml.getVarByName(value.type.split(':')[1]).value.slots[i].name" :get-expected-type="() => null" :hpml="hpml" :name="name" :key="i"/>
</section>
<section v-else class="" style="padding:16px;">
- <x-v v-for="(x, i) in value.args" v-model="value.args[i]" :title="$t(`_pages.script.blocks._${value.type}.arg${i + 1}`)" :get-expected-type="() => _getExpectedType(i)" :aoi-script="aoiScript" :name="name" :fn-slots="fnSlots" :key="i"/>
+ <x-v v-for="(x, i) in value.args" v-model="value.args[i]" :title="$t(`_pages.script.blocks._${value.type}.arg${i + 1}`)" :get-expected-type="() => _getExpectedType(i)" :hpml="hpml" :name="name" :fn-slots="fnSlots" :key="i"/>
</section>
</x-container>
</template>
@@ -62,7 +62,7 @@ import { v4 as uuid } from 'uuid';
import i18n from '../../i18n';
import XContainer from './page-editor.container.vue';
import MkTextarea from '../../components/ui/textarea.vue';
-import { isLiteralBlock, funcDefs, blockDefs } from '../../scripts/aoiscript/index';
+import { isLiteralBlock, funcDefs, blockDefs } from '../../scripts/hpml/index';
export default Vue.extend({
i18n,
@@ -88,7 +88,7 @@ export default Vue.extend({
required: false,
default: false
},
- aoiScript: {
+ hpml: {
required: true,
},
name: {
@@ -156,7 +156,7 @@ export default Vue.extend({
if (this.value.type && this.value.type.startsWith('fn:')) {
const fnName = this.value.type.split(':')[1];
- const fn = this.aoiScript.getVarByName(fnName);
+ const fn = this.hpml.getVarByName(fnName);
const empties = [];
for (let i = 0; i < fn.value.slots.length; i++) {
@@ -202,9 +202,9 @@ export default Vue.extend({
deep: true
});
- this.$watch('aoiScript.variables', () => {
+ this.$watch('hpml.variables', () => {
if (this.type != null && this.value) {
- this.error = this.aoiScript.typeCheck(this.value);
+ this.error = this.hpml.typeCheck(this.value);
}
}, {
deep: true
@@ -226,7 +226,7 @@ export default Vue.extend({
},
_getExpectedType(slot: number) {
- return this.aoiScript.getExpectedType(this.value, slot);
+ return this.hpml.getExpectedType(this.value, slot);
}
}
});