mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-24 15:54:48 +00:00
Make Chrome splash screen same color as web UI's background color (#5169)
This commit is contained in:
parent
04fa4eb7f9
commit
47ecd652d3
|
@ -1,11 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ManifestsController < ApplicationController
|
class ManifestsController < ApplicationController
|
||||||
before_action :set_instance_presenter
|
def show
|
||||||
|
render json: InstancePresenter.new, serializer: ManifestSerializer
|
||||||
def show; end
|
|
||||||
|
|
||||||
def set_instance_presenter
|
|
||||||
@instance_presenter = InstancePresenter.new
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
52
app/serializers/manifest_serializer.rb
Normal file
52
app/serializers/manifest_serializer.rb
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ManifestSerializer < ActiveModel::Serializer
|
||||||
|
include RoutingHelper
|
||||||
|
include ActionView::Helpers::TextHelper
|
||||||
|
|
||||||
|
attributes :name, :short_name, :description,
|
||||||
|
:icons, :theme_color, :background_color,
|
||||||
|
:display, :start_url, :scope
|
||||||
|
|
||||||
|
def name
|
||||||
|
object.site_title
|
||||||
|
end
|
||||||
|
|
||||||
|
def short_name
|
||||||
|
object.site_title
|
||||||
|
end
|
||||||
|
|
||||||
|
def description
|
||||||
|
strip_tags(object.site_description.presence || I18n.t('about.about_mastodon_html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
def icons
|
||||||
|
[
|
||||||
|
{
|
||||||
|
src: '/android-chrome-192x192.png',
|
||||||
|
sizes: '192x192',
|
||||||
|
type: 'image/png',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
def theme_color
|
||||||
|
'#282c37'
|
||||||
|
end
|
||||||
|
|
||||||
|
def background_color
|
||||||
|
'#191b22'
|
||||||
|
end
|
||||||
|
|
||||||
|
def display
|
||||||
|
'standalone'
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_url
|
||||||
|
'/web/timelines/home'
|
||||||
|
end
|
||||||
|
|
||||||
|
def scope
|
||||||
|
root_url
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,11 +0,0 @@
|
||||||
object false
|
|
||||||
|
|
||||||
node(:name) { Setting.site_title }
|
|
||||||
node(:short_name) { Setting.site_title }
|
|
||||||
node(:description) { strip_tags(Setting.site_description.presence || I18n.t('about.about_mastodon_html')) }
|
|
||||||
node(:icons) { [{ src: '/android-chrome-192x192.png', sizes: '192x192', type: 'image/png' }] }
|
|
||||||
node(:theme_color) { '#282c37' }
|
|
||||||
node(:background_color) { '#d9e1e8' }
|
|
||||||
node(:display) { 'standalone' }
|
|
||||||
node(:start_url) { '/web/timelines/home' }
|
|
||||||
node(:scope) { root_url }
|
|
|
@ -8,10 +8,6 @@ describe ManifestsController do
|
||||||
get :show, format: :json
|
get :show, format: :json
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'assigns @instance_presenter' do
|
|
||||||
expect(assigns(:instance_presenter)).to be_kind_of InstancePresenter
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue