Compare commits
81 Commits
pr/ytplaye
...
sim-dev-fe
Author | SHA1 | Date | |
---|---|---|---|
490636f6c6 | |||
ef4f49778e | |||
721c47a74b | |||
11cbbeb795 | |||
6bc893ca44 | |||
9c34f96cdd | |||
74a80b3405 | |||
84da9d4cd4 | |||
b48f76aad1 | |||
78b9550eca | |||
8fc770d371 | |||
4aed68ec96 | |||
90c89c3083 | |||
c63d7dc898 | |||
74e695a320 | |||
f269ceaee9 | |||
57a106a192 | |||
5563d6bdeb | |||
ab59a5b659 | |||
a81f8b8275 | |||
c99c4b73f4 | |||
995d8f2f5d | |||
6bb22007d8 | |||
a4a0d33348 | |||
7d1f3cd1e8 | |||
dc13627a68 | |||
b96e886a61 | |||
7024f6651f | |||
4f9aca0aa3 | |||
88a2606884 | |||
d6b15add1b | |||
39307694b5 | |||
9b7be06eef | |||
5afb3a59cd | |||
73d66fc439 | |||
12214c473a | |||
8e173a6d8e | |||
9d0c1a8fea | |||
aee5193ef6 | |||
2892a31142 | |||
90bb0cec37 | |||
19775507fc | |||
9d4f621833 | |||
2e095b4863 | |||
5d9b9eeaad | |||
98f5cb6cd2 | |||
b88c4d6d34 | |||
6238ba965b | |||
8489c3ca7b | |||
33871f3cb8 | |||
5eb758fa28 | |||
56d8f7f257 | |||
74c3e6d483 | |||
ead62a538f | |||
72058b30c2 | |||
22102639a8 | |||
ee4289076f | |||
be011d3985 | |||
6ef86df368 | |||
34e099984f | |||
5a1c6be944 | |||
25991cfdc1 | |||
b1a526aeea | |||
f31ef70ce7 | |||
09a751b992 | |||
a41e4ed4fd | |||
b77f7f5041 | |||
7adcf99865 | |||
cc2d5480f3 | |||
fdd129fb83 | |||
8dd3fef0e2 | |||
f1c66f09e1 | |||
6f328f2ccf | |||
70b3d598c6 | |||
668c403ece | |||
c873f17080 | |||
3f6691bd5e | |||
260ece9881 | |||
9a4c04fe79 | |||
24896d4a36 | |||
8aea52e9b4 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -42,3 +42,6 @@ ormconfig.json
|
||||
*.blend3
|
||||
*.blend4
|
||||
*.blend5
|
||||
|
||||
start.sh
|
||||
dev.sh
|
||||
|
@ -24,6 +24,7 @@ const languages = [
|
||||
'fr-FR',
|
||||
'id-ID',
|
||||
'it-IT',
|
||||
'ja-NY',
|
||||
'ja-JP',
|
||||
'ja-KS',
|
||||
'kab-KAB',
|
||||
@ -57,6 +58,7 @@ module.exports = Object.entries(locales)
|
||||
const [lang] = k.split('-');
|
||||
switch (k) {
|
||||
case 'ja-JP': return v;
|
||||
case 'ja-NY':
|
||||
case 'ja-KS':
|
||||
case 'en-US': return merge(locales['ja-JP'], v);
|
||||
default: return merge(
|
||||
|
@ -222,6 +222,7 @@ currentPassword: "現在のパスワード"
|
||||
newPassword: "新しいパスワード"
|
||||
newPasswordRetype: "新しいパスワード(再入力)"
|
||||
attachFile: "ファイルを添付"
|
||||
attachVideoFile: "MOVファイルを添付"
|
||||
more: "もっと!"
|
||||
featured: "ハイライト"
|
||||
usernameOrUserId: "ユーザー名かユーザーID"
|
||||
|
1793
locales/ja-NY.yml
Normal file
1793
locales/ja-NY.yml
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "12.108.1",
|
||||
"version": "12.108.1-simkey",
|
||||
"codename": "indigo",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/misskey-dev/misskey.git"
|
||||
"url": "https://github.com/sim1222/misskey.git"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -4,7 +4,7 @@
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#313a42",
|
||||
"theme_color": "#86b300",
|
||||
"theme_color": "#a7dc4e",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static-assets/icons/192.png",
|
||||
|
@ -1,39 +1,78 @@
|
||||
<template>
|
||||
<div ref="el" class="fdidabkb" :class="{ slim: narrow, thin: thin_ }" :style="{ background: bg }" @click="onClick">
|
||||
<template v-if="info">
|
||||
<div v-if="!hideTitle" class="titleContainer" @click="showTabsPopup">
|
||||
<MkAvatar v-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true" :show-indicator="true"/>
|
||||
<i v-else-if="info.icon" class="icon" :class="info.icon"></i>
|
||||
<div
|
||||
ref="el"
|
||||
class="fdidabkb"
|
||||
:class="{ slim: narrow, thin: thin_ }"
|
||||
:style="{ background: bg }"
|
||||
@click="onClick"
|
||||
>
|
||||
<template v-if="info">
|
||||
<div v-if="!hideTitle" class="titleContainer" @click="showTabsPopup">
|
||||
<MkAvatar
|
||||
v-if="info.avatar"
|
||||
class="avatar"
|
||||
:user="info.avatar"
|
||||
:disable-preview="true"
|
||||
:show-indicator="true"
|
||||
/>
|
||||
<i v-else-if="info.icon" class="icon" :class="info.icon"></i>
|
||||
|
||||
<div class="title">
|
||||
<MkUserName v-if="info.userName" :user="info.userName" :nowrap="true" class="title"/>
|
||||
<div v-else-if="info.title" class="title">{{ info.title }}</div>
|
||||
<div v-if="!narrow && info.subtitle" class="subtitle">
|
||||
{{ info.subtitle }}
|
||||
</div>
|
||||
<div v-if="narrow && hasTabs" class="subtitle activeTab">
|
||||
{{ info.tabs.find(tab => tab.active)?.title }}
|
||||
<i class="chevron fas fa-chevron-down"></i>
|
||||
<div class="title">
|
||||
<MkUserName v-if="info.userName" :user="info.userName" :nowrap="true" class="title" />
|
||||
<div v-else-if="info.title" class="title">{{ info.title }}</div>
|
||||
<div v-if="!narrow && info.subtitle" class="subtitle">{{ info.subtitle }}</div>
|
||||
<div v-if="narrow && hasTabs" class="subtitle activeTab">
|
||||
{{ info.tabs.find(tab => tab.active)?.title }}
|
||||
<i class="chevron fas fa-chevron-down"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!narrow || hideTitle" class="tabs">
|
||||
<button v-for="tab in info.tabs" v-tooltip="tab.title" class="tab _button" :class="{ active: tab.active }" @click="tab.onClick">
|
||||
<i v-if="tab.icon" class="icon" :class="tab.icon"></i>
|
||||
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
|
||||
<div v-if="!narrow || hideTitle" class="tabs">
|
||||
<button
|
||||
v-for="tab in info.tabs"
|
||||
v-tooltip="tab.title"
|
||||
class="tab _button"
|
||||
:class="{ active: tab.active }"
|
||||
@click="tab.onClick"
|
||||
>
|
||||
<i v-if="tab.icon" class="icon" :class="tab.icon"></i>
|
||||
<span v-if="!tab.iconOnly" class="title">{{ tab.title }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="buttons right">
|
||||
<button class="_button button" onclick="location.reload();">
|
||||
<i class="fa-solid fa-arrow-rotate-right"></i>
|
||||
</button>
|
||||
<template v-if="info && info.actions && !narrow">
|
||||
<template v-for="action in info.actions">
|
||||
<MkButton v-if="action.asFullButton" class="fullButton" primary @click.stop="action.handler">
|
||||
<i :class="action.icon" style="margin-right: 6px;"></i>
|
||||
{{ action.text }}
|
||||
</MkButton>
|
||||
<button
|
||||
v-else
|
||||
v-tooltip="action.text"
|
||||
class="_button button"
|
||||
:class="{ highlighted: action.highlighted }"
|
||||
@click.stop="action.handler"
|
||||
@touchstart="preventDrag"
|
||||
>
|
||||
<i :class="action.icon"></i>
|
||||
</button>
|
||||
</template>
|
||||
</template>
|
||||
<button
|
||||
v-if="shouldShowMenu"
|
||||
v-tooltip="$ts.menu"
|
||||
class="_button button"
|
||||
@click.stop="showMenu"
|
||||
@touchstart="preventDrag"
|
||||
>
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="buttons right">
|
||||
<template v-if="info && info.actions && !narrow">
|
||||
<template v-for="action in info.actions">
|
||||
<MkButton v-if="action.asFullButton" class="fullButton" primary @click.stop="action.handler"><i :class="action.icon" style="margin-right: 6px;"></i>{{ action.text }}</MkButton>
|
||||
<button v-else v-tooltip="action.text" class="_button button" :class="{ highlighted: action.highlighted }" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
|
||||
</template>
|
||||
</template>
|
||||
<button v-if="shouldShowMenu" v-tooltip="$ts.menu" class="_button button" @click.stop="showMenu" @touchstart="preventDrag"><i class="fas fa-ellipsis-h"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@ -150,7 +189,7 @@ export default defineComponent({
|
||||
onUnmounted(() => {
|
||||
globalEvents.off('themeChanged', calcBg);
|
||||
});
|
||||
|
||||
|
||||
if (el.value.parentElement) {
|
||||
narrow.value = el.value.parentElement.offsetWidth < 500;
|
||||
const ro = new ResizeObserver((entries, observer) => {
|
||||
@ -227,7 +266,7 @@ export default defineComponent({
|
||||
> .buttons {
|
||||
--margin: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: center;
|
||||
height: var(--height);
|
||||
margin: 0 var(--margin);
|
||||
|
||||
|
@ -47,6 +47,7 @@
|
||||
<XNotePreview v-if="showPreview" class="preview" :text="text"/>
|
||||
<footer>
|
||||
<button v-tooltip="i18n.ts.attachFile" class="_button" @click="chooseFileFrom"><i class="fas fa-photo-video"></i></button>
|
||||
<button v-tooltip="i18n.ts.attachVideoFile" class="_button" @click="chooseFileFromEnc"><i class="far fa-file-video"></i></button>
|
||||
<button v-tooltip="i18n.ts.poll" class="_button" :class="{ active: poll }" @click="togglePoll"><i class="fas fa-poll-h"></i></button>
|
||||
<button v-tooltip="i18n.ts.useCw" class="_button" :class="{ active: useCw }" @click="useCw = !useCw"><i class="fas fa-eye-slash"></i></button>
|
||||
<button v-tooltip="i18n.ts.mention" class="_button" @click="insertMention"><i class="fas fa-at"></i></button>
|
||||
@ -81,6 +82,7 @@ import { Autocomplete } from '@/scripts/autocomplete';
|
||||
import * as os from '@/os';
|
||||
import { stream } from '@/stream';
|
||||
import { selectFiles } from '@/scripts/select-file';
|
||||
import {selectFileEnc, selectFilesEnc} from '@/scripts/select-file-enc';
|
||||
import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
|
||||
import { throttle } from 'throttle-debounce';
|
||||
import MkInfo from '@/components/ui/info.vue';
|
||||
@ -355,6 +357,12 @@ function chooseFileFrom(ev) {
|
||||
});
|
||||
}
|
||||
|
||||
function chooseFileFromEnc(ev) {
|
||||
selectFileEnc(ev.currentTarget ?? ev.target, i18n.ts.attachVideoFile).then(files_ => {
|
||||
files.push(files_);
|
||||
});
|
||||
}
|
||||
|
||||
function detachFile(id) {
|
||||
files = files.filter(x => x.id != id);
|
||||
}
|
||||
|
163
packages/client/src/scripts/select-file-enc.ts
Normal file
163
packages/client/src/scripts/select-file-enc.ts
Normal file
@ -0,0 +1,163 @@
|
||||
import { ref } from 'vue';
|
||||
import * as os from '@/os';
|
||||
import { stream } from '@/stream';
|
||||
import { i18n } from '@/i18n';
|
||||
import { defaultStore } from '@/store';
|
||||
import { DriveFile } from 'misskey-js/built/entities';
|
||||
|
||||
function select(src: any, label: string | null, multiple: boolean): Promise<DriveFile | DriveFile[]> {
|
||||
return new Promise((res, rej) => {
|
||||
const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
|
||||
|
||||
const chooseFileFromPc = () => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.multiple = multiple;
|
||||
input.onchange = () => {
|
||||
|
||||
//ここから
|
||||
// @ts-ignore
|
||||
function VideoConverter (videoFileData, targetFormat) {
|
||||
try {
|
||||
targetFormat = targetFormat.toLowerCase();
|
||||
let reader = new FileReader();
|
||||
return new Promise(resolve => {
|
||||
reader.onload = function (event) {
|
||||
let contentType = 'video/'+targetFormat;
|
||||
|
||||
// @ts-ignore
|
||||
let fileData: ArrayBuffer = event.target.result.split(',');
|
||||
let b64Data = fileData[1];
|
||||
let blob = getBlobFromBase64Data(b64Data, contentType);
|
||||
let blobUrl = URL.createObjectURL(blob);
|
||||
|
||||
let convertedVideo: any = {
|
||||
name: videoFileData.name.substring(0, videoFileData.name.lastIndexOf(".")),
|
||||
format: targetFormat,
|
||||
data: blob
|
||||
}
|
||||
// console.log("convertedVideo: ", convertedVideo);
|
||||
resolve(convertedVideo);
|
||||
}
|
||||
reader.readAsDataURL(videoFileData);
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
console.log("Error occurred while converting : ", e);
|
||||
}
|
||||
}
|
||||
|
||||
function getBlobFromBase64Data(b64Data, contentType, sliceSize=512) {
|
||||
const byteCharacters = atob(b64Data);
|
||||
const byteArrays = [];
|
||||
|
||||
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||
|
||||
const byteNumbers = new Array(slice.length);
|
||||
for (let i = 0; i < slice.length; i++) {
|
||||
byteNumbers[i] = slice.charCodeAt(i);
|
||||
}
|
||||
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
// @ts-ignore
|
||||
byteArrays.push(byteArray);
|
||||
}
|
||||
|
||||
const blob = new Blob(byteArrays, {type: contentType});
|
||||
return blob;
|
||||
}
|
||||
|
||||
//ここまで
|
||||
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Suvro Debnath
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
Array.from(input.files).map(async file => {
|
||||
if (file.type.indexOf('video/mp4') == -1) {
|
||||
os.toast('It is mp4 file');
|
||||
os.upload(file, defaultStore.state.uploadFolder).then(driveFiles => {
|
||||
res(driveFiles);
|
||||
}).catch(e => {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: e
|
||||
});
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
console.log('convert video');
|
||||
os.toast('Try convert to mp4');
|
||||
//convertVideo(file);
|
||||
let sourceVideoFile = file;
|
||||
let targetVideoFormat = 'mp4'
|
||||
console.log('start convert video');
|
||||
let convertedVideoDataObj = await VideoConverter(sourceVideoFile, targetVideoFormat);
|
||||
console.log('end convert video');
|
||||
|
||||
// @ts-ignore
|
||||
let convertedVideoFile = new File([convertedVideoDataObj.data], convertedVideoDataObj.name + "." + convertedVideoDataObj.format);
|
||||
|
||||
os.upload(convertedVideoFile, defaultStore.state.uploadFolder).then(driveFiles => {
|
||||
res(driveFiles);
|
||||
}).catch(e => {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: e
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// 一応廃棄
|
||||
(window as any).__misskey_input_ref__ = null;
|
||||
};
|
||||
|
||||
// https://qiita.com/fukasawah/items/b9dc732d95d99551013d
|
||||
// iOS Safari で正常に動かす為のおまじない
|
||||
(window as any).__misskey_input_ref__ = input;
|
||||
|
||||
input.click();
|
||||
};
|
||||
|
||||
os.popupMenu([label ? {
|
||||
text: label,
|
||||
type: 'label'
|
||||
} : undefined, {
|
||||
text: i18n.ts.upload,
|
||||
icon: 'fas fa-upload',
|
||||
action: chooseFileFromPc
|
||||
}], src);
|
||||
});
|
||||
}
|
||||
|
||||
export function selectFileEnc(src: any, label: string | null = null): Promise<DriveFile> {
|
||||
return select(src, label, false) as Promise<DriveFile>;
|
||||
}
|
||||
|
||||
export function selectFilesEnc(src: any, label: string | null = null): Promise<DriveFile[]> {
|
||||
return select(src, label, true) as Promise<DriveFile[]>;
|
||||
}
|
@ -5,6 +5,7 @@ import { i18n } from '@/i18n';
|
||||
import { defaultStore } from '@/store';
|
||||
import { DriveFile } from 'misskey-js/built/entities';
|
||||
|
||||
|
||||
function select(src: any, label: string | null, multiple: boolean): Promise<DriveFile | DriveFile[]> {
|
||||
return new Promise((res, rej) => {
|
||||
const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
|
||||
|
Reference in New Issue
Block a user