diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-29 15:26:43 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-29 15:26:43 +0900 |
| commit | 42e84b77e1ff9402ca9ae1f0d4c053a954b4421a (patch) | |
| tree | f983fecb972f045dde0ec66e6ad26ae2c4046d53 /src/client | |
| parent | Merge branch 'develop' (diff) | |
| parent | 11.6.0 (diff) | |
| download | misskey-42e84b77e1ff9402ca9ae1f0d4c053a954b4421a.tar.gz misskey-42e84b77e1ff9402ca9ae1f0d4c053a954b4421a.tar.bz2 misskey-42e84b77e1ff9402ca9ae1f0d4c053a954b4421a.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/client')
8 files changed, 75 insertions, 32 deletions
diff --git a/src/client/app/common/scripts/aiscript.ts b/src/client/app/common/scripts/aiscript.ts index a3e499fc88..fe9a295000 100644 --- a/src/client/app/common/scripts/aiscript.ts +++ b/src/client/app/common/scripts/aiscript.ts @@ -51,26 +51,30 @@ type TypeError = { }; const funcDefs = { - if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: faShareAlt, }, - not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, - or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, - and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, - add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faPlus, }, - subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faMinus, }, - multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faTimes, }, - divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faDivide, }, - eq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faEquals, }, - notEq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faNotEqual, }, - gt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThan, }, - lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThan, }, - gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThanEqual, }, - ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThanEqual, }, - rannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, }, - random: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, }, - randomPick: { in: [0], out: 0, category: 'random', icon: faDice, }, - dailyRannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, }, - dailyRandom: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, }, - dailyRandomPick: { in: [0], out: 0, category: 'random', icon: faDice, }, + if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: faShareAlt, }, + not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, + or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, + and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: faFlag, }, + add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faPlus, }, + subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faMinus, }, + multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faTimes, }, + divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: faDivide, }, + eq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faEquals, }, + notEq: { in: [0, 0], out: 'boolean', category: 'comparison', icon: faNotEqual, }, + gt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThan, }, + lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThan, }, + gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faGreaterThanEqual, }, + ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: faLessThanEqual, }, + strLen: { in: ['string'], out: 'number', category: 'text', icon: faQuoteRight, }, + strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: faQuoteRight, }, + strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: faQuoteRight, }, + strReverse: { in: ['string'], out: 'string', category: 'text', icon: faQuoteRight, }, + rannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, }, + random: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, }, + randomPick: { in: [0], out: 0, category: 'random', icon: faDice, }, + dailyRannum: { in: ['number', 'number'], out: 'number', category: 'random', icon: faDice, }, + dailyRandom: { in: ['number'], out: 'boolean', category: 'random', icon: faDice, }, + dailyRandomPick: { in: [0], out: 0, category: 'random', icon: faDice, }, }; const blockDefs = [ @@ -413,6 +417,10 @@ export class AiScript { subtract: (a, b) => a - b, multiply: (a, b) => a * b, divide: (a, b) => a / b, + strLen: (a) => a.length, + strPick: (a, b) => a[b - 1], + strReplace: (a, b, c) => a.split(b).join(c), + strReverse: (a) => a.split('').reverse().join(''), random: (probability) => Math.floor(seedrandom(`${this.opts.randomSeed}:${block.id}`)() * 100) < probability, rannum: (min, max) => min + Math.floor(seedrandom(`${this.opts.randomSeed}:${block.id}`)() * (max - min + 1)), randomPick: (list) => list[Math.floor(seedrandom(`${this.opts.randomSeed}:${block.id}`)() * list.length)], diff --git a/src/client/app/common/views/components/dialog.vue b/src/client/app/common/views/components/dialog.vue index 020c88f699..f22e0174b3 100644 --- a/src/client/app/common/views/components/dialog.vue +++ b/src/client/app/common/views/components/dialog.vue @@ -1,7 +1,7 @@ <template> <div class="felqjxyj" :class="{ splash }"> <div class="bg" ref="bg" @click="onBgClick"></div> - <div class="main" ref="main"> + <div class="main" ref="main" :class="{ round: $store.state.device.roundedCorners }"> <template v-if="type == 'signin'"> <mk-signin/> </template> @@ -229,10 +229,12 @@ export default Vue.extend({ width calc(100% - 32px) text-align center background var(--face) - border-radius 8px color var(--faceText) opacity 0 + &.round + border-radius 8px + > .icon font-size 32px diff --git a/src/client/app/common/views/components/page-editor/page-editor.input.vue b/src/client/app/common/views/components/page-editor/page-editor.input.vue index 1f3754252b..4e13840439 100644 --- a/src/client/app/common/views/components/page-editor/page-editor.input.vue +++ b/src/client/app/common/views/components/page-editor/page-editor.input.vue @@ -43,6 +43,13 @@ export default Vue.extend({ created() { if (this.value.name == null) Vue.set(this.value, 'name', ''); if (this.value.inputType == null) Vue.set(this.value, 'inputType', 'string'); + + this.$watch('value.inputType', t => { + if (this.value.default != null) { + if (t === 'number') this.value.default = parseInt(this.value.default, 10); + if (t === 'string') this.value.default = this.value.default.toString(); + } + }); }, }); </script> diff --git a/src/client/app/common/views/components/page-editor/page-editor.script-block.vue b/src/client/app/common/views/components/page-editor/page-editor.script-block.vue index 3122832030..9554c75d04 100644 --- a/src/client/app/common/views/components/page-editor/page-editor.script-block.vue +++ b/src/client/app/common/views/components/page-editor/page-editor.script-block.vue @@ -16,8 +16,8 @@ <section v-else-if="value.type === 'multiLineText'" class="tbwccoaw"> <textarea v-model="value.value"></textarea> </section> - <section v-else-if="value.type === 'textList'" class="frvuzvoi"> - <ui-textarea v-model="value.value"></ui-textarea> + <section v-else-if="value.type === 'textList'" class="tbwccoaw"> + <textarea v-model="value.value" :placeholder="$t('script.blocks._textList.info')"></textarea> </section> <section v-else-if="value.type === 'number'" class="tbwccoaw"> <input v-model="value.value" type="number"/> diff --git a/src/client/app/common/views/components/page-editor/page-editor.vue b/src/client/app/common/views/components/page-editor/page-editor.vue index 1bcaaa0330..8b25828515 100644 --- a/src/client/app/common/views/components/page-editor/page-editor.vue +++ b/src/client/app/common/views/components/page-editor/page-editor.vue @@ -11,6 +11,8 @@ </header> <section> + <a class="view" v-if="pageId" :href="`/@${ $store.state.i.username }/pages/${ currentName }`" target="_blank"><fa :icon="faExternalLinkSquareAlt"/> {{ $t('view-page') }}</a> + <ui-input v-model="title"> <span>{{ $t('title') }}</span> </ui-input> @@ -84,7 +86,7 @@ <script lang="ts"> import Vue from 'vue'; import i18n from '../../../../i18n'; -import { faICursor, faPlus, faSquareRootAlt, faCog } from '@fortawesome/free-solid-svg-icons'; +import { faICursor, faPlus, faSquareRootAlt, faCog, faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons'; import { faSave, faStickyNote, faTrashAlt } from '@fortawesome/free-regular-svg-icons'; import XVariable from './page-editor.script-block.vue'; import XBlock from './page-editor.block.vue'; @@ -110,6 +112,7 @@ export default Vue.extend({ data() { return { pageId: null, + currentName: null, title: '', summary: null, name: Date.now().toString(), @@ -123,7 +126,7 @@ export default Vue.extend({ showOptions: false, moreDetails: false, url, - faPlus, faICursor, faSave, faStickyNote, faSquareRootAlt, faCog, faTrashAlt + faPlus, faICursor, faSave, faStickyNote, faSquareRootAlt, faCog, faTrashAlt, faExternalLinkSquareAlt }; }, @@ -157,6 +160,7 @@ export default Vue.extend({ this.pageId = page.id; this.title = page.title; this.name = page.name; + this.currentName = page.name; this.summary = page.summary; this.font = page.font; this.alignCenter = page.alignCenter; @@ -194,6 +198,7 @@ export default Vue.extend({ variables: this.variables, eyeCatchingImageId: this.eyeCatchingImageId, }).then(page => { + this.currentName = this.name.trim(); this.$root.dialog({ type: 'success', text: this.$t('page-updated') @@ -211,6 +216,7 @@ export default Vue.extend({ eyeCatchingImageId: this.eyeCatchingImageId, }).then(page => { this.pageId = page.id; + this.currentName = this.name.trim(); this.$root.dialog({ type: 'success', text: this.$t('page-created') @@ -427,6 +433,10 @@ export default Vue.extend({ @media (max-width 500px) padding 0 16px 16px 16px + > .view + display inline-block + margin 16px 0 0 0 + > .content margin-bottom 16px diff --git a/src/client/app/common/views/components/ui/button.vue b/src/client/app/common/views/components/ui/button.vue index 7b443a1ac5..adf43f6d8c 100644 --- a/src/client/app/common/views/components/ui/button.vue +++ b/src/client/app/common/views/components/ui/button.vue @@ -1,7 +1,7 @@ <template> <component class="dmtdnykelhudezerjlfpbhgovrgnqqgr" :is="link ? 'a' : 'button'" - :class="{ inline, primary, wait }" + :class="{ inline, primary, wait, round: $store.state.device.roundedCorners }" :type="type" @click="$emit('click')" @mousedown="onMousedown" @@ -116,7 +116,6 @@ export default Vue.extend({ font-size 16px line-height 24px border none - border-radius 6px outline none box-shadow none text-decoration none @@ -124,6 +123,9 @@ export default Vue.extend({ color var(--text) background var(--buttonBg) + &.round + border-radius 6px + &:not(:disabled):hover background var(--buttonHoverBg) @@ -157,7 +159,9 @@ export default Vue.extend({ bottom -5px left -5px border 2px solid var(--primaryAlpha03) - border-radius 10px + + &.round:focus:after + border-radius 10px &:not(.inline) + .dmtdnykelhudezerjlfpbhgovrgnqqgr margin-top 16px @@ -197,7 +201,6 @@ export default Vue.extend({ left 0 width 100% height 100% - border-radius 6px overflow hidden >>> div @@ -210,6 +213,9 @@ export default Vue.extend({ transform scale(1) transition all 0.5s cubic-bezier(0, .5, .5, 1) + &.round > .ripples + border-radius 6px + &.primary > .ripples >>> div background rgba(0, 0, 0, 0.15) diff --git a/src/client/app/common/views/components/ui/input.vue b/src/client/app/common/views/components/ui/input.vue index 645062df28..a841ecca11 100644 --- a/src/client/app/common/views/components/ui/input.vue +++ b/src/client/app/common/views/components/ui/input.vue @@ -184,7 +184,11 @@ export default Vue.extend({ this.v = v; }, v(v) { - this.$emit('input', v); + if (this.type === 'number') { + this.$emit('input', parseInt(v, 10)); + } else { + this.$emit('input', v); + } if (this.withPasswordMeter) { if (v == '') { diff --git a/src/client/app/common/views/pages/page/page.switch.vue b/src/client/app/common/views/pages/page/page.switch.vue index 715a2fee6e..962ab84bb5 100644 --- a/src/client/app/common/views/pages/page/page.switch.vue +++ b/src/client/app/common/views/pages/page/page.switch.vue @@ -1,5 +1,5 @@ <template> -<div> +<div class="hkcxmtwj"> <ui-switch v-model="v">{{ value.text }}</ui-switch> </div> </template> @@ -31,3 +31,9 @@ export default Vue.extend({ } }); </script> + +<style lang="stylus" scoped> +.hkcxmtwj + display inline-block + margin 16px auto +</style> |