Compare commits

..

25 Commits

Author SHA1 Message Date
475cd49d16 wup 2022-01-28 03:19:12 +09:00
7cd8f2f1c7 wip 2022-01-28 03:12:00 +09:00
da6951fab5 wip 2022-01-28 03:03:13 +09:00
8c7263e166 wip 2022-01-28 02:56:27 +09:00
aa2b3cf4db wup 2022-01-28 02:56:08 +09:00
ef8037d94f wip 2022-01-28 02:40:17 +09:00
02923029b1 wup 2022-01-28 02:37:56 +09:00
5a27a18fef wip 2022-01-28 02:34:44 +09:00
2ced35512b wip 2022-01-28 02:14:24 +09:00
fcec47fe13 wip 2022-01-28 00:37:22 +09:00
67668849d6 wip 2022-01-28 00:34:40 +09:00
487555c42f wip 2022-01-28 00:22:52 +09:00
5a8c4f3ad3 wip 2022-01-28 00:08:55 +09:00
f88592f72b wip 2022-01-27 23:44:09 +09:00
9fb25cd860 wip 2022-01-27 23:39:32 +09:00
7249b11f70 動けっ! 2022-01-27 23:22:14 +09:00
d793ce8152 絶対動かない 2022-01-27 22:50:23 +09:00
40fd9d7aaf add package ffmpeg 2022-01-27 16:25:23 +09:00
1babd0ca25 wip 2022-01-27 16:01:03 +09:00
11fbde947c wip 2022-01-27 15:59:38 +09:00
fcd035055e wip 2022-01-27 15:56:54 +09:00
fd5b9aa5d0 change menu 2022-01-27 15:53:54 +09:00
90158790e6 change massage 2022-01-27 15:47:01 +09:00
dcc7ba77b9 add i18n 2022-01-27 15:24:20 +09:00
a2e8aac5ca add video button to post form 2022-01-27 15:20:46 +09:00
13 changed files with 206 additions and 18 deletions

View File

@ -7,16 +7,8 @@
-->
## 12.102.1 (2022/01/27)
### Bugfixes
- チャットが表示できない問題を修正
## 12.102.0 (2022/01/27)
### NOTE
アップデート後、一部カスタム絵文字が表示できなくなる場合があります。その場合、一旦絵文字管理ページから絵文字を一括エクスポートし、再度コントロールパネルから一括インポートすると直ります。
⚠ 12.102.0以前にエクスポートされたzipとは互換性がありません。アップデートしてからエクスポートを行なってください。
### Changes
- Room機能が削除されました
- 後日別リポジトリとして復活予定です

View File

@ -220,6 +220,7 @@ currentPassword: "現在のパスワード"
newPassword: "新しいパスワード"
newPasswordRetype: "新しいパスワード(再入力)"
attachFile: "ファイルを添付"
attachVideoFile: "動画ファイルを添付"
more: "もっと!"
featured: "ハイライト"
usernameOrUserId: "ユーザー名かユーザーID"

View File

@ -221,6 +221,7 @@ currentPassword: "現在のパスワード"
newPassword: "新しいパスワード"
newPasswordRetype: "新しいパスワード(再入力)"
attachFile: "ファイルを添付"
attachVideoFile: "動画ファイルを添付"
more: "もっと!"
featured: "ハイライト"
usernameOrUserId: "ユーザー名かユーザーID"

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.102.1-simkey",
"version": "12.102.0-simkey",
"codename": "indigo",
"repository": {
"type": "git",

View File

@ -11,6 +11,8 @@
},
"dependencies": {
"@discordapp/twemoji": "13.1.0",
"@ffmpeg/core": "0.10.0",
"@ffmpeg/ffmpeg": "0.10.1",
"@syuilo/aiscript": "0.11.1",
"@types/dateformat": "3.0.1",
"@types/escape-regexp": "0.0.1",

View File

@ -25,7 +25,6 @@
</div>
</template>
<div class="buttons right">
<button v-tooltip="Reload" class="_button button" @click.stop="location.reload()"><i class="fas fa-redo"></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>

View File

@ -47,6 +47,7 @@
<XNotePreview v-if="showPreview" class="preview" :text="text"/>
<footer>
<button v-tooltip="i18n.locale.attachFile" class="_button" @click="chooseFileFrom"><i class="fas fa-photo-video"></i></button>
<button v-tooltip="i18n.locale.attachVideoFile" class="_button" @click="chooseFileFromEnc"><i class="far fa-file-video"></i></button>
<button v-tooltip="i18n.locale.poll" class="_button" :class="{ active: poll }" @click="togglePoll"><i class="fas fa-poll-h"></i></button>
<button v-tooltip="i18n.locale.useCw" class="_button" :class="{ active: useCw }" @click="useCw = !useCw"><i class="fas fa-eye-slash"></i></button>
<button v-tooltip="i18n.locale.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 { selectFilesEnc } from '@/scripts/select-file-enc';
import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
import { throttle } from 'throttle-debounce';
import MkInfo from '@/components/ui/info.vue';
@ -102,7 +104,7 @@ const props = withDefaults(defineProps<{
initialLocalOnly?: boolean;
initialVisibleUsers?: misskey.entities.User[];
initialNote?: misskey.entities.Note;
instant?: boolean;
share?: boolean;
fixed?: boolean;
autofocus?: boolean;
}>(), {
@ -349,6 +351,14 @@ function chooseFileFrom(ev) {
});
}
function chooseFileFromEnc(ev) {
selectFilesEnc(ev.currentTarget || ev.target, i18n.locale.attachVideoFile).then(files_ => {
for (const file of files_) {
files.push(file);
}
});
}
function detachFile(id) {
files = files.filter(x => x.id != id);
}
@ -641,7 +651,7 @@ onMounted(() => {
nextTick(() => {
// 書きかけの投稿を復元
if (!props.instant && !props.mention && !props.specified) {
if (!props.share && !props.mention && !props.specified) {
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
if (draft) {
text = draft.data.text;

View File

@ -182,7 +182,6 @@ function gravity() {
function iLoveMisskey() {
os.post({
initialText: 'I $[jelly ❤] #Misskey',
instant: true,
});
}

View File

@ -24,7 +24,7 @@
<script lang="ts">
import { defineComponent, defineAsyncComponent } from 'vue';
import insertTextAtCursor from 'insert-text-at-cursor';
import autosize from 'autosize';
import * as autosize from 'autosize';
import { formatTimeString } from '@/scripts/format-time-string';
import { selectFile } from '@/scripts/select-file';
import * as os from '@/os';
@ -76,8 +76,7 @@ export default defineComponent({
autosize(this.$refs.text);
// TODO: detach when unmount
// TODO
//new Autocomplete(this.$refs.text, this, { model: 'text' });
new Autocomplete(this.$refs.text, this, { model: 'text' });
// 書きかけの投稿を復元
const draft = JSON.parse(localStorage.getItem('message_drafts') || '{}')[this.draftKey];

View File

@ -11,7 +11,7 @@
<button v-show="existMoreMessages" ref="loadMore" class="more _button" :class="{ fetching: fetchingMoreMessages }" :disabled="fetchingMoreMessages" @click="fetchMoreMessages">
<template v-if="fetchingMoreMessages"><i class="fas fa-spinner fa-pulse fa-fw"></i></template>{{ fetchingMoreMessages ? $ts.loading : $ts.loadMore }}
</button>
<XList v-if="messages.length > 0" v-slot="{ item: message }" class="messages" :items="messages" direction="up" reversed>
<XList v-slot="{ item: message }" class="messages" :items="messages" direction="up" reversed>
<XMessage :key="message.id" :message="message" :is-group="group != null"/>
</XList>
</div>

View File

@ -5,7 +5,7 @@
<XPostForm
v-if="state === 'writing'"
fixed
:instant="true"
:share="true"
:initial-text="initialText"
:initial-visibility="visibility"
:initial-files="files"

View File

@ -0,0 +1,155 @@
import * as os from '@/os';
import { stream } from '@/stream';
import { i18n } from '@/i18n';
import { defaultStore } from '@/store';
import { DriveFile } from 'misskey-js/built/entities';
import { fs } from 'fs';
import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
function select(src: any, label: string | null, multiple: boolean): Promise<DriveFile | DriveFile[]> {
return new Promise((res, rej) => {
const chooseFileFromPc = () => {
const input = document.createElement('input');
input.type = 'file';
input.onchange = () => {
const readFromBlobOrFile = (blob) => (
console.log('start readfrombloborfile'),
new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
resolve(reader.result);
};
reader.onerror = ({ target: { error: { code } } }) => {
reject(os.alert({ type: 'error', text: 'file could not be read! ' + code }));
};
reader.readAsArrayBuffer(blob);
}
));
const ffmpeg = createFFmpeg({ log: true });
async function ffmpegconv() {
os.toast('Start const ffmpegconv');
console.log('Start const ffmpegconv');
var infilename = Array.from(input.files[0].name);
let video = null;
var outfilename = infilename.replace(/\.[^/.]+$/, '') + '.mp4';
os.toast('Start await beffile');
//ここでストップ
console.log('Start await beffile');
const befFile = new Uint8Array(await readFromBlobOrFile(input.files[0]));
os.toast('Loading FFmpeg.wasm');
console.log('Loading FFmpeg.wasm');
if (!ffmpeg.isLoaded()) {
os.toast('Loading FFmpeg.wasm-core');
console.log('Loading FFmpeg.wasm-core');
await ffmpeg.load();
}
os.toast('Set ffmpeg files');
console.log('Set ffmpeg files');
ffmpeg.FS('writeFile', infilename, await fetchFile(befFile));
os.toast('Converting')
await ffmpeg.run('-i', `video.avi`, '-c:v', 'copy', '-c:a', 'copy', `video.mp4`);
os.toast('Converted')
const aftFile = ffmpeg.FS('readFile', outfilename);
os.toast('Uploading')
video.value = URL.createObjectURL(new Blob([aftFile.buffer], { type: 'video/mp4' }));
os.upload(video, defaultStore.state.uploadFolder).then(res).catch(e => { os.alert({ type: 'error', text: e }) });
};
//const promises = Array.from(input.files).map(file => os.upload(file, defaultStore.state.uploadFolder));
//Promise.all(promises).then(driveFiles => {
// res(multiple ? driveFiles : driveFiles[0]);
//}).catch(e => {
// os.alert({
// type: 'error',
// text: e
// });
//});
os.toast('Try use FFmpeg.wasm')
ffmpegconv();
// 一応廃棄
(window as any).__misskey_input_ref__ = null;
};
// https://qiita.com/fukasawah/items/b9dc732d95d99551013d
// iOS Safari で正常に動かす為のおまじない
(window as any).__misskey_input_ref__ = input;
input.click();
};
const chooseFileFromDrive = () => {
os.selectDriveFile(multiple).then(files => {
res(files);
});
};
const chooseFileFromUrl = () => {
os.inputText({
title: i18n.locale.uploadFromUrl,
type: 'url',
placeholder: i18n.locale.uploadFromUrlDescription
}).then(({ canceled, result: url }) => {
if (canceled) return;
const marker = Math.random().toString(); // TODO: UUIDとか使う
const connection = stream.useChannel('main');
connection.on('urlUploadFinished', data => {
if (data.marker === marker) {
res(multiple ? [data.file] : data.file);
connection.dispose();
}
});
os.api('drive/files/upload-from-url', {
url: url,
folderId: defaultStore.state.uploadFolder,
marker
});
os.alert({
title: i18n.locale.uploadFromUrlRequested,
text: i18n.locale.uploadFromUrlMayTakeTime
});
});
};
os.popupMenu([label ? {
text: label,
type: 'label'
} : undefined, {
text: i18n.locale.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[]>;
}

View File

@ -130,6 +130,21 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
"@ffmpeg/core@0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@ffmpeg/core/-/core-0.10.0.tgz#f6a58361b22d7c23c6f7071b9fff6d572bc3f499"
integrity sha512-qunWJl5PezpXEm31tb8Qu5z37B5KVA1VYZCpXchMhuAb3X9T7PuE3SlhOwphEoRhzaOa3lpofDfzihAUMFaVPQ==
"@ffmpeg/ffmpeg@0.10.1":
version "0.10.1"
resolved "https://registry.yarnpkg.com/@ffmpeg/ffmpeg/-/ffmpeg-0.10.1.tgz#3dacf3985de9c83a95fbf79fe709920cc009b00a"
integrity sha512-ChQkH7Rh57hmVo1LhfQFibWX/xqneolJKSwItwZdKPcLZuKigtYAYDIvB55pDfP17VtR1R77SxgkB2/UApB+Og==
dependencies:
is-url "^1.2.4"
node-fetch "^2.6.1"
regenerator-runtime "^0.13.7"
resolve-url "^0.2.1"
"@hapi/hoek@^9.0.0":
version "9.2.0"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131"
@ -3630,6 +3645,11 @@ is-unicode-supported@^0.1.0:
resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
is-url@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
is-weakref@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2"
@ -5165,6 +5185,11 @@ regenerator-runtime@^0.13.4:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55"
integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==
regenerator-runtime@^0.13.7:
version "0.13.9"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
regexpp@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
@ -5225,6 +5250,11 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
resolve-url@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.15.1, resolve@^1.20.0:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"