From a479e65f3e2ec7b6028c886d1d998a32927c8f48 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 6 Jan 2019 12:56:13 +0900 Subject: [PATCH] Compact URL preview (#3835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Compact url-preview * fix header * increase limit * better limit * Revert "better limit" This reverts commit ef396f773394068b0b7e37fccff31c70661b3978. ハードリミットかけるならサーバー上でかけたほうが良さそう * Revert "increase limit" This reverts commit 72c10a456ba37151a4d88d11544b0ff9daabd284. --- .../common/views/components/url-preview.vue | 54 +++++++++++++++++-- .../app/desktop/views/components/note.vue | 7 ++- .../app/desktop/views/components/notes.vue | 2 +- .../desktop/views/pages/deck/deck.notes.vue | 1 + .../app/mobile/views/components/note.vue | 7 ++- .../app/mobile/views/components/notes.vue | 2 +- 6 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index 038541ba0..958abe00f 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -8,16 +8,16 @@
- +
-

{{ title }}

+

{{ title }}

-

{{ description.length > 85 ? description.slice(0, 85) + '…' : description }}

+

{{ description.length > 85 ? description.slice(0, 85) + '…' : description }}

-

{{ sitename }}

+

{{ sitename }}

@@ -120,6 +120,12 @@ export default Vue.extend({ default: false }, + compact: { + type: Boolean, + required: false, + default: false + }, + mini: { type: Boolean, required: false, @@ -302,6 +308,23 @@ export default Vue.extend({ width 12px height 12px + &.compact + > .thumbnail + position: absolute + width 56px + height 100% + + > article + left 56px + width calc(100% - 56px) + padding 4px + + > header + margin-bottom 2px + + > footer + margin-top 2px + &.mini font-size 10px @@ -325,4 +348,27 @@ export default Vue.extend({ width 12px height 12px + &.compact + > .thumbnail + position: absolute + width 56px + height 100% + + > article + left 56px + width calc(100% - 56px) + padding 4px + + > header + margin-bottom 2px + + > footer + margin-top 2px + + &.compact + > article + > header h1, p, footer + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; diff --git a/src/client/app/desktop/views/components/note.vue b/src/client/app/desktop/views/components/note.vue index a52eaac7e..e5f233a55 100644 --- a/src/client/app/desktop/views/components/note.vue +++ b/src/client/app/desktop/views/components/note.vue @@ -36,7 +36,7 @@ 位置情報
- +