From 2af158be264974b28b04a36e911a175510d3f504 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 24 Aug 2021 13:52:33 +0200 Subject: add setting to keep content warning (#7682) --- src/client/pages/settings/privacy.vue | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/client') diff --git a/src/client/pages/settings/privacy.vue b/src/client/pages/settings/privacy.vue index 4095e744c2..46d8c17ca2 100644 --- a/src/client/pages/settings/privacy.vue +++ b/src/client/pages/settings/privacy.vue @@ -28,6 +28,7 @@ {{ $ts._visibility.localOnly }} + {{ $ts.keepCw }} @@ -69,6 +70,7 @@ export default defineComponent({ defaultNoteVisibility: defaultStore.makeGetterSetter('defaultNoteVisibility'), defaultNoteLocalOnly: defaultStore.makeGetterSetter('defaultNoteLocalOnly'), rememberNoteVisibility: defaultStore.makeGetterSetter('rememberNoteVisibility'), + keepCw: defaultStore.makeGetterSetter('keepCw'), }, created() { -- cgit v1.2.3-freya From 6490a9829bafac248b578c76b7b39b8b95a766a9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 29 Aug 2021 16:44:15 +0900 Subject: fix(client): fix button style --- CHANGELOG.md | 1 + src/client/style.scss | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client') diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d027c00c8..7674dcd042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### Bugfixes - CWを維持する設定を復活 +- クライアントの表示を修正 ## 12.89.2 (2021/08/24) diff --git a/src/client/style.scss b/src/client/style.scss index 269cf88939..6ab5e796bd 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -159,7 +159,6 @@ hr { display: inline-block; padding: 0; margin: 0; // for Safari - width: max-content; background: none; border: none; cursor: pointer; -- cgit v1.2.3-freya From 8407702b38ead9fab4aab6698b9e0be1457218a0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 4 Sep 2021 17:54:24 +0900 Subject: 藍モード (#7687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * wip * シンボリックリンクやめた * install lib dependency * bring live2d assets from misskey-dev/assets * refactor * nanka iroiro * コミット忘れ * random motion * wip * run git submodule update --init * コミット忘れ * refactor * fix bug * Update misskey-assets * lint * lint * lint * 藍モード修正 (#7702) * lazy load live2d script * fix typo * lazy load also widget * hot link to cubism core * https://github.com/misskey-dev/misskey/pull/7702/files#r695623821 * fix lint * remove live2d stuff * use iframe * update * Update gulpfile.ts * update * Update .gitattributes * update Co-authored-by: tamaina --- .github/workflows/nodejs.yml | 4 +++ .gitmodules | 3 ++ Dockerfile | 1 + docs/docker.en.md | 9 +++--- docs/docker.fr.md | 9 +++--- docs/docker.ja.md | 9 +++--- docs/docker.zh.md | 9 +++--- docs/setup.en.md | 11 ++++--- docs/setup.fr.md | 7 +++-- docs/setup.ja.md | 7 +++-- docs/setup.zh.md | 11 ++++--- locales/ja-JP.yml | 2 ++ misskey-assets | 1 + src/client/pages/settings/general.vue | 9 ++++++ src/client/store.ts | 4 +++ src/client/tsconfig.json | 3 +- src/client/ui/default.vue | 31 +++++++++++++++++- src/client/widgets/aichan.vue | 59 +++++++++++++++++++++++++++++++++++ src/client/widgets/index.ts | 2 ++ webpack.config.ts | 1 + 20 files changed, 158 insertions(+), 34 deletions(-) create mode 100644 .gitmodules create mode 160000 misskey-assets create mode 100644 src/client/widgets/aichan.vue (limited to 'src/client') diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c6e5329c26..9a32dac94e 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -29,6 +29,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: true - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: @@ -48,6 +50,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: true - uses: actions/setup-node@v1 with: node-version: 12.x diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..9246e09b8b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "misskey-assets"] + path = misskey-assets + url = https://github.com/misskey-dev/assets.git diff --git a/Dockerfile b/Dockerfile index 1e8584551f..8c655c4c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN apk add --no-cache \ python3 \ zlib-dev +RUN git submodule update --init COPY package.json yarn.lock .yarnrc ./ RUN yarn install COPY . ./ diff --git a/docs/docker.en.md b/docs/docker.en.md index 93eee8e4b4..adeafe3d31 100644 --- a/docs/docker.en.md +++ b/docs/docker.en.md @@ -83,10 +83,11 @@ Just `docker-compose up -d`. GLHF! 1. `git stash` 2. `git checkout master` 3. `git pull` -4. `git stash pop` -5. `docker-compose build` -6. Check [ChangeLog](../CHANGELOG.md) for migration information -7. `docker-compose stop && docker-compose up -d` +4. `git submodule update --init` +5. `git stash pop` +6. `docker-compose build` +7. Check [ChangeLog](../CHANGELOG.md) for migration information +8. `docker-compose stop && docker-compose up -d` ### How to execute [cli commands](manage.en.md): `docker-compose run --rm web node built/tools/mark-admin @example` diff --git a/docs/docker.fr.md b/docs/docker.fr.md index 7abd46335f..840e5b5a28 100644 --- a/docs/docker.fr.md +++ b/docs/docker.fr.md @@ -50,10 +50,11 @@ Utilisez la commande `docker-compose up -d`. GLHF! 1. `git stash` 2. `git checkout master` 3. `git pull` -4. `git stash pop` -5. `docker-compose build` -6. Consultez le [ChangeLog](../CHANGELOG.md) pour avoir les éventuelles informations de migration -7. `docker-compose stop && docker-compose up -d` +4. `git submodule update --init` +5. `git stash pop` +6. `docker-compose build` +7. Consultez le [ChangeLog](../CHANGELOG.md) pour avoir les éventuelles informations de migration +8. `docker-compose stop && docker-compose up -d` ### Comment exécuter des [commandes](manage.fr.md) `docker-compose run --rm web node built/tools/mark-admin @example` diff --git a/docs/docker.ja.md b/docs/docker.ja.md index 15b1a944ac..c660a9041b 100644 --- a/docs/docker.ja.md +++ b/docs/docker.ja.md @@ -83,10 +83,11 @@ docker-compose run --rm web yarn run init 1. `git stash` 2. `git checkout master` 3. `git pull` -4. `git stash pop` -5. `docker-compose build` -6. [ChangeLog](../CHANGELOG.md)でマイグレーション情報を確認する -7. `docker-compose stop && docker-compose up -d` +4. `git submodule update --init` +5. `git stash pop` +6. `docker-compose build` +7. [ChangeLog](../CHANGELOG.md)でマイグレーション情報を確認する +8. `docker-compose stop && docker-compose up -d` ### cliコマンドを実行する方法: diff --git a/docs/docker.zh.md b/docs/docker.zh.md index a842fcb0cc..5a494ea11e 100644 --- a/docs/docker.zh.md +++ b/docs/docker.zh.md @@ -83,10 +83,11 @@ docker-compose run --rm web yarn run init 1. `git stash` 2. `git checkout master` 3. `git pull` -4. `git stash pop` -5. `docker-compose build` -6. 检查 [更新日志](../CHANGELOG.md) 以获取升级迁移信息。 -7. `docker-compose stop && docker-compose up -d` +4. `git submodule update --init` +5. `git stash pop` +6. `docker-compose build` +7. 检查 [更新日志](../CHANGELOG.md) 以获取升级迁移信息。 +8. `docker-compose stop && docker-compose up -d` ### 如何执行 [控制台指令](manage.zh.md): `docker-compose run --rm web node built/tools/mark-admin @example` diff --git a/docs/setup.en.md b/docs/setup.en.md index bb72fcda1e..dfe50a6600 100644 --- a/docs/setup.en.md +++ b/docs/setup.en.md @@ -131,11 +131,12 @@ You can check if the service is running with `systemctl status misskey`. ### How to update your Misskey server to the latest version 1. `git checkout master` 2. `git pull` -3. `yarn install` -4. `NODE_ENV=production yarn build` -5. `yarn migrate` -6. Restart your Misskey process to apply changes -7. Enjoy +3. `git submodule update --init` +4. `yarn install` +5. `NODE_ENV=production yarn build` +6. `yarn migrate` +7. Restart your Misskey process to apply changes +8. Enjoy If you encounter any problems with updating, please try the following: 1. `yarn clean` or `yarn cleanall` diff --git a/docs/setup.fr.md b/docs/setup.fr.md index 7f4795eec5..f38c7a8eab 100644 --- a/docs/setup.fr.md +++ b/docs/setup.fr.md @@ -126,9 +126,10 @@ Vous pouvez vérifier si le service a démarré en utilisant la commande `system ### Méthode de mise à jour vers la plus récente version de Misskey 1. `git checkout master` 2. `git pull` -3. `yarn install` -4. `NODE_ENV=production yarn build` -5. `yarn migrate` +3. `git submodule update --init` +4. `yarn install` +5. `NODE_ENV=production yarn build` +6. `yarn migrate` ---------------------------------------------------------------- diff --git a/docs/setup.ja.md b/docs/setup.ja.md index e8bae56f43..5681ee8c51 100644 --- a/docs/setup.ja.md +++ b/docs/setup.ja.md @@ -133,9 +133,10 @@ yarn run init ### Misskeyを最新バージョンにアップデートする方法: 1. `git checkout master` 2. `git pull` -3. `yarn install` -4. `NODE_ENV=production yarn build` -5. `yarn migrate` +3. `git submodule update --init` +4. `yarn install` +5. `NODE_ENV=production yarn build` +6. `yarn migrate` なにか問題が発生した場合は、`yarn clean`または`yarn cleanall`すると直る場合があります。 diff --git a/docs/setup.zh.md b/docs/setup.zh.md index 50664706b7..26a72f0d05 100644 --- a/docs/setup.zh.md +++ b/docs/setup.zh.md @@ -131,11 +131,12 @@ yarn run init ### 如何将您的 Misskey 服务器升级至最新版本 1. `git checkout master` 2. `git pull` -3. `yarn install` -4. `NODE_ENV=production yarn build` -5. `yarn migrate` -6. 重启您的 Misskey 进程来应用改变。 -7. 尽情享受吧! +3. `git submodule update --init` +4. `yarn install` +5. `NODE_ENV=production yarn build` +6. `yarn migrate` +7. 重启您的 Misskey 进程来应用改变。 +8. 尽情享受吧! 如果您在更新时遇到任何问题,请尝试以下操作: 1. `yarn clean` 或是 `yarn cleanall` diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b456f7b1d4..428cfc1fd6 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -779,6 +779,7 @@ translate: "翻訳" translatedFrom: "{x}から翻訳" accountDeletionInProgress: "アカウントの削除が進行中です" usernameInfo: "サーバー上であなたのアカウントを一意に識別するための名前。アルファベット(a~z, A~Z)、数字(0~9)、およびアンダーバー(_)が使用できます。ユーザー名は後から変更することは出来ません。" +aiChanMode: "藍モード" keepCw: "CWを維持する" _accountDelete: @@ -1189,6 +1190,7 @@ _widgets: jobQueue: "ジョブキュー" serverMetric: "サーバーメトリクス" aiscript: "AiScriptコンソール" + aichan: "藍" _cw: hide: "隠す" diff --git a/misskey-assets b/misskey-assets new file mode 160000 index 0000000000..0179793ec8 --- /dev/null +++ b/misskey-assets @@ -0,0 +1 @@ +Subproject commit 0179793ec891856d6f37a3be16ba4c22f67a81b5 diff --git a/src/client/pages/settings/general.vue b/src/client/pages/settings/general.vue index cfa8107d28..f8e8e6b24b 100644 --- a/src/client/pages/settings/general.vue +++ b/src/client/pages/settings/general.vue @@ -45,6 +45,10 @@ + + {{ $ts.aiChanMode }} + + @@ -149,6 +153,7 @@ export default defineComponent({ enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'), useReactionPickerForContextMenu: defaultStore.makeGetterSetter('useReactionPickerForContextMenu'), squareAvatars: defaultStore.makeGetterSetter('squareAvatars'), + aiChanMode: defaultStore.makeGetterSetter('aiChanMode'), }, watch: { @@ -184,6 +189,10 @@ export default defineComponent({ this.reloadAsk(); }, + aiChanMode() { + this.reloadAsk(); + }, + showGapBetweenNotesInTimeline() { this.reloadAsk(); }, diff --git a/src/client/store.ts b/src/client/store.ts index 4c4a7d93e9..e4b762873d 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -210,6 +210,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: '' }, + aiChanMode: { + where: 'device', + default: false + }, })); // TODO: 他のタブと永続化されたstateを同期 diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json index ac7ef7ddfc..7a26047ddf 100644 --- a/src/client/tsconfig.json +++ b/src/client/tsconfig.json @@ -21,7 +21,8 @@ "baseUrl": ".", "paths": { "@/*": ["../*"], - "@client/*": ["./*"] + "@client/*": ["./*"], + "@lib/*": ["../../lib/*"], }, "typeRoots": [ "node_modules/@types", diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index 23b63114cc..eef693faef 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -54,12 +54,14 @@ + + @@ -458,5 +477,15 @@ export default defineComponent({ overflow: auto; background: var(--bg); } + + > .ivnzpscs { + position: fixed; + bottom: 0; + right: 0; + width: 300px; + height: 600px; + border: none; + pointer-events: none; + } } diff --git a/src/client/widgets/aichan.vue b/src/client/widgets/aichan.vue new file mode 100644 index 0000000000..06c49090a1 --- /dev/null +++ b/src/client/widgets/aichan.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/client/widgets/index.ts b/src/client/widgets/index.ts index 38cb85494a..51a82af080 100644 --- a/src/client/widgets/index.ts +++ b/src/client/widgets/index.ts @@ -19,6 +19,7 @@ export default function(app: App) { app.component('MkwJobQueue', defineAsyncComponent(() => import('./job-queue.vue'))); app.component('MkwButton', defineAsyncComponent(() => import('./button.vue'))); app.component('MkwAiscript', defineAsyncComponent(() => import('./aiscript.vue'))); + app.component('MkwAichan', defineAsyncComponent(() => import('./aichan.vue'))); } export const widgets = [ @@ -40,4 +41,5 @@ export const widgets = [ 'jobQueue', 'button', 'aiscript', + 'aichan', ]; diff --git a/webpack.config.ts b/webpack.config.ts index 296813caa0..e9f3aa6e47 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -164,6 +164,7 @@ module.exports = { ], alias: { '@client': __dirname + '/src/client', + '@lib': __dirname + '/lib', '@': __dirname + '/src', 'const.styl': __dirname + '/src/client/const.styl' } -- cgit v1.2.3-freya From 48f46333f8e3fac771226a7c0d42452de1ec6f7e Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 4 Sep 2021 18:09:53 +0900 Subject: サインアップ・ログアウト周りの怪しい挙動を修正 (#7750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix #7749 * fix * fix logout behavior when there is no push subscription * fix logout behavior when there is no push subscription 2 * clean up service worker registration * fix lint * remove submodules --- src/client/account.ts | 38 +++++++++++++++++++++++++------------- src/client/components/signin.vue | 6 ++++-- src/client/components/signup.vue | 4 ++-- src/client/pages/welcome.setup.vue | 2 +- 4 files changed, 32 insertions(+), 18 deletions(-) (limited to 'src/client') diff --git a/src/client/account.ts b/src/client/account.ts index ee1d845493..e469bae5a2 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -1,4 +1,4 @@ -import { get, set } from '@client/scripts/idb-proxy'; +import { del, get, set } from '@client/scripts/idb-proxy'; import { reactive } from 'vue'; import { apiUrl } from '@client/config'; import { waiting } from '@client/os'; @@ -26,21 +26,33 @@ export async function signout() { //#region Remove account const accounts = await getAccounts(); accounts.splice(accounts.findIndex(x => x.id === $i.id), 1); - set('accounts', accounts); + + if (accounts.length > 0) await set('accounts', accounts); + else await del('accounts'); //#endregion - //#region Remove push notification registration + //#region Remove service worker registration try { - const registration = await navigator.serviceWorker.ready; - const push = await registration.pushManager.getSubscription(); - if (!push) return; - await fetch(`${apiUrl}/sw/unregister`, { - method: 'POST', - body: JSON.stringify({ - i: $i.token, - endpoint: push.endpoint, - }), - }); + if (navigator.serviceWorker.controller) { + const registration = await navigator.serviceWorker.ready; + const push = await registration.pushManager.getSubscription(); + if (push) { + await fetch(`${apiUrl}/sw/unregister`, { + method: 'POST', + body: JSON.stringify({ + i: $i.token, + endpoint: push.endpoint, + }), + }); + } + } + + if (accounts.length === 0) { + await navigator.serviceWorker.getRegistrations() + .then(registrations => { + return Promise.all(registrations.map(registration => registration.unregister())); + }); + } } catch (e) {} //#endregion diff --git a/src/client/components/signin.vue b/src/client/components/signin.vue index 0094038fb6..c051288d0a 100755 --- a/src/client/components/signin.vue +++ b/src/client/components/signin.vue @@ -111,7 +111,9 @@ export default defineComponent({ onLogin(res) { if (this.autoSet) { - login(res.i); + return login(res.i); + } else { + return; } }, @@ -144,7 +146,7 @@ export default defineComponent({ }); }).then(res => { this.$emit('login', res); - this.onLogin(res); + return this.onLogin(res); }).catch(err => { if (err === null) return; os.dialog({ diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index d584b97209..d332274111 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -178,14 +178,14 @@ export default defineComponent({ 'hcaptcha-response': this.hCaptchaResponse, 'g-recaptcha-response': this.reCaptchaResponse, }).then(() => { - os.api('signin', { + return os.api('signin', { username: this.username, password: this.password }).then(res => { this.$emit('signup', res); if (this.autoSet) { - login(res.i); + return login(res.i); } }); }).catch(() => { diff --git a/src/client/pages/welcome.setup.vue b/src/client/pages/welcome.setup.vue index de844ece1c..d0091bef67 100644 --- a/src/client/pages/welcome.setup.vue +++ b/src/client/pages/welcome.setup.vue @@ -53,7 +53,7 @@ export default defineComponent({ username: this.username, password: this.password, }).then(res => { - login(res.i); + return login(res.token); }).catch(() => { this.submitting = false; -- cgit v1.2.3-freya From 7364fb84ef0d4939c4f4173c21ce58184a9d17e9 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 4 Sep 2021 11:21:45 +0200 Subject: fix missing strings (#7674) * fix sort menu in federation panel * add missing strings in report menu * change i18n key too --- locales/en-US.yml | 4 ++++ locales/ja-JP.yml | 4 ++++ src/client/pages/federation.vue | 12 ++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/client') diff --git a/locales/en-US.yml b/locales/en-US.yml index 5a0ebd366c..226a39f91a 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -780,6 +780,10 @@ translatedFrom: "Translated from {x}" accountDeletionInProgress: "Account deletion is currently in progress" usernameInfo: "A name that identifies your account from others on this server. You can use the alphabet (a~z, A~Z), digits (0~9) or underscores (_). Usernames can not be changed later." keepCw: "Keep Content Warning" +pubSub: "Pub/Sub Accounts" +lastCommunication: "Last communication" +resolved: "Resolved" +unresolved: "Unresolved" _accountDelete: accountDelete: "Delete Account" mayTakeTime: "As account deletion is a resource-heavy process, it may take some time to complete depending on how much content you have created and how many files you have uploaded." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 428cfc1fd6..e22f50668f 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -781,6 +781,10 @@ accountDeletionInProgress: "アカウントの削除が進行中です" usernameInfo: "サーバー上であなたのアカウントを一意に識別するための名前。アルファベット(a~z, A~Z)、数字(0~9)、およびアンダーバー(_)が使用できます。ユーザー名は後から変更することは出来ません。" aiChanMode: "藍モード" keepCw: "CWを維持する" +pubSub: "Pub/Subのアカウント" +lastCommunication: "直近の通信" +resolved: "解決済み" +unresolved: "未解決" _accountDelete: accountDelete: "アカウントの削除" diff --git a/src/client/pages/federation.vue b/src/client/pages/federation.vue index f4ab9d0ec3..2afe70eea6 100644 --- a/src/client/pages/federation.vue +++ b/src/client/pages/federation.vue @@ -28,14 +28,14 @@ - - - - + + + + - - + + -- cgit v1.2.3-freya