diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-24 13:20:30 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-24 13:20:30 +0900 |
| commit | e967d9ded35cbdf937bbc232e05a5fa0966458a7 (patch) | |
| tree | f1fd95de0378a07565f4fe00192fdc8414d7d985 /src/client | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.89.1 (diff) | |
| download | misskey-e967d9ded35cbdf937bbc232e05a5fa0966458a7.tar.gz misskey-e967d9ded35cbdf937bbc232e05a5fa0966458a7.tar.bz2 misskey-e967d9ded35cbdf937bbc232e05a5fa0966458a7.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/components/signup.vue | 10 | ||||
| -rw-r--r-- | src/client/directives/tooltip.ts | 14 | ||||
| -rw-r--r-- | src/client/init.ts | 5 | ||||
| -rw-r--r-- | src/client/os.ts | 6 | ||||
| -rw-r--r-- | src/client/pages/about-misskey.vue | 2 | ||||
| -rw-r--r-- | src/client/pages/instance/other-settings.vue | 6 | ||||
| -rw-r--r-- | src/client/style.scss | 7 |
7 files changed, 38 insertions, 12 deletions
diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index b0b0c2ad4d..d584b97209 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -1,12 +1,12 @@ <template> -<form class="mk-signup" @submit.prevent="onSubmit" :autocomplete="Math.random()"> +<form class="qlvuhzng" @submit.prevent="onSubmit" :autocomplete="Math.random()"> <template v-if="meta"> - <MkInput v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required> + <MkInput class="_inputNoTopMargin" v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required> <template #label>{{ $ts.invitationCode }}</template> <template #prefix><i class="fas fa-key"></i></template> </MkInput> - <MkInput v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @update:modelValue="onChangeUsername" data-cy-signup-username> - <template #label>{{ $ts.username }}</template> + <MkInput class="_inputNoTopMargin" v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @update:modelValue="onChangeUsername" data-cy-signup-username> + <template #label>{{ $ts.username }} <div class="_button _help" v-tooltip:dialog="$ts.usernameInfo"><i class="far fa-question-circle"></i></div></template> <template #prefix>@</template> <template #suffix>@{{ host }}</template> <template #caption> @@ -204,7 +204,7 @@ export default defineComponent({ </script> <style lang="scss" scoped> -.mk-signup { +.qlvuhzng { .captcha { margin: 16px 0; } diff --git a/src/client/directives/tooltip.ts b/src/client/directives/tooltip.ts index 90247eacb2..ee690558af 100644 --- a/src/client/directives/tooltip.ts +++ b/src/client/directives/tooltip.ts @@ -1,6 +1,6 @@ import { Directive, ref } from 'vue'; import { isDeviceTouch } from '@client/scripts/is-device-touch'; -import { popup } from '@client/os'; +import { popup, dialog } from '@client/os'; const start = isDeviceTouch ? 'touchstart' : 'mouseover'; const end = isDeviceTouch ? 'touchend' : 'mouseleave'; @@ -24,6 +24,18 @@ export default { } }; + if (binding.arg === 'dialog') { + el.addEventListener('click', (ev) => { + ev.preventDefault(); + ev.stopPropagation(); + dialog({ + type: 'info', + text: binding.value, + }); + return false; + }); + } + const show = e => { if (!document.body.contains(el)) return; if (self._close) return; diff --git a/src/client/init.ts b/src/client/init.ts index 194ece886b..4d2170e03f 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -101,15 +101,12 @@ window.addEventListener('resize', () => { }); //#endregion -// Get the <head> element -const head = document.getElementsByTagName('head')[0]; - // If mobile, insert the viewport meta tag if (isMobile || window.innerWidth <= 1024) { const viewport = document.getElementsByName('viewport').item(0); viewport.setAttribute('content', `${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`); - head.appendChild(viewport); + document.head.appendChild(viewport); } //#region Set lang attr diff --git a/src/client/os.ts b/src/client/os.ts index 284f982f06..8125332798 100644 --- a/src/client/os.ts +++ b/src/client/os.ts @@ -214,7 +214,11 @@ export function modalPageWindow(path: string) { }, {}, 'closed'); } -export function dialog(props: Record<string, any>) { +export function dialog(props: { + type: 'error' | 'info' | 'success' | 'warning' | 'waiting'; + title?: string | null; + text?: string | null; +}) { return new Promise((resolve, reject) => { popup(import('@client/components/dialog.vue'), props, { done: result => { diff --git a/src/client/pages/about-misskey.vue b/src/client/pages/about-misskey.vue index a324ebce5c..384c7e8ccb 100644 --- a/src/client/pages/about-misskey.vue +++ b/src/client/pages/about-misskey.vue @@ -60,7 +60,7 @@ import FormBase from '@client/components/form/base.vue'; import FormGroup from '@client/components/form/group.vue'; import FormKeyValueView from '@client/components/form/key-value-view.vue'; import MkLink from '@client/components/link.vue'; -import { physics } from '@client/scripts/physics.ts'; +import { physics } from '@client/scripts/physics'; import * as symbols from '@client/symbols'; const patrons = [ diff --git a/src/client/pages/instance/other-settings.vue b/src/client/pages/instance/other-settings.vue index 8002528931..4fa80b2b2c 100644 --- a/src/client/pages/instance/other-settings.vue +++ b/src/client/pages/instance/other-settings.vue @@ -12,6 +12,9 @@ <template #prefix><i class="fas fa-key"></i></template> DeepL Auth Key </FormInput> + <FormSwitch v-model:value="deeplIsPro"> + Pro account + </FormSwitch> </FormGroup> <FormButton @click="save" primary><i class="fas fa-save"></i> {{ $ts.save }}</FormButton> </FormSuspense> @@ -50,6 +53,7 @@ export default defineComponent({ }, summalyProxy: '', deeplAuthKey: '', + deeplIsPro: false, } }, @@ -62,11 +66,13 @@ export default defineComponent({ const meta = await os.api('meta', { detail: true }); this.summalyProxy = meta.summalyProxy; this.deeplAuthKey = meta.deeplAuthKey; + this.deeplIsPro = meta.deeplIsPro; }, save() { os.apiWithDialog('admin/update-meta', { summalyProxy: this.summalyProxy, deeplAuthKey: this.deeplAuthKey, + deeplIsPro: this.deeplIsPro, }).then(() => { fetchInstance(); }); diff --git a/src/client/style.scss b/src/client/style.scss index a6c027745a..269cf88939 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -156,8 +156,10 @@ hr { ._button { appearance: none; + display: inline-block; padding: 0; margin: 0; // for Safari + width: max-content; background: none; border: none; cursor: pointer; @@ -201,6 +203,11 @@ hr { } } +._help { + color: var(--accent); + cursor: help +} + ._textButton { @extend ._button; color: var(--accent); |