summaryrefslogtreecommitdiff
path: root/src/client/app/common/views
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-05 03:51:54 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-05 03:51:54 +0900
commit861302f0fd2c47d78f6b9c78697a649fcf1342c8 (patch)
tree297a327fb3dff61f78251d175733fa48ee8e27e7 /src/client/app/common/views
parentアニメーションを自動再生しないオプション (#4131) (diff)
downloadmisskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.tar.gz
misskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.tar.bz2
misskey-861302f0fd2c47d78f6b9c78697a649fcf1342c8.zip
アニメーション画像を無効にする際、サーバーサイドではなくクライアントサイドでURLを変更するように
Diffstat (limited to 'src/client/app/common/views')
-rw-r--r--src/client/app/common/views/components/avatar.vue8
-rw-r--r--src/client/app/common/views/components/emoji.vue5
-rw-r--r--src/client/app/common/views/components/media-image.vue7
3 files changed, 17 insertions, 3 deletions
diff --git a/src/client/app/common/views/components/avatar.vue b/src/client/app/common/views/components/avatar.vue
index 698873833d..205b4a6d79 100644
--- a/src/client/app/common/views/components/avatar.vue
+++ b/src/client/app/common/views/components/avatar.vue
@@ -15,6 +15,7 @@
<script lang="ts">
import Vue from 'vue';
+import { getStaticImageUrl } from '../../../common/scripts/get-static-image-url';
export default Vue.extend({
props: {
@@ -47,6 +48,11 @@ export default Vue.extend({
borderRadius: this.$store.state.settings.circleIcons ? '100%' : null
};
},
+ url(): string {
+ return this.$store.state.device.doNotAutoplayAnimation
+ ? getStaticImageUrl(this.user.avatarUrl)
+ : this.user.avatarUrl;
+ },
icon(): any {
return {
backgroundColor: this.lightmode
@@ -54,7 +60,7 @@ export default Vue.extend({
: this.user.avatarColor && this.user.avatarColor.length == 3
? `rgb(${this.user.avatarColor.join(',')})`
: null,
- backgroundImage: this.lightmode ? null : `url(${this.user.avatarUrl})`,
+ backgroundImage: this.lightmode ? null : `url(${this.url})`,
borderRadius: this.$store.state.settings.circleIcons ? '100%' : null
};
}
diff --git a/src/client/app/common/views/components/emoji.vue b/src/client/app/common/views/components/emoji.vue
index 29b09947e4..b791dcab6a 100644
--- a/src/client/app/common/views/components/emoji.vue
+++ b/src/client/app/common/views/components/emoji.vue
@@ -9,6 +9,7 @@
import Vue from 'vue';
// スクリプトサイズがデカい
//import { lib } from 'emojilib';
+import { getStaticImageUrl } from '../../../common/scripts/get-static-image-url';
export default Vue.extend({
props: {
@@ -54,7 +55,9 @@ export default Vue.extend({
const customEmoji = this.customEmojis.find(x => x.name == this.name);
if (customEmoji) {
this.customEmoji = customEmoji;
- this.url = customEmoji.url;
+ this.url = this.$store.state.device.doNotAutoplayAnimation
+ ? getStaticImageUrl(customEmoji.url)
+ : customEmoji.url;
} else {
//const emoji = lib[this.name];
//if (emoji) {
diff --git a/src/client/app/common/views/components/media-image.vue b/src/client/app/common/views/components/media-image.vue
index 01187465f1..4433ec2afc 100644
--- a/src/client/app/common/views/components/media-image.vue
+++ b/src/client/app/common/views/components/media-image.vue
@@ -17,6 +17,7 @@
import Vue from 'vue';
import i18n from '../../../i18n';
import ImageViewer from './image-viewer.vue';
+import { getStaticImageUrl } from '../../../common/scripts/get-static-image-url';
export default Vue.extend({
i18n: i18n('common/views/components/media-image.vue'),
@@ -36,7 +37,11 @@ export default Vue.extend({
}
computed: {
style(): any {
- let url = `url(${this.image.thumbnailUrl})`;
+ let url = `url(${
+ this.$store.state.device.doNotAutoplayAnimation
+ ? getStaticImageUrl(this.image.thumbnailUrl)
+ : this.image.thumbnailUrl
+ })`;
if (this.$store.state.device.loadRemoteMedia || this.$store.state.device.lightmode) {
url = null;