From a9830ff4913a56a3ff097505a4e65bb61117b4d5 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 3 Feb 2022 22:50:32 +0200 Subject: support width/height img attributes --- src/components/still-image/still-image.vue | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/still-image/still-image.vue') diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 0623b42e..cca75fcb 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -2,6 +2,7 @@
Date: Tue, 1 Mar 2022 00:35:00 +0300 Subject: Add bot indication to user icon on statuses --- src/boot/after_store.js | 1 + src/components/settings_modal/tabs/filtering_tab.vue | 5 +++++ src/components/status/status.js | 6 ++++++ src/components/status/status.vue | 7 ++++++- src/components/still-image/still-image.vue | 1 + src/components/user_avatar/user_avatar.js | 13 ++++++++++++- src/components/user_avatar/user_avatar.vue | 10 +++++++++- src/i18n/en.json | 1 + src/modules/config.js | 1 + src/modules/instance.js | 1 + 10 files changed, 43 insertions(+), 3 deletions(-) (limited to 'src/components/still-image/still-image.vue') diff --git a/src/boot/after_store.js b/src/boot/after_store.js index cc0c7c5e..c4a0a800 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -115,6 +115,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { copyInstanceOption('nsfwCensorImage') copyInstanceOption('background') copyInstanceOption('hidePostStats') + copyInstanceOption('hideBotIndication') copyInstanceOption('hideUserStats') copyInstanceOption('hideFilteredStatuses') copyInstanceOption('logo') diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue index 87567bef..a7e30ce2 100644 --- a/src/components/settings_modal/tabs/filtering_tab.vue +++ b/src/components/settings_modal/tabs/filtering_tab.vue @@ -47,6 +47,11 @@ {{ $t('settings.hide_post_stats') }} +
  • + + {{ $t('settings.hide_bot_indication') }} + +
  • _.url)) @@ -301,6 +304,9 @@ const Status = { muteBotStatuses () { return this.mergedConfig.muteBotStatuses }, + hideBotIndication () { + return this.mergedConfig.hideBotIndication + }, currentUser () { return this.$store.state.users.currentUser }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 3bb29db6..8f51a778 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -77,6 +77,7 @@ @@ -124,6 +125,7 @@ @click.stop.prevent.capture.native="toggleUserExpanded" >
    - +
    diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index cca75fcb..4ea21506 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -19,6 +19,7 @@ @load="onLoad" @error="onError" > +
    diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js index 94653004..33d9a258 100644 --- a/src/components/user_avatar/user_avatar.js +++ b/src/components/user_avatar/user_avatar.js @@ -1,10 +1,21 @@ import StillImage from '../still-image/still-image.vue' +import { library } from '@fortawesome/fontawesome-svg-core' + +import { + faRobot +} from '@fortawesome/free-solid-svg-icons' + +library.add( + faRobot +) + const UserAvatar = { props: [ 'user', 'betterShadow', - 'compact' + 'compact', + 'bot' ], data () { return { diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 4040e263..29e03bcb 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -7,7 +7,9 @@ :src="imgSrc(user.profile_image_url_original)" :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" :image-load-error="imageLoadError" - /> + > + +
    .bot-indicator { + position: absolute; + bottom: 0; + right: 0; + } + &.better-shadow { box-shadow: var(--_avatarShadowInset); filter: var(--_avatarShadowFilter); diff --git a/src/i18n/en.json b/src/i18n/en.json index a109ab3c..61087ec2 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -352,6 +352,7 @@ "hide_media_previews": "Hide media previews", "hide_muted_posts": "Hide posts of muted users", "mute_bot_posts": "Mute bot posts", + "hide_bot_indication": "Hide bot indication in posts", "hide_all_muted_posts": "Hide muted posts", "max_thumbnails": "Maximum amount of thumbnails per post (empty = no limit)", "hide_isp": "Hide instance-specific panel", diff --git a/src/modules/config.js b/src/modules/config.js index 79f76561..1aa2878e 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -80,6 +80,7 @@ export const defaultState = { mentionLinkShowYous: undefined, // instance default mentionLinkBoldenYou: undefined, // instance default hidePostStats: undefined, // instance default + hideBotIndication: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default sensitiveByDefault: undefined // instance default diff --git a/src/modules/instance.js b/src/modules/instance.js index d0bf10e3..41bcf329 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -33,6 +33,7 @@ const defaultState = { hideMutedThreads: true, hideWordFilteredPosts: false, hidePostStats: false, + hideBotIndication: false, hideSitename: false, hideUserStats: false, muteBotStatuses: false, -- cgit v1.2.3-70-g09d2 From 71c0b59866ce3ef0ac57ac8cfc397858ae7e362b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 14 Mar 2022 09:35:29 +0200 Subject: lint --- src/components/settings_modal/helpers/integer_setting.vue | 8 ++++---- src/components/settings_modal/tabs/filtering_tab.vue | 2 +- src/components/still-image/still-image.vue | 2 +- src/components/user_avatar/user_avatar.vue | 6 +++++- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src/components/still-image/still-image.vue') diff --git a/src/components/settings_modal/helpers/integer_setting.vue b/src/components/settings_modal/helpers/integer_setting.vue index daf903f3..408b0925 100644 --- a/src/components/settings_modal/helpers/integer_setting.vue +++ b/src/components/settings_modal/helpers/integer_setting.vue @@ -1,8 +1,8 @@ diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 29e03bcb..847d654b 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -8,7 +8,11 @@ :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" :image-load-error="imageLoadError" > - +
    Date: Wed, 20 Apr 2022 23:44:33 +0300 Subject: more em-sized fonts --- src/components/emoji_input/emoji_input.vue | 2 +- src/components/emoji_picker/emoji_picker.scss | 6 ++++-- src/components/link-preview/link-preview.vue | 2 +- src/components/notifications/notifications.scss | 8 ++++---- src/components/registration/registration.vue | 2 +- src/components/status/status.scss | 9 ++++----- src/components/still-image/still-image.vue | 8 ++++---- src/components/user_card/user_card.scss | 5 ++--- src/components/user_list_popover/user_list_popover.vue | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/components/still-image/still-image.vue') diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index aa2950ce..7d95ab7e 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -78,7 +78,7 @@ top: 0; right: 0; margin: .2em .25em; - font-size: 16px; + font-size: 1.3em; cursor: pointer; line-height: 24px; diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss index 1a696584..2055e02e 100644 --- a/src/components/emoji_picker/emoji_picker.scss +++ b/src/components/emoji_picker/emoji_picker.scss @@ -73,12 +73,13 @@ &-item { padding: 0 7px; cursor: pointer; - font-size: 24px; + font-size: 1.85em; &.disabled { opacity: 0.5; pointer-events: none; } + &.active { border-bottom: 4px solid; @@ -151,9 +152,10 @@ justify-content: left; &-title { - font-size: 12px; + font-size: 0.85em; width: 100%; margin: 0; + &.disabled { display: none; } diff --git a/src/components/link-preview/link-preview.vue b/src/components/link-preview/link-preview.vue index d3ca39b8..220527f2 100644 --- a/src/components/link-preview/link-preview.vue +++ b/src/components/link-preview/link-preview.vue @@ -63,7 +63,7 @@ } .card-host { - font-size: 12px; + font-size: 0.85em; } .card-description { diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index a285027d..aa4ae346 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -113,13 +113,13 @@ } .emoji-reaction-emoji { - font-size: 16px; + font-size: 1.3em; } .notification-details { - min-width: 0px; + min-width: 0; word-wrap: break-word; - line-height:18px; + line-height: 1.4; position: relative; overflow: hidden; width: 100%; @@ -142,7 +142,7 @@ } .timeago { - margin-right: .2em; + margin-right: 0.2em; } .status-content { diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 1c83a47e..c3fee6f8 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -318,7 +318,7 @@ $validations-cRed: #f04124; text-align: left; span { - font-size: 12px; + font-size: 0.85em; } } diff --git a/src/components/status/status.scss b/src/components/status/status.scss index e38e2a53..36a2cca1 100644 --- a/src/components/status/status.scss +++ b/src/components/status/status.scss @@ -82,7 +82,6 @@ .status-username { white-space: nowrap; - font-size: 14px; overflow: hidden; max-width: 85%; font-weight: bold; @@ -160,7 +159,7 @@ & .heading-reply-row { position: relative; align-content: baseline; - font-size: 12px; + font-size: 0.85em; margin-top: 0.2em; line-height: 130%; max-width: 100%; @@ -229,7 +228,7 @@ .replies { margin-top: 0.25em; line-height: 18px; - font-size: 12px; + font-size: 0.85em; display: flex; flex-wrap: wrap; @@ -389,14 +388,14 @@ .stat-title { color: var(--faint, $fallback--faint); - font-size: 12px; + font-size: 0.85em; text-transform: uppercase; position: relative; } .stat-number { font-weight: bolder; - font-size: 16px; + font-size: 1.1em; line-height: 1em; } diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index e939b532..ab3080c8 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -58,10 +58,10 @@ zoom: var(--_still_image-label-scale, 1); content: 'gif'; position: absolute; - line-height: 10px; - font-size: 10px; - top: 5px; - left: 5px; + line-height: 1; + font-size: 0.7em; + top: 0.5em; + left: 0.5em; background: rgba(127, 127, 127, 0.5); color: #fff; display: block; diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss index 4dabafa2..44657bdf 100644 --- a/src/components/user_card/user_card.scss +++ b/src/components/user_card/user_card.scss @@ -189,12 +189,12 @@ overflow: hidden; flex: 1 1 auto; margin-right: 1em; - font-size: 15px; + font-size: 1.1em; } .bottom-line { font-weight: light; - font-size: 15px; + font-size: 1.1em; align-items: baseline; .lock-icon { @@ -232,7 +232,6 @@ margin-bottom: .15em; display: flex; align-items: baseline; - font-size: 14px; line-height: 22px; flex-wrap: wrap; diff --git a/src/components/user_list_popover/user_list_popover.vue b/src/components/user_list_popover/user_list_popover.vue index 8706d0ff..bdc3aa92 100644 --- a/src/components/user_list_popover/user_list_popover.vue +++ b/src/components/user_list_popover/user_list_popover.vue @@ -73,7 +73,7 @@ } .user-list-screen-name { - font-size: 9px; + font-size: 0.65em; } } } -- cgit v1.2.3-70-g09d2 From b77259a9a0c353ede8ff1d6bf5c13ae91ca7fc7c Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 8 Jan 2022 01:35:16 -0500 Subject: Use StillImage to render emojis in emoji picker --- src/components/emoji_picker/emoji_picker.js | 15 +++++++++++++-- src/components/emoji_picker/emoji_picker.vue | 5 +++-- src/components/still-image/still-image.js | 19 +++++++++++++++++-- src/components/still-image/still-image.vue | 5 +++-- 4 files changed, 36 insertions(+), 8 deletions(-) (limited to 'src/components/still-image/still-image.vue') diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index ea53a972..315364d5 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -118,8 +118,19 @@ const EmojiPicker = { }, initializeLazyLoad () { this.destroyLazyLoad() - this.$lozad = lozad('img', {}) - this.$lozad.observe() + this.$nextTick(() => { + this.$lozad = lozad('.still-image.emoji-picker-emoji', { + load: el => { + const vn = el.__vue__ + if (!vn) { + return + } + + vn.loadLazy() + } + }) + this.$lozad.observe() + }) }, waitForDomAndInitializeLazyLoad () { this.$nextTick(() => this.initializeLazyLoad()) diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index b92bccd7..19cc46b5 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -89,10 +89,11 @@ @click.stop.prevent="onEmoji(emoji)" > {{ emoji.replacement }} - + />
    diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js index d7abbcb5..1806d33b 100644 --- a/src/components/still-image/still-image.js +++ b/src/components/still-image/still-image.js @@ -7,16 +7,23 @@ const StillImage = { 'imageLoadHandler', 'alt', 'height', - 'width' + 'width', + 'dataSrc' ], data () { return { + // for lazy loading, see loadLazy() + realSrc: this.src, stopGifs: this.$store.getters.mergedConfig.stopGifs } }, computed: { animated () { - return this.stopGifs && (this.mimetype === 'image/gif' || this.src.endsWith('.gif')) + if (!this.realSrc) { + return false + } + + return this.stopGifs && (this.mimetype === 'image/gif' || this.realSrc.endsWith('.gif')) }, style () { const appendPx = (str) => /\d$/.test(str) ? str + 'px' : str @@ -27,7 +34,15 @@ const StillImage = { } }, methods: { + loadLazy () { + if (this.dataSrc) { + this.realSrc = this.dataSrc + } + }, onLoad () { + if (!this.realSrc) { + return + } const image = this.$refs.src if (!image) return this.imageLoadHandler && this.imageLoadHandler(image) diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index ab3080c8..633fb229 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -11,10 +11,11 @@