summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/.eslintrc20
-rw-r--r--src/client/components/note-detailed.vue3
-rw-r--r--src/client/components/note.vue3
-rw-r--r--src/client/components/ui/modal.vue2
-rw-r--r--src/client/init.ts34
-rw-r--r--src/client/pages/doc.vue2
-rw-r--r--src/client/pages/page-editor/page-editor.vue22
-rw-r--r--src/client/store.ts1
-rw-r--r--src/client/theme-store.ts27
-rw-r--r--src/client/ui/chat/note.vue3
10 files changed, 42 insertions, 75 deletions
diff --git a/src/client/.eslintrc b/src/client/.eslintrc
index 8829472b49..fffa28d9e4 100644
--- a/src/client/.eslintrc
+++ b/src/client/.eslintrc
@@ -1,4 +1,24 @@
{
+ "env": {
+ "node": false,
+ },
+ "extends": [
+ "eslint:recommended",
+ "plugin:vue/recommended"
+ ],
+ "rules": {
+ "vue/require-v-for-key": 0,
+ "vue/max-attributes-per-line": 0,
+ "vue/html-indent": 0,
+ "vue/html-self-closing": 0,
+ "vue/no-unused-vars": 0,
+ "vue/attributes-order": 0,
+ "vue/require-prop-types": 0,
+ "vue/require-default-prop": 0,
+ "vue/html-closing-bracket-spacing": 0,
+ "vue/singleline-html-element-content-newline": 0,
+ "vue/no-v-html": 0
+ },
"globals": {
"_DEV_": false,
"_LANGS_": false,
diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue
index 1ef3f43389..ea26d31100 100644
--- a/src/client/components/note-detailed.vue
+++ b/src/client/components/note-detailed.vue
@@ -350,7 +350,8 @@ export default defineComponent({
capture(withHandler = false) {
if (this.$i) {
- this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
+ // TODO: このノートがストリーミング経由で流れてきた場合のみ sr する
+ this.connection.send(document.body.contains(this.$el) ? 'sr' : 's', { id: this.appearNote.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index 65e09b7802..70f49fef7e 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -325,7 +325,8 @@ export default defineComponent({
capture(withHandler = false) {
if (this.$i) {
- this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
+ // TODO: このノートがストリーミング経由で流れてきた場合のみ sr する
+ this.connection.send(document.body.contains(this.$el) ? 'sr' : 's', { id: this.appearNote.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},
diff --git a/src/client/components/ui/modal.vue b/src/client/components/ui/modal.vue
index ff5b98d39f..db6564bacc 100644
--- a/src/client/components/ui/modal.vue
+++ b/src/client/components/ui/modal.vue
@@ -1,7 +1,7 @@
<template>
<transition :name="$store.state.animation ? popup ? 'modal-popup' : 'modal' : ''" appear @after-leave="onClosed" @enter="$emit('opening')" @after-enter="childRendered">
<div v-show="manualShowing != null ? manualShowing : showing" class="mk-modal" v-hotkey.global="keymap" :style="{ pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
- <div class="bg _modalBg" @click="onBgClick"></div>
+ <div class="bg _modalBg" @click="onBgClick" @contextmenu.prevent.stop="() => {}"></div>
<div class="content" :class="{ popup, fixed, top: position === 'top' }" @click.self="onBgClick" ref="content">
<slot></slot>
</div>
diff --git a/src/client/init.ts b/src/client/init.ts
index 1c44e7f23e..2a2b6a2f86 100644
--- a/src/client/init.ts
+++ b/src/client/init.ts
@@ -4,40 +4,6 @@
import '@/style.scss';
-// TODO: そのうち消す
-if (localStorage.getItem('vuex') != null) {
- const vuex = JSON.parse(localStorage.getItem('vuex'));
-
- localStorage.setItem('account', JSON.stringify({
- ...vuex.i,
- token: localStorage.getItem('i')
- }));
- localStorage.setItem('accounts', JSON.stringify(vuex.device.accounts));
- localStorage.setItem('miux:themes', JSON.stringify(vuex.device.themes));
-
- if (vuex.device.userData) {
- for (const [k, v] of Object.entries(vuex.device.userData)) {
- localStorage.setItem('pizzax::base::' + k, JSON.stringify({
- widgets: v.widgets
- }));
-
- if (v.deck) {
- localStorage.setItem('pizzax::deck::' + k, JSON.stringify({
- columns: v.deck.columns,
- layout: v.deck.layout,
- }));
- }
- }
- }
-
- localStorage.setItem('vuex-old', JSON.stringify(vuex));
- localStorage.removeItem('vuex');
- localStorage.removeItem('i');
- localStorage.removeItem('locale');
-
- location.reload();
-}
-
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';
import { createApp, watch } from 'vue';
diff --git a/src/client/pages/doc.vue b/src/client/pages/doc.vue
index 3379a5fe68..ed4eae4d02 100644
--- a/src/client/pages/doc.vue
+++ b/src/client/pages/doc.vue
@@ -60,7 +60,7 @@ export default defineComponent({
methods: {
fetchDoc() {
- fetch(`${url}/assets/docs/${lang}/${this.doc}.md`).then(res => res.text()).then(md => {
+ fetch(`${url}/doc-assets/${lang}/${this.doc}.md`).then(res => res.text()).then(md => {
this.parse(md);
});
},
diff --git a/src/client/pages/page-editor/page-editor.vue b/src/client/pages/page-editor/page-editor.vue
index 45997dfd65..08856ebfe4 100644
--- a/src/client/pages/page-editor/page-editor.vue
+++ b/src/client/pages/page-editor/page-editor.vue
@@ -4,9 +4,9 @@
<MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><Fa :icon="faExternalLinkSquareAlt"/> {{ $ts._pages.viewPage }}</MkA>
<div class="buttons" style="margin: 16px 0;">
- <MkButton inline @click="save" primary class="save"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton>
+ <MkButton inline @click="save" primary class="save" v-if="!readonly"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton>
<MkButton inline @click="duplicate" class="duplicate" v-if="pageId"><Fa :icon="faCopy"/> {{ $ts.duplicate }}</MkButton>
- <MkButton inline @click="del" class="delete" v-if="pageId"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton>
+ <MkButton inline @click="del" class="delete" v-if="pageId && !readonly"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton>
</div>
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
@@ -134,12 +134,18 @@ export default defineComponent({
data() {
return {
- INFO: computed(() => this.initPageId ? {
- title: this.$ts._pages.editPage,
- icon: faPencilAlt,
- } : {
- title: this.$ts._pages.newPage,
- icon: faPencilAlt,
+ INFO: computed(() => {
+ let title = this.$ts._pages.newPage;
+ if (this.initPageId) {
+ title = this.$ts._pages.editPage;
+ }
+ else if (this.initPageName && this.initUser) {
+ title = this.$ts._pages.readPage;
+ }
+ return {
+ title: title,
+ icon: faPencilAlt,
+ };
}),
author: this.$i,
readonly: false,
diff --git a/src/client/store.ts b/src/client/store.ts
index 14924dadd0..e6fdd12f1d 100644
--- a/src/client/store.ts
+++ b/src/client/store.ts
@@ -212,7 +212,6 @@ type Plugin = {
*/
export class ColdDeviceStorage {
public static default = {
- themes: [] as Theme[], // TODO: そのうち消す
// TODO: テーマをアカウントに保存するようになったのにもかかわらず、以下のどのテーマを使うかという情報だけがブラウザ保存になっていて、アカウント切り替えたりログアウトしたときに不具合が発生するのでなんとかする
// テーマIDを保存するのではなく、テーマ自体を保存するようにすれば解決するかも
darkTheme: '8050783a-7f63-445a-b270-36d0f6ba1677',
diff --git a/src/client/theme-store.ts b/src/client/theme-store.ts
index 5e440efbf9..8e21af70fc 100644
--- a/src/client/theme-store.ts
+++ b/src/client/theme-store.ts
@@ -33,30 +33,3 @@ export async function removeTheme(theme: Theme): Promise<void> {
await api('i/registry/set', { scope: ['client'], key: 'themes', value: themes });
localStorage.setItem(lsCacheKey, JSON.stringify(themes));
}
-
-// TODO: そのうち消す
-if (ColdDeviceStorage.get('themes').length > 0) {
- const lsThemes = ColdDeviceStorage.get('themes');
- let registryThemes;
- try {
- registryThemes = await api('i/registry/get', { scope: ['client'], key: 'themes' });
- } catch (e) {
- if (e.code === 'NO_SUCH_KEY') {
- registryThemes = [];
- } else {
- throw e;
- }
- }
- const themes = [] as Theme[];
- for (const theme of lsThemes) {
- if (themes.some(x => x.id === theme.id)) continue;
- themes.push(theme);
- }
- for (const theme of registryThemes) {
- if (themes.some(x => x.id === theme.id)) continue;
- themes.push(theme);
- }
- await api('i/registry/set', { scope: ['client'], key: 'themes', value: themes });
- localStorage.setItem(lsCacheKey, JSON.stringify(themes));
- ColdDeviceStorage.set('themes', []);
-}
diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue
index 5a4a13d889..97275875ca 100644
--- a/src/client/ui/chat/note.vue
+++ b/src/client/ui/chat/note.vue
@@ -325,7 +325,8 @@ export default defineComponent({
capture(withHandler = false) {
if (this.$i) {
- this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
+ // TODO: このノートがストリーミング経由で流れてきた場合のみ sr する
+ this.connection.send(document.body.contains(this.$el) ? 'sr' : 's', { id: this.appearNote.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},