From ffb99325cafb5b00ee652c6b3ed2811a4d643fc8 Mon Sep 17 00:00:00 2001 From: Patrick Figel Date: Mon, 17 Apr 2017 12:14:03 +0200 Subject: Add gif auto-play/pause preference This introduces a new per-user preference called "Auto-play animated GIFs", which is enabled by default. When a user disables this setting, gifs in toots become click-to-play. Previews of animated gifs were changed to display the video play button so that users can distinguish them from regular images. This setting also affects account avatars in the detailed account view, which was changed to use the same hover-to-play mechanism that is used for animated avatars in timelines. Fixes #1652 --- app/views/home/initial_state.json.rabl | 1 + app/views/settings/preferences/show.html.haml | 3 +++ 2 files changed, 4 insertions(+) (limited to 'app/views') diff --git a/app/views/home/initial_state.json.rabl b/app/views/home/initial_state.json.rabl index ce7bfbd44..a2ab2d060 100644 --- a/app/views/home/initial_state.json.rabl +++ b/app/views/home/initial_state.json.rabl @@ -9,6 +9,7 @@ node(:meta) do me: current_account.id, admin: @admin.try(:id), boost_modal: current_account.user.setting_boost_modal, + auto_play_gif: current_account.user.setting_auto_play_gif, } end diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index e819429b6..3fdcca041 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -25,5 +25,8 @@ .fields-group = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label + .fields-group + = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label + .actions = f.button :button, t('generic.save_changes'), type: :submit -- cgit