Merge branch 'develop'

This commit is contained in:
sim1222 2022-09-11 23:07:53 +09:00
commit f1ef1d83d8
5 changed files with 97 additions and 70 deletions

View File

@ -834,6 +834,7 @@ emojiSizeFixed: "文字サイズを固定する"
emojiStretch: "自動で伸縮しない" emojiStretch: "自動で伸縮しない"
emojiGenerate: "生成" emojiGenerate: "生成"
emojiColor: "カラーコード" emojiColor: "カラーコード"
colorPicker: "カラーピッカー"
emojiApproval: "絵文字を登録" emojiApproval: "絵文字を登録"
deckOld: "旧デッキ" deckOld: "旧デッキ"

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "12.119.0-simkey-v1", "version": "12.119.0-simkey-v2",
"codename": "indigo", "codename": "indigo",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -19,7 +19,7 @@
</div> </div>
<FormSection> <FormSection>
<div class="_formLinks"> <div class="_formLinks">
<FormLink to="https://github.com/misskey-dev/misskey" external> <FormLink to="https://github.com/sim1222/misskey" external>
<template #icon><i class="fas fa-code"></i></template> <template #icon><i class="fas fa-code"></i></template>
{{ i18n.ts._aboutMisskey.source }} {{ i18n.ts._aboutMisskey.source }}
<template #suffix>GitHub</template> <template #suffix>GitHub</template>

View File

@ -1,6 +1,14 @@
<template> <template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32"> <MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
<div class="cwepdizn _formRoot"> <div class="cwepdizn _formRoot">
<FormSection>
<template #label>{{ $ts.preview }}</template>
<p><img :src="previewUrl" class="img" :alt="emojiName" /></p>
</FormSection>
<FormButton primary class="_formBlock" @click="uploadEmoji">{{ $ts.emojiApproval }}</FormButton>
<!-- <FormButton primary class="_formBlock" @click="preview">{{ $ts.emojiGenerate }}</FormButton> -->
<FormSection>
<template #label>{{ $ts.settings }}</template>
<FormInput v-model="emojiName" class="_formBlock"> <FormInput v-model="emojiName" class="_formBlock">
<template #label>{{ $ts.emojiName }}</template> <template #label>{{ $ts.emojiName }}</template>
</FormInput> </FormInput>
@ -16,8 +24,9 @@
<option value="right"><i class="fas fa-align-right"/></option> <option value="right"><i class="fas fa-align-right"/></option>
</FormRadios> </FormRadios>
<FormSection> <FormFolder :default-open="false" class="_formBlock">
<template #label>{{ $ts.emojiSizeSetting }}</template> <template #label>{{ $ts.emojiSizeSetting }}</template>
<FormSection>
<FormSwitch v-model="emojiSizeFixed" class="_formBlock"> <FormSwitch v-model="emojiSizeFixed" class="_formBlock">
<template #label>{{ $ts.emojiSizeFixed }}</template> <template #label>{{ $ts.emojiSizeFixed }}</template>
</FormSwitch> </FormSwitch>
@ -26,9 +35,11 @@
<template #label>{{ $ts.emojiStretch }}</template> <template #label>{{ $ts.emojiStretch }}</template>
</FormSwitch> </FormSwitch>
</FormSection> </FormSection>
</FormFolder>
<FormFolder :default-open="false" class="_formBlock">
<template #label>{{ $ts._pages.font }}</template>
<FormRadios v-model="font" class="_formBlock"> <FormRadios v-model="font" class="_formBlock">
<template #label>{{ $ts.font }}</template>
<option value="notosans-mono-bold">Noto Sans Mono CJK JP Bold</option> <option value="notosans-mono-bold">Noto Sans Mono CJK JP Bold</option>
<option value="mplus-1p-black">M+ 1p black</option> <option value="mplus-1p-black">M+ 1p black</option>
<option value="rounded-x-mplus-1p-black">Rounded M+ 1p black</option> <option value="rounded-x-mplus-1p-black">Rounded M+ 1p black</option>
@ -36,9 +47,12 @@
<option value="aoyagireisyoshimo">青柳隷書しも</option> <option value="aoyagireisyoshimo">青柳隷書しも</option>
<option value="LinLibertine_RBah">LinLibertine Bold</option> <option value="LinLibertine_RBah">LinLibertine Bold</option>
</FormRadios> </FormRadios>
</FormFolder>
<FormSection>
<FormFolder :default-open="false" class="_formBlock">
<template #label>{{ $ts.emojiColor }}</template> <template #label>{{ $ts.emojiColor }}</template>
<FormSection>
<div class="cwepdizn-colors"> <div class="cwepdizn-colors">
<div class="row"> <div class="row">
<button v-for="color in accentColors" :key="color" class="color rounded _button" @click="setAccentColor(color)"> <button v-for="color in accentColors" :key="color" class="color rounded _button" @click="setAccentColor(color)">
@ -49,25 +63,20 @@
<FormInput v-model="emojiColor" class="_formBlock" :style="{ color: '#' + emojiColor }"> <FormInput v-model="emojiColor" class="_formBlock" :style="{ color: '#' + emojiColor }">
<template #prefix><i class="fas fa-palette"></i></template> <template #prefix><i class="fas fa-palette"></i></template>
<template #label>{{ $ts.emojiColor }}</template> <template #label @click="colorPick()">{{ $ts.emojiColor }}</template>
<template #caption>#RRGGBB</template> <template #caption>#RRGGBB</template>
</FormInput> </FormInput>
<FormButton @click="colorPick()">{{ $ts.colorPicker }}</FormButton>
</FormSection> </FormSection>
</FormFolder>
<FormButton primary class="_formBlock" @click="preview">{{ $ts.emojiGenerate }}</FormButton>
<FormSection>
<template #label>{{ $ts.preview }}</template>
<p><img :src="previewUrl" class="img" :alt="emojiName"/></p>
</FormSection> </FormSection>
<FormButton primary class="_formBlock" @click="uploadEmoji">{{ $ts.emojiApproval }}</FormButton>
</div> </div>
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import { computed, defineAsyncComponent, ref } from 'vue'; import { computed, defineAsyncComponent, ref, watch } from 'vue';
import * as os from '@/os'; import * as os from '@/os';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { defaultStore } from '@/store'; import { defaultStore } from '@/store';
@ -78,6 +87,7 @@ import FormSwitch from '@/components/form/switch.vue';
import FormButton from '@/components/MkButton.vue'; import FormButton from '@/components/MkButton.vue';
import FormRadios from '@/components/form/radios.vue'; import FormRadios from '@/components/form/radios.vue';
import FormTextarea from '@/components/form/textarea.vue'; import FormTextarea from '@/components/form/textarea.vue';
import FormFolder from '@/components/form/folder.vue';
import { definePageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata } from '@/scripts/page-metadata';
const font = ref('rounded-x-mplus-1p-black'); const font = ref('rounded-x-mplus-1p-black');
@ -85,7 +95,7 @@ const text = ref('');
const emojiName = ref(''); const emojiName = ref('');
const emojiAlign = ref('center'); const emojiAlign = ref('center');
const emojiSizeFixed = ref(false); const emojiSizeFixed = ref(false);
const emojiStretch = ref(true); const emojiStretch = ref(false);
const emojiColor = ref('90ee90'); const emojiColor = ref('90ee90');
const previewUrl = ref(''); const previewUrl = ref('');
const accentColors = [ const accentColors = [
@ -102,6 +112,21 @@ const accentColors = [
'#8080ff', '#8080ff',
]; ];
watch([font, text, emojiAlign, emojiSizeFixed, emojiStretch, emojiColor], () => {
preview();
});
const colorPick = (): void => {
const input = document.createElement('input') as HTMLInputElement;
input.type = 'color';
input.value = `#${emojiColor.value}`;
input.addEventListener('input', () => {
emojiColor.value = input.value.replace('#', '');
});
(window as any).__misskey_input_ref__ = input;
input.click();
};
const makeUrl = (): string => { const makeUrl = (): string => {
const API_URL = 'https://emoji-gen.ninja/emoji'; const API_URL = 'https://emoji-gen.ninja/emoji';

View File

@ -24,6 +24,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { defineAsyncComponent, inject, nextTick, onMounted, onUnmounted, provide, watch } from 'vue'; import { defineAsyncComponent, inject, nextTick, onMounted, onUnmounted, provide, watch } from 'vue';
import { $i } from '../../account';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import MkSuperMenu from '@/components/MkSuperMenu.vue'; import MkSuperMenu from '@/components/MkSuperMenu.vue';
import MkInfo from '@/components/MkInfo.vue'; import MkInfo from '@/components/MkInfo.vue';
@ -139,52 +140,52 @@ const menuDef = $computed(() => [{
}], }],
}, { }, {
title: i18n.ts.settings, title: i18n.ts.settings,
items: [{ items: [ ...($i?.isAdmin ? [{
icon: 'fas fa-cog', icon: 'fas fa-cog',
text: i18n.ts.general, text: i18n.ts.general,
to: '/admin/settings', to: '/admin/settings',
active: currentPage?.route.name === 'settings', active: currentPage?.route.name === 'settings',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-envelope', icon: 'fas fa-envelope',
text: i18n.ts.emailServer, text: i18n.ts.emailServer,
to: '/admin/email-settings', to: '/admin/email-settings',
active: currentPage?.route.name === 'email-settings', active: currentPage?.route.name === 'email-settings',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-cloud', icon: 'fas fa-cloud',
text: i18n.ts.objectStorage, text: i18n.ts.objectStorage,
to: '/admin/object-storage', to: '/admin/object-storage',
active: currentPage?.route.name === 'object-storage', active: currentPage?.route.name === 'object-storage',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-lock', icon: 'fas fa-lock',
text: i18n.ts.security, text: i18n.ts.security,
to: '/admin/security', to: '/admin/security',
active: currentPage?.route.name === 'security', active: currentPage?.route.name === 'security',
}, { }] : []), {
icon: 'fas fa-globe', icon: 'fas fa-globe',
text: i18n.ts.relays, text: i18n.ts.relays,
to: '/admin/relays', to: '/admin/relays',
active: currentPage?.route.name === 'relays', active: currentPage?.route.name === 'relays',
}, { }, ...($i?.isAdmin ? [{
icon: 'fas fa-share-alt', icon: 'fas fa-share-alt',
text: i18n.ts.integration, text: i18n.ts.integration,
to: '/admin/integrations', to: '/admin/integrations',
active: currentPage?.route.name === 'integrations', active: currentPage?.route.name === 'integrations',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-ban', icon: 'fas fa-ban',
text: i18n.ts.instanceBlocking, text: i18n.ts.instanceBlocking,
to: '/admin/instance-block', to: '/admin/instance-block',
active: currentPage?.route.name === 'instance-block', active: currentPage?.route.name === 'instance-block',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-ghost', icon: 'fas fa-ghost',
text: i18n.ts.proxyAccount, text: i18n.ts.proxyAccount,
to: '/admin/proxy-account', to: '/admin/proxy-account',
active: currentPage?.route.name === 'proxy-account', active: currentPage?.route.name === 'proxy-account',
}, { }] : []), ...($i?.isAdmin ? [{
icon: 'fas fa-cogs', icon: 'fas fa-cogs',
text: i18n.ts.other, text: i18n.ts.other,
to: '/admin/other-settings', to: '/admin/other-settings',
active: currentPage?.route.name === 'other-settings', active: currentPage?.route.name === 'other-settings',
}], }] : [])],
}, { }, {
title: i18n.ts.info, title: i18n.ts.info,
items: [{ items: [{