From 36c2d0082f7c54d9fb99069aa60b8a8d67630ad3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 May 2019 19:19:43 +0900 Subject: [PATCH] =?UTF-8?q?MisskeyPages=E3=82=92=E3=83=9B=E3=83=BC?= =?UTF-8?q?=E3=83=A0UI=E3=81=AB=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/components/mfm.ts | 6 +- .../common/views/components/url-preview.vue | 11 +-- .../app/common/views/components/url.vue | 12 ++-- .../page-editor/els/page-editor.el.button.vue | 0 .../els/page-editor.el.counter.vue | 0 .../page-editor/els/page-editor.el.if.vue | 0 .../page-editor/els/page-editor.el.image.vue | 2 +- .../els/page-editor.el.number-input.vue | 0 .../page-editor/els/page-editor.el.post.vue | 0 .../els/page-editor.el.section.vue | 0 .../page-editor/els/page-editor.el.switch.vue | 0 .../els/page-editor.el.text-input.vue | 0 .../page-editor/els/page-editor.el.text.vue | 0 .../els/page-editor.el.textarea-input.vue | 0 .../els/page-editor.el.textarea.vue | 0 .../page-editor/page-editor.blocks.vue | 0 .../page-editor/page-editor.container.vue | 0 .../page-editor/page-editor.script-block.vue | 0 .../page-editor/page-editor.vue | 33 ++++++--- .../app/common/views/pages/page/page.vue | 10 +-- src/client/app/desktop/script.ts | 8 +-- .../app/desktop/views/pages/page-editor.vue | 67 ------------------- src/client/app/desktop/views/pages/page.vue | 36 ---------- src/client/app/mobile/script.ts | 8 +-- .../app/mobile/views/pages/page-editor.vue | 67 ------------------- src/client/app/mobile/views/pages/page.vue | 39 ----------- 26 files changed, 58 insertions(+), 241 deletions(-) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.button.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.counter.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.if.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.image.vue (95%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.number-input.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.post.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.section.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.switch.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.text-input.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.text.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.textarea-input.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/els/page-editor.el.textarea.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/page-editor.blocks.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/page-editor.container.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/page-editor.script-block.vue (100%) rename src/client/app/common/views/{components => pages}/page-editor/page-editor.vue (94%) delete mode 100644 src/client/app/desktop/views/pages/page-editor.vue delete mode 100644 src/client/app/desktop/views/pages/page.vue delete mode 100644 src/client/app/mobile/views/pages/page-editor.vue delete mode 100644 src/client/app/mobile/views/pages/page.vue diff --git a/src/client/app/common/views/components/mfm.ts b/src/client/app/common/views/components/mfm.ts index 9459172881..7de29b2aad 100644 --- a/src/client/app/common/views/components/mfm.ts +++ b/src/client/app/common/views/components/mfm.ts @@ -8,7 +8,7 @@ import { concat, sum } from '../../../../../prelude/array'; import MkFormula from './formula.vue'; import MkCode from './code.vue'; import MkGoogle from './google.vue'; -import { host } from '../../../config'; +import { host, url } from '../../../config'; import { preorderF, countNodesF } from '../../../../../prelude/tree'; function sumTextsLength(ts: MfmForest): number { @@ -175,7 +175,9 @@ export default Vue.component('misskey-flavored-markdown', { props: { url: token.node.props.url, rel: 'nofollow noopener', - target: '_blank' + ...(token.node.props.url.startsWith(url) ? {} : { + target: '_blank' + }) }, attrs: { style: 'color:var(--mfmUrl);' diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index 9ca4497ad8..6e0d73eef5 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -9,7 +9,7 @@
- +
@@ -23,17 +23,18 @@

{{ sitename }}

-
+
- - diff --git a/src/client/app/desktop/views/pages/page.vue b/src/client/app/desktop/views/pages/page.vue deleted file mode 100644 index 1ddff08c76..0000000000 --- a/src/client/app/desktop/views/pages/page.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 106e843ca8..d04662cc1f 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -149,8 +149,8 @@ init((launch, os) => { { path: '/i/drive', name: 'drive', component: MkDrive }, { path: '/i/drive/folder/:folder', component: MkDrive }, { path: '/i/drive/file/:file', component: MkDrive }, - { path: '/i/pages/new', component: () => import('./views/pages/page-editor.vue').then(m => m.default) }, - { path: '/i/pages/edit/:pageId', props: true, component: () => import('./views/pages/page-editor.vue').then(m => m.default) }, + { path: '/i/pages/new', component: UI, props: route => ({ component: () => import('../common/views/pages/page-editor/page-editor.vue').then(m => m.default) }) }, + { path: '/i/pages/edit/:pageId', component: UI, props: route => ({ component: () => import('../common/views/pages/page-editor/page-editor.vue').then(m => m.default), initPageId: route.params.pageId }) }, { path: '/selectdrive', component: MkSelectDrive }, { path: '/search', component: MkSearch }, { path: '/tags/:tag', component: MkTag }, @@ -163,8 +163,8 @@ init((launch, os) => { { path: 'following', component: () => import('../common/views/pages/following.vue').then(m => m.default) }, { path: 'followers', component: () => import('../common/views/pages/followers.vue').then(m => m.default) }, ]}, - { path: '/@:user/pages/:page', props: true, component: () => import('./views/pages/page.vue').then(m => m.default) }, - { path: '/@:user/pages/:pageName/view-source', props: true, component: () => import('./views/pages/page-editor.vue').then(m => m.default) }, + { path: '/@:user/pages/:page', component: UI, props: route => ({ component: () => import('../common/views/pages/page/page.vue').then(m => m.default), pageName: route.params.page, username: route.params.user }) }, + { path: '/@:user/pages/:pageName/view-source', component: UI, props: route => ({ component: () => import('../common/views/pages/page-editor/page-editor.vue').then(m => m.default), initUser: route.params.user, initPageName: route.params.pageName }) }, { path: '/notes/:note', component: MkNote }, { path: '/authorize-follow', component: MkFollow }, { path: '*', component: MkNotFound } diff --git a/src/client/app/mobile/views/pages/page-editor.vue b/src/client/app/mobile/views/pages/page-editor.vue deleted file mode 100644 index 0b04f25802..0000000000 --- a/src/client/app/mobile/views/pages/page-editor.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - diff --git a/src/client/app/mobile/views/pages/page.vue b/src/client/app/mobile/views/pages/page.vue deleted file mode 100644 index f494abffd7..0000000000 --- a/src/client/app/mobile/views/pages/page.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - -