mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
merge master
This commit is contained in:
commit
2d77a5e767
@ -30,7 +30,7 @@ plugins:
|
|||||||
channel: eslint-7
|
channel: eslint-7
|
||||||
rubocop:
|
rubocop:
|
||||||
enabled: true
|
enabled: true
|
||||||
channel: rubocop-0-88
|
channel: rubocop-0-92
|
||||||
sass-lint:
|
sass-lint:
|
||||||
enabled: true
|
enabled: true
|
||||||
exclude_patterns:
|
exclude_patterns:
|
||||||
|
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@ -11,7 +11,7 @@ updates:
|
|||||||
interval: weekly
|
interval: weekly
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
allow:
|
allow:
|
||||||
- dependency-type: all
|
- dependency-type: direct
|
||||||
|
|
||||||
- package-ecosystem: bundler
|
- package-ecosystem: bundler
|
||||||
directory: "/"
|
directory: "/"
|
||||||
@ -19,4 +19,4 @@ updates:
|
|||||||
interval: weekly
|
interval: weekly
|
||||||
open-pull-requests-limit: 99
|
open-pull-requests-limit: 99
|
||||||
allow:
|
allow:
|
||||||
- dependency-type: all
|
- dependency-type: direct
|
||||||
|
16
Gemfile
16
Gemfile
@ -5,7 +5,7 @@ ruby '>= 2.5.0', '< 3.0.0'
|
|||||||
|
|
||||||
gem 'pkg-config', '~> 1.4'
|
gem 'pkg-config', '~> 1.4'
|
||||||
|
|
||||||
gem 'puma', '~> 4.3'
|
gem 'puma', '~> 5.0'
|
||||||
gem 'rails', '~> 5.2.4.4'
|
gem 'rails', '~> 5.2.4.4'
|
||||||
gem 'sprockets', '~> 3.7.2'
|
gem 'sprockets', '~> 3.7.2'
|
||||||
gem 'thor', '~> 1.0'
|
gem 'thor', '~> 1.0'
|
||||||
@ -20,7 +20,7 @@ gem 'makara', '~> 0.4'
|
|||||||
gem 'pghero', '~> 2.7'
|
gem 'pghero', '~> 2.7'
|
||||||
gem 'dotenv-rails', '~> 2.7'
|
gem 'dotenv-rails', '~> 2.7'
|
||||||
|
|
||||||
gem 'aws-sdk-s3', '~> 1.81', require: false
|
gem 'aws-sdk-s3', '~> 1.83', require: false
|
||||||
gem 'fog-core', '<= 2.1.0'
|
gem 'fog-core', '<= 2.1.0'
|
||||||
gem 'fog-openstack', '~> 0.3', require: false
|
gem 'fog-openstack', '~> 0.3', require: false
|
||||||
gem 'paperclip', '~> 6.0'
|
gem 'paperclip', '~> 6.0'
|
||||||
@ -54,7 +54,6 @@ gem 'doorkeeper', '~> 5.4'
|
|||||||
gem 'ed25519', '~> 1.2'
|
gem 'ed25519', '~> 1.2'
|
||||||
gem 'fast_blank', '~> 1.0'
|
gem 'fast_blank', '~> 1.0'
|
||||||
gem 'fastimage'
|
gem 'fastimage'
|
||||||
gem 'goldfinger', '~> 2.1'
|
|
||||||
gem 'hiredis', '~> 0.6'
|
gem 'hiredis', '~> 0.6'
|
||||||
gem 'redis-namespace', '~> 1.8'
|
gem 'redis-namespace', '~> 1.8'
|
||||||
gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
|
gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
|
||||||
@ -127,12 +126,12 @@ group :test do
|
|||||||
gem 'rspec-sidekiq', '~> 3.1'
|
gem 'rspec-sidekiq', '~> 3.1'
|
||||||
gem 'simplecov', '~> 0.19', require: false
|
gem 'simplecov', '~> 0.19', require: false
|
||||||
gem 'webmock', '~> 3.9'
|
gem 'webmock', '~> 3.9'
|
||||||
gem 'parallel_tests', '~> 3.2'
|
gem 'parallel_tests', '~> 3.3'
|
||||||
gem 'rspec_junit_formatter', '~> 0.4'
|
gem 'rspec_junit_formatter', '~> 0.4'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'active_record_query_trace', '~> 1.7'
|
gem 'active_record_query_trace', '~> 1.8'
|
||||||
gem 'annotate', '~> 3.1'
|
gem 'annotate', '~> 3.1'
|
||||||
gem 'better_errors', '~> 2.8'
|
gem 'better_errors', '~> 2.8'
|
||||||
gem 'binding_of_caller', '~> 0.7'
|
gem 'binding_of_caller', '~> 0.7'
|
||||||
@ -140,9 +139,9 @@ group :development do
|
|||||||
gem 'letter_opener', '~> 1.7'
|
gem 'letter_opener', '~> 1.7'
|
||||||
gem 'letter_opener_web', '~> 1.4'
|
gem 'letter_opener_web', '~> 1.4'
|
||||||
gem 'memory_profiler'
|
gem 'memory_profiler'
|
||||||
gem 'rubocop', '~> 0.90', require: false
|
gem 'rubocop', '~> 0.93', require: false
|
||||||
gem 'rubocop-rails', '~> 2.8', require: false
|
gem 'rubocop-rails', '~> 2.8', require: false
|
||||||
gem 'brakeman', '~> 4.9', require: false
|
gem 'brakeman', '~> 4.10', require: false
|
||||||
gem 'bundler-audit', '~> 0.7', require: false
|
gem 'bundler-audit', '~> 0.7', require: false
|
||||||
|
|
||||||
gem 'capistrano', '~> 3.14'
|
gem 'capistrano', '~> 3.14'
|
||||||
@ -160,3 +159,6 @@ end
|
|||||||
|
|
||||||
gem 'concurrent-ruby', require: false
|
gem 'concurrent-ruby', require: false
|
||||||
gem 'connection_pool', require: false
|
gem 'connection_pool', require: false
|
||||||
|
|
||||||
|
gem 'xorcist', '~> 1.1'
|
||||||
|
gem 'pluck_each', '~> 0.1.3'
|
||||||
|
110
Gemfile.lock
110
Gemfile.lock
@ -44,7 +44,7 @@ GEM
|
|||||||
activemodel (>= 4.1, < 6.1)
|
activemodel (>= 4.1, < 6.1)
|
||||||
case_transform (>= 0.2)
|
case_transform (>= 0.2)
|
||||||
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
||||||
active_record_query_trace (1.7)
|
active_record_query_trace (1.8)
|
||||||
activejob (5.2.4.4)
|
activejob (5.2.4.4)
|
||||||
activesupport (= 5.2.4.4)
|
activesupport (= 5.2.4.4)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
@ -79,23 +79,23 @@ GEM
|
|||||||
cocaine (~> 0.5.3)
|
cocaine (~> 0.5.3)
|
||||||
awrence (1.1.1)
|
awrence (1.1.1)
|
||||||
aws-eventstream (1.1.0)
|
aws-eventstream (1.1.0)
|
||||||
aws-partitions (1.373.0)
|
aws-partitions (1.385.0)
|
||||||
aws-sdk-core (3.107.0)
|
aws-sdk-core (3.109.1)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
aws-partitions (~> 1, >= 1.239.0)
|
aws-partitions (~> 1, >= 1.239.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
jmespath (~> 1.0)
|
jmespath (~> 1.0)
|
||||||
aws-sdk-kms (1.38.0)
|
aws-sdk-kms (1.39.0)
|
||||||
aws-sdk-core (~> 3, >= 3.99.0)
|
aws-sdk-core (~> 3, >= 3.109.0)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sdk-s3 (1.81.0)
|
aws-sdk-s3 (1.83.1)
|
||||||
aws-sdk-core (~> 3, >= 3.104.3)
|
aws-sdk-core (~> 3, >= 3.109.0)
|
||||||
aws-sdk-kms (~> 1)
|
aws-sdk-kms (~> 1)
|
||||||
aws-sigv4 (~> 1.1)
|
aws-sigv4 (~> 1.1)
|
||||||
aws-sigv4 (1.2.2)
|
aws-sigv4 (1.2.2)
|
||||||
aws-eventstream (~> 1, >= 1.0.2)
|
aws-eventstream (~> 1, >= 1.0.2)
|
||||||
bcrypt (3.1.16)
|
bcrypt (3.1.16)
|
||||||
better_errors (2.8.1)
|
better_errors (2.8.3)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubi (>= 1.0.0)
|
erubi (>= 1.0.0)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
@ -106,7 +106,7 @@ GEM
|
|||||||
ffi (~> 1.10.0)
|
ffi (~> 1.10.0)
|
||||||
bootsnap (1.4.8)
|
bootsnap (1.4.8)
|
||||||
msgpack (~> 1.0)
|
msgpack (~> 1.0)
|
||||||
brakeman (4.9.1)
|
brakeman (4.10.0)
|
||||||
browser (4.2.0)
|
browser (4.2.0)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
bullet (6.1.0)
|
bullet (6.1.0)
|
||||||
@ -160,13 +160,12 @@ GEM
|
|||||||
cose (1.0.0)
|
cose (1.0.0)
|
||||||
cbor (~> 0.5.9)
|
cbor (~> 0.5.9)
|
||||||
openssl-signature_algorithm (~> 0.4.0)
|
openssl-signature_algorithm (~> 0.4.0)
|
||||||
crack (0.4.3)
|
crack (0.4.4)
|
||||||
safe_yaml (~> 1.0.0)
|
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
css_parser (1.7.1)
|
css_parser (1.7.1)
|
||||||
addressable
|
addressable
|
||||||
debug_inspector (0.0.3)
|
debug_inspector (0.0.3)
|
||||||
devise (4.7.2)
|
devise (4.7.3)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
orm_adapter (~> 0.1)
|
orm_adapter (~> 0.1)
|
||||||
railties (>= 4.1.0)
|
railties (>= 4.1.0)
|
||||||
@ -233,7 +232,7 @@ GEM
|
|||||||
fog-json (>= 1.0)
|
fog-json (>= 1.0)
|
||||||
ipaddress (>= 0.8)
|
ipaddress (>= 0.8)
|
||||||
formatador (0.2.5)
|
formatador (0.2.5)
|
||||||
fugit (1.3.8)
|
fugit (1.3.9)
|
||||||
et-orbi (~> 1.1, >= 1.1.8)
|
et-orbi (~> 1.1, >= 1.1.8)
|
||||||
raabro (~> 1.3)
|
raabro (~> 1.3)
|
||||||
fuubar (2.5.0)
|
fuubar (2.5.0)
|
||||||
@ -241,12 +240,7 @@ GEM
|
|||||||
ruby-progressbar (~> 1.4)
|
ruby-progressbar (~> 1.4)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
goldfinger (2.1.1)
|
hamlit (2.13.0)
|
||||||
addressable (~> 2.5)
|
|
||||||
http (~> 4.0)
|
|
||||||
nokogiri (~> 1.8)
|
|
||||||
oj (~> 3.0)
|
|
||||||
hamlit (2.11.1)
|
|
||||||
temple (>= 0.8.2)
|
temple (>= 0.8.2)
|
||||||
thor
|
thor
|
||||||
tilt
|
tilt
|
||||||
@ -363,7 +357,7 @@ GEM
|
|||||||
net-scp (3.0.0)
|
net-scp (3.0.0)
|
||||||
net-ssh (>= 2.6.5, < 7.0.0)
|
net-ssh (>= 2.6.5, < 7.0.0)
|
||||||
net-ssh (6.1.0)
|
net-ssh (6.1.0)
|
||||||
nio4r (2.5.3)
|
nio4r (2.5.4)
|
||||||
nokogiri (1.10.10)
|
nokogiri (1.10.10)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
nokogumbo (2.0.2)
|
nokogumbo (2.0.2)
|
||||||
@ -373,7 +367,7 @@ GEM
|
|||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
sidekiq (>= 3.5)
|
sidekiq (>= 3.5)
|
||||||
statsd-ruby (~> 1.4, >= 1.4.0)
|
statsd-ruby (~> 1.4, >= 1.4.0)
|
||||||
oj (3.10.14)
|
oj (3.10.15)
|
||||||
omniauth (1.9.1)
|
omniauth (1.9.1)
|
||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 1.6.2, < 3)
|
rack (>= 1.6.2, < 3)
|
||||||
@ -381,7 +375,7 @@ GEM
|
|||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
nokogiri (~> 1.5)
|
nokogiri (~> 1.5)
|
||||||
omniauth (~> 1.2)
|
omniauth (~> 1.2)
|
||||||
omniauth-saml (1.10.2)
|
omniauth-saml (1.10.3)
|
||||||
omniauth (~> 1.3, >= 1.3.2)
|
omniauth (~> 1.3, >= 1.3.2)
|
||||||
ruby-saml (~> 1.9)
|
ruby-saml (~> 1.9)
|
||||||
openssl (2.2.0)
|
openssl (2.2.0)
|
||||||
@ -398,9 +392,9 @@ GEM
|
|||||||
av (~> 0.9.0)
|
av (~> 0.9.0)
|
||||||
paperclip (>= 2.5.2)
|
paperclip (>= 2.5.2)
|
||||||
parallel (1.19.2)
|
parallel (1.19.2)
|
||||||
parallel_tests (3.2.0)
|
parallel_tests (3.3.0)
|
||||||
parallel
|
parallel
|
||||||
parser (2.7.1.4)
|
parser (2.7.2.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
parslet (2.0.0)
|
parslet (2.0.0)
|
||||||
pastel (0.8.0)
|
pastel (0.8.0)
|
||||||
@ -408,9 +402,12 @@ GEM
|
|||||||
pg (1.2.3)
|
pg (1.2.3)
|
||||||
pghero (2.7.2)
|
pghero (2.7.2)
|
||||||
activerecord (>= 5)
|
activerecord (>= 5)
|
||||||
pkg-config (1.4.2)
|
pkg-config (1.4.4)
|
||||||
|
pluck_each (0.1.3)
|
||||||
|
activerecord (> 3.2.0)
|
||||||
|
activesupport (> 3.0.0)
|
||||||
posix-spawn (0.3.15)
|
posix-spawn (0.3.15)
|
||||||
premailer (1.13.1)
|
premailer (1.14.2)
|
||||||
addressable
|
addressable
|
||||||
css_parser (>= 1.6.0)
|
css_parser (>= 1.6.0)
|
||||||
htmlentities (>= 4.0.0)
|
htmlentities (>= 4.0.0)
|
||||||
@ -427,11 +424,11 @@ GEM
|
|||||||
pry-rails (0.3.9)
|
pry-rails (0.3.9)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (4.0.6)
|
public_suffix (4.0.6)
|
||||||
puma (4.3.6)
|
puma (5.0.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.1.0)
|
pundit (2.1.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
raabro (1.3.1)
|
raabro (1.3.3)
|
||||||
rack (2.2.3)
|
rack (2.2.3)
|
||||||
rack-attack (6.3.1)
|
rack-attack (6.3.1)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
@ -500,7 +497,7 @@ GEM
|
|||||||
redis-store (>= 1.2, < 2)
|
redis-store (>= 1.2, < 2)
|
||||||
redis-store (1.9.0)
|
redis-store (1.9.0)
|
||||||
redis (>= 4, < 5)
|
redis (>= 4, < 5)
|
||||||
regexp_parser (1.7.1)
|
regexp_parser (1.8.2)
|
||||||
request_store (1.5.0)
|
request_store (1.5.0)
|
||||||
rack (>= 1.4)
|
rack (>= 1.4)
|
||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
@ -513,7 +510,7 @@ GEM
|
|||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
rqrcode_core (~> 0.1)
|
rqrcode_core (~> 0.1)
|
||||||
rqrcode_core (0.1.2)
|
rqrcode_core (0.1.2)
|
||||||
rspec-core (3.9.2)
|
rspec-core (3.9.3)
|
||||||
rspec-support (~> 3.9.3)
|
rspec-support (~> 3.9.3)
|
||||||
rspec-expectations (3.9.2)
|
rspec-expectations (3.9.2)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
@ -535,18 +532,18 @@ GEM
|
|||||||
rspec-support (3.9.3)
|
rspec-support (3.9.3)
|
||||||
rspec_junit_formatter (0.4.1)
|
rspec_junit_formatter (0.4.1)
|
||||||
rspec-core (>= 2, < 4, != 2.12.0)
|
rspec-core (>= 2, < 4, != 2.12.0)
|
||||||
rubocop (0.90.0)
|
rubocop (0.93.1)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.7.1.1)
|
parser (>= 2.7.1.5)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.7)
|
regexp_parser (>= 1.8)
|
||||||
rexml
|
rexml
|
||||||
rubocop-ast (>= 0.3.0, < 1.0)
|
rubocop-ast (>= 0.6.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 2.0)
|
unicode-display_width (>= 1.4.0, < 2.0)
|
||||||
rubocop-ast (0.4.0)
|
rubocop-ast (0.8.0)
|
||||||
parser (>= 2.7.1.4)
|
parser (>= 2.7.1.5)
|
||||||
rubocop-rails (2.8.0)
|
rubocop-rails (2.8.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 0.87.0)
|
rubocop (>= 0.87.0)
|
||||||
@ -555,7 +552,6 @@ GEM
|
|||||||
nokogiri (>= 1.5.10)
|
nokogiri (>= 1.5.10)
|
||||||
rufus-scheduler (3.6.0)
|
rufus-scheduler (3.6.0)
|
||||||
fugit (~> 1.1, >= 1.1.6)
|
fugit (~> 1.1, >= 1.1.6)
|
||||||
safe_yaml (1.0.5)
|
|
||||||
safety_net_attestation (0.4.0)
|
safety_net_attestation (0.4.0)
|
||||||
jwt (~> 2.0)
|
jwt (~> 2.0)
|
||||||
sanitize (5.2.1)
|
sanitize (5.2.1)
|
||||||
@ -577,19 +573,19 @@ GEM
|
|||||||
sidekiq (>= 3)
|
sidekiq (>= 3)
|
||||||
thwait
|
thwait
|
||||||
tilt (>= 1.4.0)
|
tilt (>= 1.4.0)
|
||||||
sidekiq-unique-jobs (6.0.23)
|
sidekiq-unique-jobs (6.0.24)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.5)
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
||||||
sidekiq (>= 4.0, < 7.0)
|
sidekiq (>= 4.0, < 7.0)
|
||||||
thor (>= 0.20, < 2.0)
|
thor (>= 0.20, < 2.0)
|
||||||
simple-navigation (4.1.0)
|
simple-navigation (4.1.0)
|
||||||
activesupport (>= 2.3.2)
|
activesupport (>= 2.3.2)
|
||||||
simple_form (5.0.2)
|
simple_form (5.0.3)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
activemodel (>= 5.0)
|
activemodel (>= 5.0)
|
||||||
simplecov (0.19.0)
|
simplecov (0.19.1)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
simplecov-html (~> 0.11)
|
simplecov-html (~> 0.11)
|
||||||
simplecov-html (0.12.2)
|
simplecov-html (0.12.3)
|
||||||
sprockets (3.7.2)
|
sprockets (3.7.2)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
@ -600,12 +596,12 @@ GEM
|
|||||||
sshkit (1.21.0)
|
sshkit (1.21.0)
|
||||||
net-scp (>= 1.1.2)
|
net-scp (>= 1.1.2)
|
||||||
net-ssh (>= 2.8.0)
|
net-ssh (>= 2.8.0)
|
||||||
stackprof (0.2.15)
|
stackprof (0.2.16)
|
||||||
statsd-ruby (1.4.0)
|
statsd-ruby (1.4.0)
|
||||||
stoplight (2.2.1)
|
stoplight (2.2.1)
|
||||||
streamio-ffmpeg (3.0.2)
|
streamio-ffmpeg (3.0.2)
|
||||||
multi_json (~> 1.8)
|
multi_json (~> 1.8)
|
||||||
strong_migrations (0.7.1)
|
strong_migrations (0.7.2)
|
||||||
activerecord (>= 5)
|
activerecord (>= 5)
|
||||||
temple (0.8.2)
|
temple (0.8.2)
|
||||||
terminal-table (1.8.0)
|
terminal-table (1.8.0)
|
||||||
@ -634,7 +630,7 @@ GEM
|
|||||||
unf (~> 0.1.0)
|
unf (~> 0.1.0)
|
||||||
tzinfo (1.2.7)
|
tzinfo (1.2.7)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo-data (1.2020.1)
|
tzinfo-data (1.2020.4)
|
||||||
tzinfo (>= 1.0.0)
|
tzinfo (>= 1.0.0)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
@ -653,7 +649,7 @@ GEM
|
|||||||
safety_net_attestation (~> 0.4.0)
|
safety_net_attestation (~> 0.4.0)
|
||||||
securecompare (~> 1.0)
|
securecompare (~> 1.0)
|
||||||
tpm-key_attestation (~> 0.9.0)
|
tpm-key_attestation (~> 0.9.0)
|
||||||
webmock (3.9.1)
|
webmock (3.9.3)
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
@ -669,6 +665,7 @@ GEM
|
|||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
wisper (2.0.1)
|
wisper (2.0.1)
|
||||||
|
xorcist (1.1.2)
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
|
|
||||||
@ -677,15 +674,15 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_model_serializers (~> 0.10)
|
active_model_serializers (~> 0.10)
|
||||||
active_record_query_trace (~> 1.7)
|
active_record_query_trace (~> 1.8)
|
||||||
addressable (~> 2.7)
|
addressable (~> 2.7)
|
||||||
annotate (~> 3.1)
|
annotate (~> 3.1)
|
||||||
aws-sdk-s3 (~> 1.81)
|
aws-sdk-s3 (~> 1.83)
|
||||||
better_errors (~> 2.8)
|
better_errors (~> 2.8)
|
||||||
binding_of_caller (~> 0.7)
|
binding_of_caller (~> 0.7)
|
||||||
blurhash (~> 0.1)
|
blurhash (~> 0.1)
|
||||||
bootsnap (~> 1.4)
|
bootsnap (~> 1.4)
|
||||||
brakeman (~> 4.9)
|
brakeman (~> 4.10)
|
||||||
browser
|
browser
|
||||||
bullet (~> 6.1)
|
bullet (~> 6.1)
|
||||||
bundler-audit (~> 0.7)
|
bundler-audit (~> 0.7)
|
||||||
@ -716,7 +713,6 @@ DEPENDENCIES
|
|||||||
fog-core (<= 2.1.0)
|
fog-core (<= 2.1.0)
|
||||||
fog-openstack (~> 0.3)
|
fog-openstack (~> 0.3)
|
||||||
fuubar (~> 2.5)
|
fuubar (~> 2.5)
|
||||||
goldfinger (~> 2.1)
|
|
||||||
hamlit-rails (~> 0.2)
|
hamlit-rails (~> 0.2)
|
||||||
health_check!
|
health_check!
|
||||||
hiredis (~> 0.6)
|
hiredis (~> 0.6)
|
||||||
@ -751,17 +747,18 @@ DEPENDENCIES
|
|||||||
paperclip (~> 6.0)
|
paperclip (~> 6.0)
|
||||||
paperclip-av-transcoder (~> 0.6)
|
paperclip-av-transcoder (~> 0.6)
|
||||||
parallel (~> 1.19)
|
parallel (~> 1.19)
|
||||||
parallel_tests (~> 3.2)
|
parallel_tests (~> 3.3)
|
||||||
parslet
|
parslet
|
||||||
pg (~> 1.2)
|
pg (~> 1.2)
|
||||||
pghero (~> 2.7)
|
pghero (~> 2.7)
|
||||||
pkg-config (~> 1.4)
|
pkg-config (~> 1.4)
|
||||||
|
pluck_each (~> 0.1.3)
|
||||||
posix-spawn
|
posix-spawn
|
||||||
premailer-rails
|
premailer-rails
|
||||||
private_address_check (~> 0.5)
|
private_address_check (~> 0.5)
|
||||||
pry-byebug (~> 3.9)
|
pry-byebug (~> 3.9)
|
||||||
pry-rails (~> 0.3)
|
pry-rails (~> 0.3)
|
||||||
puma (~> 4.3)
|
puma (~> 5.0)
|
||||||
pundit (~> 2.1)
|
pundit (~> 2.1)
|
||||||
rack (~> 2.2.3)
|
rack (~> 2.2.3)
|
||||||
rack-attack (~> 6.3)
|
rack-attack (~> 6.3)
|
||||||
@ -778,7 +775,7 @@ DEPENDENCIES
|
|||||||
rspec-rails (~> 4.0)
|
rspec-rails (~> 4.0)
|
||||||
rspec-sidekiq (~> 3.1)
|
rspec-sidekiq (~> 3.1)
|
||||||
rspec_junit_formatter (~> 0.4)
|
rspec_junit_formatter (~> 0.4)
|
||||||
rubocop (~> 0.90)
|
rubocop (~> 0.93)
|
||||||
rubocop-rails (~> 2.8)
|
rubocop-rails (~> 2.8)
|
||||||
ruby-progressbar (~> 1.10)
|
ruby-progressbar (~> 1.10)
|
||||||
sanitize (~> 5.2)
|
sanitize (~> 5.2)
|
||||||
@ -804,9 +801,4 @@ DEPENDENCIES
|
|||||||
webmock (~> 3.9)
|
webmock (~> 3.9)
|
||||||
webpacker (~> 5.2)
|
webpacker (~> 5.2)
|
||||||
webpush
|
webpush
|
||||||
|
xorcist (~> 1.1)
|
||||||
RUBY VERSION
|
|
||||||
ruby 2.6.6p146
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
2.1.4
|
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ActivityPub::FollowersSynchronizationsController < ActivityPub::BaseController
|
||||||
|
include SignatureVerification
|
||||||
|
include AccountOwnedConcern
|
||||||
|
|
||||||
|
before_action :require_signature!
|
||||||
|
before_action :set_items
|
||||||
|
before_action :set_cache_headers
|
||||||
|
|
||||||
|
def show
|
||||||
|
expires_in 0, public: false
|
||||||
|
render json: collection_presenter,
|
||||||
|
serializer: ActivityPub::CollectionSerializer,
|
||||||
|
adapter: ActivityPub::Adapter,
|
||||||
|
content_type: 'application/activity+json'
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def uri_prefix
|
||||||
|
signed_request_account.uri[/http(s?):\/\/[^\/]+\//]
|
||||||
|
end
|
||||||
|
|
||||||
|
def set_items
|
||||||
|
@items = @account.followers.where(Account.arel_table[:uri].matches(uri_prefix + '%', false, true)).pluck(:uri)
|
||||||
|
end
|
||||||
|
|
||||||
|
def collection_presenter
|
||||||
|
ActivityPub::CollectionPresenter.new(
|
||||||
|
id: account_followers_synchronization_url(@account),
|
||||||
|
type: :ordered,
|
||||||
|
items: @items
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
@ -11,6 +11,7 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
upgrade_account
|
upgrade_account
|
||||||
|
process_collection_synchronization
|
||||||
process_payload
|
process_payload
|
||||||
head 202
|
head 202
|
||||||
end
|
end
|
||||||
@ -52,6 +53,19 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
|
|||||||
DeliveryFailureTracker.reset!(signed_request_account.inbox_url)
|
DeliveryFailureTracker.reset!(signed_request_account.inbox_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def process_collection_synchronization
|
||||||
|
raw_params = request.headers['Collection-Synchronization']
|
||||||
|
return if raw_params.blank? || ENV['DISABLE_FOLLOWERS_SYNCHRONIZATION'] == 'true'
|
||||||
|
|
||||||
|
# Re-using the syntax for signature parameters
|
||||||
|
tree = SignatureParamsParser.new.parse(raw_params)
|
||||||
|
params = SignatureParamsTransformer.new.apply(tree)
|
||||||
|
|
||||||
|
ActivityPub::PrepareFollowersSynchronizationService.new.call(signed_request_account, params)
|
||||||
|
rescue Parslet::ParseFailed
|
||||||
|
Rails.logger.warn 'Error parsing Collection-Synchronization header'
|
||||||
|
end
|
||||||
|
|
||||||
def process_payload
|
def process_payload
|
||||||
ActivityPub::ProcessingWorker.perform_async(signed_request_account.id, body, @account&.id)
|
ActivityPub::ProcessingWorker.perform_async(signed_request_account.id, body, @account&.id)
|
||||||
end
|
end
|
||||||
|
56
app/controllers/admin/ip_blocks_controller.rb
Normal file
56
app/controllers/admin/ip_blocks_controller.rb
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Admin
|
||||||
|
class IpBlocksController < BaseController
|
||||||
|
def index
|
||||||
|
authorize :ip_block, :index?
|
||||||
|
|
||||||
|
@ip_blocks = IpBlock.page(params[:page])
|
||||||
|
@form = Form::IpBlockBatch.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
authorize :ip_block, :create?
|
||||||
|
|
||||||
|
@ip_block = IpBlock.new(ip: '', severity: :no_access, expires_in: 1.year)
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
authorize :ip_block, :create?
|
||||||
|
|
||||||
|
@ip_block = IpBlock.new(resource_params)
|
||||||
|
|
||||||
|
if @ip_block.save
|
||||||
|
log_action :create, @ip_block
|
||||||
|
redirect_to admin_ip_blocks_path, notice: I18n.t('admin.ip_blocks.created_msg')
|
||||||
|
else
|
||||||
|
render :new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def batch
|
||||||
|
@form = Form::IpBlockBatch.new(form_ip_block_batch_params.merge(current_account: current_account, action: action_from_button))
|
||||||
|
@form.save
|
||||||
|
rescue ActionController::ParameterMissing
|
||||||
|
flash[:alert] = I18n.t('admin.ip_blocks.no_ip_block_selected')
|
||||||
|
rescue Mastodon::NotPermittedError
|
||||||
|
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
|
||||||
|
ensure
|
||||||
|
redirect_to admin_ip_blocks_path
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def resource_params
|
||||||
|
params.require(:ip_block).permit(:ip, :severity, :comment, :expires_in)
|
||||||
|
end
|
||||||
|
|
||||||
|
def action_from_button
|
||||||
|
'delete' if params[:delete]
|
||||||
|
end
|
||||||
|
|
||||||
|
def form_ip_block_batch_params
|
||||||
|
params.require(:form_ip_block_batch).permit(ip_block_ids: [])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -20,7 +20,7 @@ class Api::V1::AccountsController < Api::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
token = AppSignUpService.new.call(doorkeeper_token.application, account_params)
|
token = AppSignUpService.new.call(doorkeeper_token.application, request.remote_ip, account_params)
|
||||||
response = Doorkeeper::OAuth::TokenResponse.new(token)
|
response = Doorkeeper::OAuth::TokenResponse.new(token)
|
||||||
|
|
||||||
headers.merge!(response.headers)
|
headers.merge!(response.headers)
|
||||||
@ -42,7 +42,7 @@ class Api::V1::AccountsController < Api::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def mute
|
def mute
|
||||||
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications))
|
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications), duration: (params[:duration] || 0))
|
||||||
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships
|
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ class Api::V1::MutesController < Api::BaseController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@accounts = load_accounts
|
@accounts = load_accounts
|
||||||
render json: @accounts, each_serializer: REST::AccountSerializer
|
render json: @accounts, each_serializer: REST::MutedAccountSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -52,6 +52,6 @@ class Api::V1::Push::SubscriptionsController < Api::BaseController
|
|||||||
def data_params
|
def data_params
|
||||||
return {} if params[:data].blank?
|
return {} if params[:data].blank?
|
||||||
|
|
||||||
params.require(:data).permit(alerts: [:follow, :follow_request, :favourite, :reblog, :mention, :poll])
|
params.require(:data).permit(alerts: [:follow, :follow_request, :favourite, :reblog, :mention, :poll, :status])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -22,6 +22,7 @@ class Api::Web::PushSubscriptionsController < Api::Web::BaseController
|
|||||||
reblog: alerts_enabled,
|
reblog: alerts_enabled,
|
||||||
mention: alerts_enabled,
|
mention: alerts_enabled,
|
||||||
poll: alerts_enabled,
|
poll: alerts_enabled,
|
||||||
|
status: alerts_enabled,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,6 +58,6 @@ class Api::Web::PushSubscriptionsController < Api::Web::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def data_params
|
def data_params
|
||||||
@data_params ||= params.require(:data).permit(alerts: [:follow, :follow_request, :favourite, :reblog, :mention, :poll])
|
@data_params ||= params.require(:data).permit(alerts: [:follow, :follow_request, :favourite, :reblog, :mention, :poll, :status])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
|||||||
|
|
||||||
resource.locale = I18n.locale
|
resource.locale = I18n.locale
|
||||||
resource.invite_code = params[:invite_code] if resource.invite_code.blank?
|
resource.invite_code = params[:invite_code] if resource.invite_code.blank?
|
||||||
resource.current_sign_in_ip = request.remote_ip
|
resource.sign_up_ip = request.remote_ip
|
||||||
|
|
||||||
resource.build_account if resource.account.nil?
|
resource.build_account if resource.account.nil?
|
||||||
end
|
end
|
||||||
|
@ -9,7 +9,7 @@ class FiltersController < ApplicationController
|
|||||||
before_action :set_body_classes
|
before_action :set_body_classes
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@filters = current_account.custom_filters
|
@filters = current_account.custom_filters.order(:phrase)
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@ -43,6 +43,7 @@ class Settings::PreferencesController < Settings::BaseController
|
|||||||
:setting_display_media,
|
:setting_display_media,
|
||||||
:setting_expand_spoilers,
|
:setting_expand_spoilers,
|
||||||
:setting_reduce_motion,
|
:setting_reduce_motion,
|
||||||
|
:setting_disable_swiping,
|
||||||
:setting_system_font_ui,
|
:setting_system_font_ui,
|
||||||
:setting_noindex,
|
:setting_noindex,
|
||||||
:setting_theme,
|
:setting_theme,
|
||||||
|
@ -29,6 +29,8 @@ module Admin::ActionLogsHelper
|
|||||||
link_to record.target_account.acct, admin_account_path(record.target_account_id)
|
link_to record.target_account.acct, admin_account_path(record.target_account_id)
|
||||||
when 'Announcement'
|
when 'Announcement'
|
||||||
link_to truncate(record.text), edit_admin_announcement_path(record.id)
|
link_to truncate(record.text), edit_admin_announcement_path(record.id)
|
||||||
|
when 'IpBlock'
|
||||||
|
"#{record.ip}/#{record.ip.prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{record.severity}")})"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -48,6 +50,8 @@ module Admin::ActionLogsHelper
|
|||||||
end
|
end
|
||||||
when 'Announcement'
|
when 'Announcement'
|
||||||
truncate(attributes['text'].is_a?(Array) ? attributes['text'].last : attributes['text'])
|
truncate(attributes['text'].is_a?(Array) ? attributes['text'].last : attributes['text'])
|
||||||
|
when 'IpBlock'
|
||||||
|
"#{attributes['ip']}/#{attributes['ip'].prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{attributes['severity']}")})"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,38 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Monkey-patch on monkey-patch.
|
|
||||||
# Because it conflicts with the request.rb patch.
|
|
||||||
class HTTP::Timeout::PerOperationOriginal < HTTP::Timeout::PerOperation
|
|
||||||
def connect(socket_class, host, port, nodelay = false)
|
|
||||||
::Timeout.timeout(@connect_timeout, HTTP::TimeoutError) do
|
|
||||||
@socket = socket_class.open(host, port)
|
|
||||||
@socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) if nodelay
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module WebfingerHelper
|
module WebfingerHelper
|
||||||
def webfinger!(uri)
|
def webfinger!(uri)
|
||||||
hidden_service_uri = /\.(onion|i2p)(:\d+)?$/.match(uri)
|
Webfinger.new(uri).perform
|
||||||
|
|
||||||
raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if !Rails.configuration.x.access_to_hidden_service && hidden_service_uri
|
|
||||||
|
|
||||||
opts = {
|
|
||||||
ssl: !hidden_service_uri,
|
|
||||||
|
|
||||||
headers: {
|
|
||||||
'User-Agent': Mastodon::Version.user_agent,
|
|
||||||
},
|
|
||||||
|
|
||||||
timeout_class: HTTP::Timeout::PerOperationOriginal,
|
|
||||||
|
|
||||||
timeout_options: {
|
|
||||||
write_timeout: 10,
|
|
||||||
connect_timeout: 5,
|
|
||||||
read_timeout: 10,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
Goldfinger::Client.new(uri, opts.merge(Rails.configuration.x.http_client_proxy)).finger
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -257,11 +257,11 @@ export function unblockAccountFail(error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function muteAccount(id, notifications) {
|
export function muteAccount(id, notifications, duration=0) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
dispatch(muteAccountRequest(id));
|
dispatch(muteAccountRequest(id));
|
||||||
|
|
||||||
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications }).then(response => {
|
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => {
|
||||||
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
|
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
|
||||||
dispatch(muteAccountSuccess(response.data, getState().get('statuses')));
|
dispatch(muteAccountSuccess(response.data, getState().get('statuses')));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
@ -3,6 +3,9 @@ import { debounce } from 'lodash';
|
|||||||
import compareId from '../compare_id';
|
import compareId from '../compare_id';
|
||||||
import { showAlertForError } from './alerts';
|
import { showAlertForError } from './alerts';
|
||||||
|
|
||||||
|
export const MARKERS_FETCH_REQUEST = 'MARKERS_FETCH_REQUEST';
|
||||||
|
export const MARKERS_FETCH_SUCCESS = 'MARKERS_FETCH_SUCCESS';
|
||||||
|
export const MARKERS_FETCH_FAIL = 'MARKERS_FETCH_FAIL';
|
||||||
export const MARKERS_SUBMIT_SUCCESS = 'MARKERS_SUBMIT_SUCCESS';
|
export const MARKERS_SUBMIT_SUCCESS = 'MARKERS_SUBMIT_SUCCESS';
|
||||||
|
|
||||||
export const synchronouslySubmitMarkers = () => (dispatch, getState) => {
|
export const synchronouslySubmitMarkers = () => (dispatch, getState) => {
|
||||||
@ -58,7 +61,7 @@ const _buildParams = (state) => {
|
|||||||
const params = {};
|
const params = {};
|
||||||
|
|
||||||
const lastHomeId = state.getIn(['timelines', 'home', 'items']).find(item => item !== null);
|
const lastHomeId = state.getIn(['timelines', 'home', 'items']).find(item => item !== null);
|
||||||
const lastNotificationId = state.getIn(['notifications', 'items', 0, 'id']);
|
const lastNotificationId = state.getIn(['notifications', 'lastReadId']);
|
||||||
|
|
||||||
if (lastHomeId && compareId(lastHomeId, state.getIn(['markers', 'home'])) > 0) {
|
if (lastHomeId && compareId(lastHomeId, state.getIn(['markers', 'home'])) > 0) {
|
||||||
params.home = {
|
params.home = {
|
||||||
@ -97,6 +100,46 @@ export function submitMarkersSuccess({ home, notifications }) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export function submitMarkers() {
|
export function submitMarkers(params = {}) {
|
||||||
return (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState);
|
const result = (dispatch, getState) => debouncedSubmitMarkers(dispatch, getState);
|
||||||
|
if (params.immediate === true) {
|
||||||
|
debouncedSubmitMarkers.flush();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const fetchMarkers = () => (dispatch, getState) => {
|
||||||
|
const params = { timeline: ['notifications'] };
|
||||||
|
|
||||||
|
dispatch(fetchMarkersRequest());
|
||||||
|
|
||||||
|
api(getState).get('/api/v1/markers', { params }).then(response => {
|
||||||
|
dispatch(fetchMarkersSuccess(response.data));
|
||||||
|
}).catch(error => {
|
||||||
|
dispatch(fetchMarkersFail(error));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchMarkersRequest() {
|
||||||
|
return {
|
||||||
|
type: MARKERS_FETCH_REQUEST,
|
||||||
|
skipLoading: true,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchMarkersSuccess(markers) {
|
||||||
|
return {
|
||||||
|
type: MARKERS_FETCH_SUCCESS,
|
||||||
|
markers,
|
||||||
|
skipLoading: true,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function fetchMarkersFail(error) {
|
||||||
|
return {
|
||||||
|
type: MARKERS_FETCH_FAIL,
|
||||||
|
error,
|
||||||
|
skipLoading: true,
|
||||||
|
skipAlert: true,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,7 @@ export const MUTES_EXPAND_FAIL = 'MUTES_EXPAND_FAIL';
|
|||||||
|
|
||||||
export const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL';
|
export const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL';
|
||||||
export const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS';
|
export const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS';
|
||||||
|
export const MUTES_CHANGE_DURATION = 'MUTES_CHANGE_DURATION';
|
||||||
|
|
||||||
export function fetchMutes() {
|
export function fetchMutes() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
@ -104,3 +105,12 @@ export function toggleHideNotifications() {
|
|||||||
dispatch({ type: MUTES_TOGGLE_HIDE_NOTIFICATIONS });
|
dispatch({ type: MUTES_TOGGLE_HIDE_NOTIFICATIONS });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function changeMuteDuration(duration) {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch({
|
||||||
|
type: MUTES_CHANGE_DURATION,
|
||||||
|
duration,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -16,6 +16,7 @@ import { getFiltersRegex } from '../selectors';
|
|||||||
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
|
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
|
||||||
import compareId from 'mastodon/compare_id';
|
import compareId from 'mastodon/compare_id';
|
||||||
import { searchTextFromRawStatus } from 'mastodon/actions/importer/normalizer';
|
import { searchTextFromRawStatus } from 'mastodon/actions/importer/normalizer';
|
||||||
|
import { requestNotificationPermission } from '../utils/notifications';
|
||||||
|
|
||||||
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
||||||
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
|
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
|
||||||
@ -33,6 +34,12 @@ export const NOTIFICATIONS_LOAD_PENDING = 'NOTIFICATIONS_LOAD_PENDING';
|
|||||||
export const NOTIFICATIONS_MOUNT = 'NOTIFICATIONS_MOUNT';
|
export const NOTIFICATIONS_MOUNT = 'NOTIFICATIONS_MOUNT';
|
||||||
export const NOTIFICATIONS_UNMOUNT = 'NOTIFICATIONS_UNMOUNT';
|
export const NOTIFICATIONS_UNMOUNT = 'NOTIFICATIONS_UNMOUNT';
|
||||||
|
|
||||||
|
|
||||||
|
export const NOTIFICATIONS_MARK_AS_READ = 'NOTIFICATIONS_MARK_AS_READ';
|
||||||
|
|
||||||
|
export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT';
|
||||||
|
export const NOTIFICATIONS_SET_BROWSER_PERMISSION = 'NOTIFICATIONS_SET_BROWSER_PERMISSION';
|
||||||
|
|
||||||
defineMessages({
|
defineMessages({
|
||||||
mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
|
mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
|
||||||
group: { id: 'notifications.group', defaultMessage: '{count} notifications' },
|
group: { id: 'notifications.group', defaultMessage: '{count} notifications' },
|
||||||
@ -232,3 +239,47 @@ export const mountNotifications = () => ({
|
|||||||
export const unmountNotifications = () => ({
|
export const unmountNotifications = () => ({
|
||||||
type: NOTIFICATIONS_UNMOUNT,
|
type: NOTIFICATIONS_UNMOUNT,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const markNotificationsAsRead = () => ({
|
||||||
|
type: NOTIFICATIONS_MARK_AS_READ,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Browser support
|
||||||
|
export function setupBrowserNotifications() {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(setBrowserSupport('Notification' in window));
|
||||||
|
if ('Notification' in window) {
|
||||||
|
dispatch(setBrowserPermission(Notification.permission));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('Notification' in window && 'permissions' in navigator) {
|
||||||
|
navigator.permissions.query({ name: 'notifications' }).then((status) => {
|
||||||
|
status.onchange = () => dispatch(setBrowserPermission(Notification.permission));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function requestBrowserPermission(callback = noOp) {
|
||||||
|
return dispatch => {
|
||||||
|
requestNotificationPermission((permission) => {
|
||||||
|
dispatch(setBrowserPermission(permission));
|
||||||
|
callback(permission);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export function setBrowserSupport (value) {
|
||||||
|
return {
|
||||||
|
type: NOTIFICATIONS_SET_BROWSER_SUPPORT,
|
||||||
|
value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setBrowserPermission (value) {
|
||||||
|
return {
|
||||||
|
type: NOTIFICATIONS_SET_BROWSER_PERMISSION,
|
||||||
|
value,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -1,8 +1,21 @@
|
|||||||
import { changeSetting, saveSettings } from './settings';
|
import { changeSetting, saveSettings } from './settings';
|
||||||
|
import { requestBrowserPermission } from './notifications';
|
||||||
|
|
||||||
export const INTRODUCTION_VERSION = 20181216044202;
|
export const INTRODUCTION_VERSION = 20181216044202;
|
||||||
|
|
||||||
export const closeOnboarding = () => dispatch => {
|
export const closeOnboarding = () => dispatch => {
|
||||||
dispatch(changeSetting(['introductionVersion'], INTRODUCTION_VERSION));
|
dispatch(changeSetting(['introductionVersion'], INTRODUCTION_VERSION));
|
||||||
dispatch(saveSettings());
|
dispatch(saveSettings());
|
||||||
|
|
||||||
|
dispatch(requestBrowserPermission((permission) => {
|
||||||
|
if (permission === 'granted') {
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'follow'], true));
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'favourite'], true));
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'reblog'], true));
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'mention'], true));
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'poll'], true));
|
||||||
|
dispatch(changeSetting(['notifications', 'alerts', 'status'], true));
|
||||||
|
dispatch(saveSettings());
|
||||||
|
}
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
|
38
app/javascript/mastodon/actions/picture_in_picture.js
Normal file
38
app/javascript/mastodon/actions/picture_in_picture.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
export const PICTURE_IN_PICTURE_DEPLOY = 'PICTURE_IN_PICTURE_DEPLOY';
|
||||||
|
export const PICTURE_IN_PICTURE_REMOVE = 'PICTURE_IN_PICTURE_REMOVE';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef MediaProps
|
||||||
|
* @property {string} src
|
||||||
|
* @property {boolean} muted
|
||||||
|
* @property {number} volume
|
||||||
|
* @property {number} currentTime
|
||||||
|
* @property {string} poster
|
||||||
|
* @property {string} backgroundColor
|
||||||
|
* @property {string} foregroundColor
|
||||||
|
* @property {string} accentColor
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} statusId
|
||||||
|
* @param {string} accountId
|
||||||
|
* @param {string} playerType
|
||||||
|
* @param {MediaProps} props
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export const deployPictureInPicture = (statusId, accountId, playerType, props) => ({
|
||||||
|
type: PICTURE_IN_PICTURE_DEPLOY,
|
||||||
|
statusId,
|
||||||
|
accountId,
|
||||||
|
playerType,
|
||||||
|
props,
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @return {object}
|
||||||
|
*/
|
||||||
|
export const removePictureInPicture = () => ({
|
||||||
|
type: PICTURE_IN_PICTURE_REMOVE,
|
||||||
|
});
|
@ -8,6 +8,7 @@ import IconButton from './icon_button';
|
|||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import { me } from '../initial_state';
|
import { me } from '../initial_state';
|
||||||
|
import RelativeTimestamp from './relative_timestamp';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
||||||
@ -107,11 +108,17 @@ class Account extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mute_expires_at;
|
||||||
|
if (account.get('mute_expires_at')) {
|
||||||
|
mute_expires_at = <div><RelativeTimestamp timestamp={account.get('mute_expires_at')} futureDate /></div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='account'>
|
<div className='account'>
|
||||||
<div className='account__wrapper'>
|
<div className='account__wrapper'>
|
||||||
<Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/accounts/${account.get('id')}`}>
|
<Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/accounts/${account.get('id')}`}>
|
||||||
<div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
|
<div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
|
||||||
|
{mute_expires_at}
|
||||||
<DisplayName account={account} />
|
<DisplayName account={account} />
|
||||||
</Permalink>
|
</Permalink>
|
||||||
|
|
||||||
|
@ -5,10 +5,21 @@ import TransitionMotion from 'react-motion/lib/TransitionMotion';
|
|||||||
import spring from 'react-motion/lib/spring';
|
import spring from 'react-motion/lib/spring';
|
||||||
import { reduceMotion } from 'mastodon/initial_state';
|
import { reduceMotion } from 'mastodon/initial_state';
|
||||||
|
|
||||||
|
const obfuscatedCount = count => {
|
||||||
|
if (count < 0) {
|
||||||
|
return 0;
|
||||||
|
} else if (count <= 1) {
|
||||||
|
return count;
|
||||||
|
} else {
|
||||||
|
return '1+';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export default class AnimatedNumber extends React.PureComponent {
|
export default class AnimatedNumber extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
value: PropTypes.number.isRequired,
|
value: PropTypes.number.isRequired,
|
||||||
|
obfuscate: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -36,11 +47,11 @@ export default class AnimatedNumber extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { value } = this.props;
|
const { value, obfuscate } = this.props;
|
||||||
const { direction } = this.state;
|
const { direction } = this.state;
|
||||||
|
|
||||||
if (reduceMotion) {
|
if (reduceMotion) {
|
||||||
return <FormattedNumber value={value} />;
|
return obfuscate ? obfuscatedCount(value) : <FormattedNumber value={value} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = [{
|
const styles = [{
|
||||||
@ -54,7 +65,7 @@ export default class AnimatedNumber extends React.PureComponent {
|
|||||||
{items => (
|
{items => (
|
||||||
<span className='animated-number'>
|
<span className='animated-number'>
|
||||||
{items.map(({ key, data, style }) => (
|
{items.map(({ key, data, style }) => (
|
||||||
<span key={key} style={{ position: (direction * style.y) > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}><FormattedNumber value={data} /></span>
|
<span key={key} style={{ position: (direction * style.y) > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : <FormattedNumber value={data} />}</span>
|
||||||
))}
|
))}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light';
|
import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light';
|
||||||
|
import { assetHost } from 'mastodon/utils/config';
|
||||||
const assetHost = process.env.CDN_HOST || '';
|
|
||||||
|
|
||||||
export default class AutosuggestEmoji extends React.PureComponent {
|
export default class AutosuggestEmoji extends React.PureComponent {
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
|
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
@ -33,6 +33,8 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
onPin: PropTypes.func,
|
onPin: PropTypes.func,
|
||||||
onMove: PropTypes.func,
|
onMove: PropTypes.func,
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
|
appendContent: PropTypes.node,
|
||||||
|
collapseIssues: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -46,32 +48,32 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
} else {
|
} else {
|
||||||
this.context.router.history.goBack();
|
this.context.router.history.goBack();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleToggleClick = (e) => {
|
handleToggleClick = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.setState({ collapsed: !this.state.collapsed, animating: true });
|
this.setState({ collapsed: !this.state.collapsed, animating: true });
|
||||||
};
|
}
|
||||||
|
|
||||||
handleTitleClick = () => {
|
handleTitleClick = () => {
|
||||||
this.props.onClick();
|
this.props.onClick();
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMoveLeft = () => {
|
handleMoveLeft = () => {
|
||||||
this.props.onMove(-1);
|
this.props.onMove(-1);
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMoveRight = () => {
|
handleMoveRight = () => {
|
||||||
this.props.onMove(1);
|
this.props.onMove(1);
|
||||||
};
|
}
|
||||||
|
|
||||||
handleBackClick = () => {
|
handleBackClick = () => {
|
||||||
this.historyBack();
|
this.historyBack();
|
||||||
};
|
}
|
||||||
|
|
||||||
handleTransitionEnd = () => {
|
handleTransitionEnd = () => {
|
||||||
this.setState({ animating: false });
|
this.setState({ animating: false });
|
||||||
};
|
}
|
||||||
|
|
||||||
handlePin = () => {
|
handlePin = () => {
|
||||||
if (!this.props.pinned) {
|
if (!this.props.pinned) {
|
||||||
@ -79,10 +81,10 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.props.onPin();
|
this.props.onPin();
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder } = this.props;
|
const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props;
|
||||||
const { collapsed, animating } = this.state;
|
const { collapsed, animating } = this.state;
|
||||||
|
|
||||||
const wrapperClassName = classNames('column-header__wrapper', {
|
const wrapperClassName = classNames('column-header__wrapper', {
|
||||||
@ -106,81 +108,30 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
|
|
||||||
if (children) {
|
if (children) {
|
||||||
extraContent = (
|
extraContent = (
|
||||||
<div
|
<div key='extra-content' className='column-header__collapsible__extra'>
|
||||||
key='extra-content'
|
|
||||||
className='column-header__collapsible__extra'
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiColumn && pinned) {
|
if (multiColumn && pinned) {
|
||||||
pinButton =
|
pinButton = <button key='pin-button' className='text-btn column-header__setting-btn' onClick={this.handlePin}><Icon id='times' /> <FormattedMessage id='column_header.unpin' defaultMessage='Unpin' /></button>;
|
||||||
(<button
|
|
||||||
key='pin-button'
|
|
||||||
className='text-btn column-header__setting-btn'
|
|
||||||
onClick={this.handlePin}
|
|
||||||
><Icon
|
|
||||||
id='times'
|
|
||||||
/> <FormattedMessage
|
|
||||||
id='column_header.unpin'
|
|
||||||
defaultMessage='Unpin'
|
|
||||||
/></button >);
|
|
||||||
|
|
||||||
moveButtons = (
|
moveButtons = (
|
||||||
<div
|
<div key='move-buttons' className='column-header__setting-arrows'>
|
||||||
key='move-buttons'
|
<button title={formatMessage(messages.moveLeft)} aria-label={formatMessage(messages.moveLeft)} className='text-btn column-header__setting-btn' onClick={this.handleMoveLeft}><Icon id='chevron-left' /></button>
|
||||||
className='column-header__setting-arrows'
|
<button title={formatMessage(messages.moveRight)} aria-label={formatMessage(messages.moveRight)} className='text-btn column-header__setting-btn' onClick={this.handleMoveRight}><Icon id='chevron-right' /></button>
|
||||||
>
|
|
||||||
<button
|
|
||||||
title={formatMessage(messages.moveLeft)}
|
|
||||||
aria-label={formatMessage(messages.moveLeft)}
|
|
||||||
className='text-btn column-header__setting-btn'
|
|
||||||
onClick={this.handleMoveLeft}
|
|
||||||
><Icon
|
|
||||||
id='chevron-left'
|
|
||||||
/></button >
|
|
||||||
<button
|
|
||||||
title={formatMessage(messages.moveRight)}
|
|
||||||
aria-label={formatMessage(messages.moveRight)}
|
|
||||||
className='text-btn column-header__setting-btn'
|
|
||||||
onClick={this.handleMoveRight}
|
|
||||||
><Icon
|
|
||||||
id='chevron-right'
|
|
||||||
/></button >
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (multiColumn && this.props.onPin) {
|
} else if (multiColumn && this.props.onPin) {
|
||||||
pinButton =
|
pinButton = <button key='pin-button' className='text-btn column-header__setting-btn' onClick={this.handlePin}><Icon id='plus' /> <FormattedMessage id='column_header.pin' defaultMessage='Pin' /></button>;
|
||||||
(<button
|
|
||||||
key='pin-button'
|
|
||||||
className='text-btn column-header__setting-btn'
|
|
||||||
onClick={this.handlePin}
|
|
||||||
><Icon
|
|
||||||
id='plus'
|
|
||||||
/> <FormattedMessage
|
|
||||||
id='column_header.pin'
|
|
||||||
defaultMessage='Pin'
|
|
||||||
/>
|
|
||||||
</button >);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pinned && (multiColumn || showBackButton)) {
|
if (!pinned && (multiColumn || showBackButton)) {
|
||||||
backButton = (
|
backButton = (
|
||||||
<button
|
<button onClick={this.handleBackClick} className='column-header__back-button'>
|
||||||
onClick={this.handleBackClick}
|
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
||||||
className='column-header__back-button'
|
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
id='chevron-left'
|
|
||||||
className='column-back-button__icon'
|
|
||||||
fixedWidth
|
|
||||||
/>
|
|
||||||
<FormattedMessage
|
|
||||||
id='column_back_button.label'
|
|
||||||
defaultMessage='Back'
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -195,16 +146,20 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (children || (multiColumn && this.props.onPin)) {
|
if (children || (multiColumn && this.props.onPin)) {
|
||||||
collapseButton =
|
collapseButton = (
|
||||||
(<button
|
<button
|
||||||
className={collapsibleButtonClassName}
|
className={collapsibleButtonClassName}
|
||||||
title={formatMessage(collapsed ? messages.show : messages.hide)}
|
title={formatMessage(collapsed ? messages.show : messages.hide)}
|
||||||
aria-label={formatMessage(collapsed ? messages.show : messages.hide)}
|
aria-label={formatMessage(collapsed ? messages.show : messages.hide)}
|
||||||
aria-pressed={collapsed ? 'false' : 'true'}
|
aria-pressed={collapsed ? 'false' : 'true'}
|
||||||
onClick={this.handleToggleClick}
|
onClick={this.handleToggleClick}
|
||||||
>
|
>
|
||||||
|
<i className='icon-with-badge'>
|
||||||
<Icon id='sliders' />
|
<Icon id='sliders' />
|
||||||
</button >);
|
{collapseIssues && <i className='icon-with-badge__issue-badge' />}
|
||||||
|
</i>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasTitle = icon && title;
|
const hasTitle = icon && title;
|
||||||
@ -214,11 +169,7 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
<h1 className={buttonClassName}>
|
<h1 className={buttonClassName}>
|
||||||
{hasTitle && (
|
{hasTitle && (
|
||||||
<button onClick={this.handleTitleClick}>
|
<button onClick={this.handleTitleClick}>
|
||||||
<Icon
|
<Icon id={icon} fixedWidth className='column-header__icon' />
|
||||||
id={icon}
|
|
||||||
fixedWidth
|
|
||||||
className='column-header__icon'
|
|
||||||
/>
|
|
||||||
{title}
|
{title}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
@ -232,15 +183,13 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div
|
<div className={collapsibleClassName} tabIndex={collapsed ? -1 : null} onTransitionEnd={this.handleTransitionEnd}>
|
||||||
className={collapsibleClassName}
|
|
||||||
tabIndex={collapsed ? -1 : null}
|
|
||||||
onTransitionEnd={this.handleTransitionEnd}
|
|
||||||
>
|
|
||||||
<div className='column-header__collapsible-inner'>
|
<div className='column-header__collapsible-inner'>
|
||||||
{(!collapsed || animating) && collapsedContent}
|
{(!collapsed || animating) && collapsedContent}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{appendContent}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
|
import AnimatedNumber from 'mastodon/components/animated_number';
|
||||||
|
|
||||||
export default class IconButton extends React.PureComponent {
|
export default class IconButton extends React.PureComponent {
|
||||||
|
|
||||||
@ -24,6 +25,8 @@ export default class IconButton extends React.PureComponent {
|
|||||||
animate: PropTypes.bool,
|
animate: PropTypes.bool,
|
||||||
overlay: PropTypes.bool,
|
overlay: PropTypes.bool,
|
||||||
tabIndex: PropTypes.string,
|
tabIndex: PropTypes.string,
|
||||||
|
counter: PropTypes.number,
|
||||||
|
obfuscateCount: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -38,7 +41,7 @@ export default class IconButton extends React.PureComponent {
|
|||||||
state = {
|
state = {
|
||||||
activate: false,
|
activate: false,
|
||||||
deactivate: false,
|
deactivate: false,
|
||||||
};
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (!nextProps.animate) return;
|
if (!nextProps.animate) return;
|
||||||
@ -56,32 +59,32 @@ export default class IconButton extends React.PureComponent {
|
|||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onClick(e);
|
this.props.onClick(e);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
if (this.props.onKeyPress && !this.props.disabled) {
|
if (this.props.onKeyPress && !this.props.disabled) {
|
||||||
this.props.onKeyPress(e);
|
this.props.onKeyPress(e);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMouseDown = (e) => {
|
handleMouseDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onMouseDown) {
|
if (!this.props.disabled && this.props.onMouseDown) {
|
||||||
this.props.onMouseDown(e);
|
this.props.onMouseDown(e);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onKeyDown) {
|
if (!this.props.disabled && this.props.onKeyDown) {
|
||||||
this.props.onKeyDown(e);
|
this.props.onKeyDown(e);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const style = {
|
const style = {
|
||||||
// fontSize: `${this.props.size}px`,
|
fontSize: `${this.props.size}px`,
|
||||||
// width: `${this.props.size * 1.28571429}px`,
|
width: `${this.props.size * 1.28571429}px`,
|
||||||
// height: `${this.props.size * 1.28571429}px`,
|
height: `${this.props.size * 1.28571429}px`,
|
||||||
// lineHeight: `${this.props.size}px`,
|
lineHeight: `${this.props.size}px`,
|
||||||
...this.props.style,
|
...this.props.style,
|
||||||
...(this.props.active ? this.props.activeStyle : {}),
|
...(this.props.active ? this.props.activeStyle : {}),
|
||||||
};
|
};
|
||||||
@ -97,6 +100,8 @@ export default class IconButton extends React.PureComponent {
|
|||||||
pressed,
|
pressed,
|
||||||
tabIndex,
|
tabIndex,
|
||||||
title,
|
title,
|
||||||
|
counter,
|
||||||
|
obfuscateCount,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -111,8 +116,13 @@ export default class IconButton extends React.PureComponent {
|
|||||||
activate,
|
activate,
|
||||||
deactivate,
|
deactivate,
|
||||||
overlayed: overlay,
|
overlayed: overlay,
|
||||||
|
'icon-button--with-counter': typeof counter !== 'undefined',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (typeof counter !== 'undefined') {
|
||||||
|
style.width = 'auto';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
aria-label={title}
|
aria-label={title}
|
||||||
@ -128,11 +138,7 @@ export default class IconButton extends React.PureComponent {
|
|||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon id={icon} fixedWidth aria-hidden='true' /> {typeof counter !== 'undefined' && <span className='icon-button__counter'><AnimatedNumber value={counter} obfuscate={obfuscateCount} /></span>}
|
||||||
id={icon}
|
|
||||||
fixedWidth
|
|
||||||
aria-hidden='true'
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -4,16 +4,18 @@ import Icon from 'mastodon/components/icon';
|
|||||||
|
|
||||||
const formatNumber = num => num > 40 ? '40+' : num;
|
const formatNumber = num => num > 40 ? '40+' : num;
|
||||||
|
|
||||||
const IconWithBadge = ({ id, count, className }) => (
|
const IconWithBadge = ({ id, count, issueBadge, className }) => (
|
||||||
<i className='icon-with-badge'>
|
<i className='icon-with-badge'>
|
||||||
<Icon id={id} fixedWidth className={className} />
|
<Icon id={id} fixedWidth className={className} />
|
||||||
{count > 0 && <i className='icon-with-badge__badge'>{formatNumber(count)}</i>}
|
{count > 0 && <i className='icon-with-badge__badge'>{formatNumber(count)}</i>}
|
||||||
|
{issueBadge && <i className='icon-with-badge__issue-badge' />}
|
||||||
</i>
|
</i>
|
||||||
);
|
);
|
||||||
|
|
||||||
IconWithBadge.propTypes = {
|
IconWithBadge.propTypes = {
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
count: PropTypes.number.isRequired,
|
count: PropTypes.number.isRequired,
|
||||||
|
issueBadge: PropTypes.bool,
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,10 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
|
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
|
||||||
import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
|
import getRectFromEntry from '../features/ui/util/get_rect_from_entry';
|
||||||
import { is } from 'immutable';
|
|
||||||
|
|
||||||
// Diff these props in the "rendered" state
|
|
||||||
const updateOnPropsForRendered = ['id', 'index', 'listLength'];
|
|
||||||
// Diff these props in the "unrendered" state
|
// Diff these props in the "unrendered" state
|
||||||
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
|
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
|
||||||
|
|
||||||
@ -33,9 +30,12 @@ export default class IntersectionObserverArticle extends React.Component {
|
|||||||
// If we're going from rendered to unrendered (or vice versa) then update
|
// If we're going from rendered to unrendered (or vice versa) then update
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Otherwise, diff based on props
|
// If we are and remain hidden, diff based on props
|
||||||
const propsToDiff = isUnrendered ? updateOnPropsForUnrendered : updateOnPropsForRendered;
|
if (isUnrendered) {
|
||||||
return !propsToDiff.every(prop => is(nextProps[prop], this.props[prop]));
|
return !updateOnPropsForUnrendered.every(prop => nextProps[prop] === this.props[prop]);
|
||||||
|
}
|
||||||
|
// Else, assume the children have changed
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Icon from 'mastodon/components/icon';
|
||||||
|
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { debounce } from 'lodash';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
export default @connect()
|
||||||
|
class PictureInPicturePlaceholder extends React.PureComponent {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
width: PropTypes.number,
|
||||||
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
width: this.props.width,
|
||||||
|
height: this.props.width && (this.props.width / (16/9)),
|
||||||
|
};
|
||||||
|
|
||||||
|
handleClick = () => {
|
||||||
|
const { dispatch } = this.props;
|
||||||
|
dispatch(removePictureInPicture());
|
||||||
|
}
|
||||||
|
|
||||||
|
setRef = c => {
|
||||||
|
this.node = c;
|
||||||
|
|
||||||
|
if (this.node) {
|
||||||
|
this._setDimensions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_setDimensions () {
|
||||||
|
const width = this.node.offsetWidth;
|
||||||
|
const height = width / (16/9);
|
||||||
|
|
||||||
|
this.setState({ width, height });
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
window.addEventListener('resize', this.handleResize, { passive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount () {
|
||||||
|
window.removeEventListener('resize', this.handleResize);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleResize = debounce(() => {
|
||||||
|
if (this.node) {
|
||||||
|
this._setDimensions();
|
||||||
|
}
|
||||||
|
}, 250, {
|
||||||
|
trailing: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { height } = this.state;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref={this.setRef} className='picture-in-picture-placeholder' style={{ height }} role='button' tabIndex='0' onClick={this.handleClick}>
|
||||||
|
<Icon id='window-restore' />
|
||||||
|
<FormattedMessage id='picture_in_picture.restore' defaultMessage='Put it back' />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -17,6 +17,7 @@ import { HotKeys } from 'react-hotkeys';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import { displayMedia } from '../initial_state';
|
import { displayMedia } from '../initial_state';
|
||||||
|
import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_placeholder';
|
||||||
|
|
||||||
// We use the component (and not the container) since we do not want
|
// We use the component (and not the container) since we do not want
|
||||||
// to use the progress bar to show download progress
|
// to use the progress bar to show download progress
|
||||||
@ -95,6 +96,8 @@ class Status extends ImmutablePureComponent {
|
|||||||
cacheMediaWidth: PropTypes.func,
|
cacheMediaWidth: PropTypes.func,
|
||||||
cachedMediaWidth: PropTypes.number,
|
cachedMediaWidth: PropTypes.number,
|
||||||
scrollKey: PropTypes.string,
|
scrollKey: PropTypes.string,
|
||||||
|
deployPictureInPicture: PropTypes.func,
|
||||||
|
usingPiP: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Avoid checking props that are functions (and whose equality will always
|
// Avoid checking props that are functions (and whose equality will always
|
||||||
@ -104,6 +107,8 @@ class Status extends ImmutablePureComponent {
|
|||||||
'account',
|
'account',
|
||||||
'muted',
|
'muted',
|
||||||
'hidden',
|
'hidden',
|
||||||
|
'unread',
|
||||||
|
'usingPiP',
|
||||||
];
|
];
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -205,6 +210,13 @@ class Status extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleDeployPictureInPicture = (type, mediaProps) => {
|
||||||
|
const { deployPictureInPicture } = this.props;
|
||||||
|
const status = this._properStatus();
|
||||||
|
|
||||||
|
deployPictureInPicture(status, type, mediaProps);
|
||||||
|
}
|
||||||
|
|
||||||
handleHotkeyReply = e => {
|
handleHotkeyReply = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onReply(this._properStatus(), this.context.router.history);
|
this.props.onReply(this._properStatus(), this.context.router.history);
|
||||||
@ -265,7 +277,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
let media = null;
|
let media = null;
|
||||||
let statusAvatar, prepend, rebloggedByText;
|
let statusAvatar, prepend, rebloggedByText;
|
||||||
|
|
||||||
const { intl, hidden, featured, otherAccounts, unread, showThread, scrollKey } = this.props;
|
const { intl, hidden, featured, otherAccounts, unread, showThread, scrollKey, usingPiP } = this.props;
|
||||||
|
|
||||||
let { status, account, ...other } = this.props;
|
let { status, account, ...other } = this.props;
|
||||||
|
|
||||||
@ -336,7 +348,9 @@ class Status extends ImmutablePureComponent {
|
|||||||
status = status.get('reblog');
|
status = status.get('reblog');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.get('media_attachments').size > 0) {
|
if (usingPiP) {
|
||||||
|
media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
|
||||||
|
} else if (status.get('media_attachments').size > 0) {
|
||||||
if (this.props.muted) {
|
if (this.props.muted) {
|
||||||
media = (
|
media = (
|
||||||
<AttachmentList
|
<AttachmentList
|
||||||
@ -361,6 +375,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
width={this.props.cachedMediaWidth}
|
width={this.props.cachedMediaWidth}
|
||||||
height={110}
|
height={110}
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
deployPictureInPicture={this.handleDeployPictureInPicture}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Bundle>
|
</Bundle>
|
||||||
@ -382,6 +397,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
sensitive={status.get('sensitive')}
|
sensitive={status.get('sensitive')}
|
||||||
onOpenVideo={this.handleOpenVideo}
|
onOpenVideo={this.handleOpenVideo}
|
||||||
cacheWidth={this.props.cacheMediaWidth}
|
cacheWidth={this.props.cacheMediaWidth}
|
||||||
|
deployPictureInPicture={this.handleDeployPictureInPicture}
|
||||||
visible={this.state.showMedia}
|
visible={this.state.showMedia}
|
||||||
onToggleVisibility={this.handleToggleMediaVisibility}
|
onToggleVisibility={this.handleToggleMediaVisibility}
|
||||||
/>
|
/>
|
||||||
@ -438,14 +454,16 @@ class Status extends ImmutablePureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={handlers}>
|
<HotKeys handlers={handlers}>
|
||||||
<div className={classNames('status__wrapper', `status__wrapper-${status.get('visibility')}`, { 'status__wrapper-reply': !!status.get('in_reply_to_id'), read: unread === false, focusable: !this.props.muted })} tabIndex={this.props.muted ? null : 0} data-featured={featured ? 'true' : null} aria-label={textForScreenReader(intl, status, rebloggedByText)} ref={this.handleRef}>
|
<div className={classNames('status__wrapper', `status__wrapper-${status.get('visibility')}`, { 'status__wrapper-reply': !!status.get('in_reply_to_id'), unread, focusable: !this.props.muted })} tabIndex={this.props.muted ? null : 0} data-featured={featured ? 'true' : null} aria-label={textForScreenReader(intl, status, rebloggedByText)} ref={this.handleRef}>
|
||||||
{prepend}
|
{prepend}
|
||||||
|
|
||||||
<div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted, read: unread === false })} data-id={status.get('id')}>
|
<div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted })} data-id={status.get('id')}>
|
||||||
<div className='status__expand' onClick={this.handleExpandClick} role='presentation' />
|
<div className='status__expand' onClick={this.handleExpandClick} role='presentation' />
|
||||||
<div className='status__info'>
|
<div className='status__info'>
|
||||||
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'><RelativeTimestamp timestamp={status.get('created_at')} /></a>
|
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
|
||||||
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
|
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
|
||||||
|
<RelativeTimestamp timestamp={status.get('created_at')} />
|
||||||
|
</a>
|
||||||
|
|
||||||
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
|
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
|
||||||
<div className='status__avatar'>
|
<div className='status__avatar'>
|
||||||
|
@ -43,16 +43,6 @@ const messages = defineMessages({
|
|||||||
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const obfuscatedCount = count => {
|
|
||||||
if (count < 0) {
|
|
||||||
return 0;
|
|
||||||
} else if (count <= 1) {
|
|
||||||
return count;
|
|
||||||
} else {
|
|
||||||
return '1+';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const mapStateToProps = (state, { status }) => ({
|
const mapStateToProps = (state, { status }) => ({
|
||||||
relationship: state.getIn(['relationships', status.getIn(['account', 'id'])]),
|
relationship: state.getIn(['relationships', status.getIn(['account', 'id'])]),
|
||||||
});
|
});
|
||||||
@ -329,9 +319,10 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='status__action-bar'>
|
<div className='status__action-bar'>
|
||||||
<div className='status__action-bar__counter'><IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} /><span className='status__action-bar__counter__label' >{obfuscatedCount(status.get('replies_count'))}</span></div>
|
<IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount />
|
||||||
<IconButton className={classNames('status__action-bar-button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} />
|
<IconButton className={classNames('status__action-bar-button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} />
|
||||||
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />
|
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />
|
||||||
|
|
||||||
{shareButton}
|
{shareButton}
|
||||||
|
|
||||||
<div className='status__action-bar-dropdown'>
|
<div className='status__action-bar-dropdown'>
|
||||||
|
@ -37,6 +37,7 @@ import { initMuteModal } from '../actions/mutes';
|
|||||||
import { initBlockModal } from '../actions/blocks';
|
import { initBlockModal } from '../actions/blocks';
|
||||||
import { initReport } from '../actions/reports';
|
import { initReport } from '../actions/reports';
|
||||||
import { openModal } from '../actions/modal';
|
import { openModal } from '../actions/modal';
|
||||||
|
import { deployPictureInPicture } from '../actions/picture_in_picture';
|
||||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import { boostModal, deleteModal } from '../initial_state';
|
import { boostModal, deleteModal } from '../initial_state';
|
||||||
import { showAlertForError } from '../actions/alerts';
|
import { showAlertForError } from '../actions/alerts';
|
||||||
@ -56,6 +57,7 @@ const makeMapStateToProps = () => {
|
|||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
status: getStatus(state, props),
|
status: getStatus(state, props),
|
||||||
|
usingPiP: state.get('picture_in_picture').statusId === props.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
return mapStateToProps;
|
return mapStateToProps;
|
||||||
@ -207,6 +209,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||||||
dispatch(unblockDomain(domain));
|
dispatch(unblockDomain(domain));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
deployPictureInPicture (status, type, mediaProps) {
|
||||||
|
dispatch(deployPictureInPicture(status.get('id'), status.getIn(['account', 'id']), type, mediaProps));
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
|
export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));
|
||||||
|
@ -37,7 +37,11 @@ class Audio extends React.PureComponent {
|
|||||||
backgroundColor: PropTypes.string,
|
backgroundColor: PropTypes.string,
|
||||||
foregroundColor: PropTypes.string,
|
foregroundColor: PropTypes.string,
|
||||||
accentColor: PropTypes.string,
|
accentColor: PropTypes.string,
|
||||||
|
currentTime: PropTypes.number,
|
||||||
autoPlay: PropTypes.bool,
|
autoPlay: PropTypes.bool,
|
||||||
|
volume: PropTypes.number,
|
||||||
|
muted: PropTypes.bool,
|
||||||
|
deployPictureInPicture: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -64,6 +68,19 @@ class Audio extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_pack() {
|
||||||
|
return {
|
||||||
|
src: this.props.src,
|
||||||
|
volume: this.audio.volume,
|
||||||
|
muted: this.audio.muted,
|
||||||
|
currentTime: this.audio.currentTime,
|
||||||
|
poster: this.props.poster,
|
||||||
|
backgroundColor: this.props.backgroundColor,
|
||||||
|
foregroundColor: this.props.foregroundColor,
|
||||||
|
accentColor: this.props.accentColor,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
_setDimensions () {
|
_setDimensions () {
|
||||||
const width = this.player.offsetWidth;
|
const width = this.player.offsetWidth;
|
||||||
const height = this.props.fullscreen ? this.player.offsetHeight : (width / (16/9));
|
const height = this.props.fullscreen ? this.player.offsetHeight : (width / (16/9));
|
||||||
@ -112,6 +129,10 @@ class Audio extends React.PureComponent {
|
|||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
window.removeEventListener('scroll', this.handleScroll);
|
window.removeEventListener('scroll', this.handleScroll);
|
||||||
window.removeEventListener('resize', this.handleResize);
|
window.removeEventListener('resize', this.handleResize);
|
||||||
|
|
||||||
|
if (!this.state.paused && this.audio && this.props.deployPictureInPicture) {
|
||||||
|
this.props.deployPictureInPicture('audio', this._pack());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
togglePlay = () => {
|
togglePlay = () => {
|
||||||
@ -225,7 +246,7 @@ class Audio extends React.PureComponent {
|
|||||||
handleTimeUpdate = () => {
|
handleTimeUpdate = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
currentTime: this.audio.currentTime,
|
currentTime: this.audio.currentTime,
|
||||||
duration: Math.floor(this.audio.duration),
|
duration: this.audio.duration,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +269,13 @@ class Audio extends React.PureComponent {
|
|||||||
const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);
|
const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);
|
||||||
|
|
||||||
if (!this.state.paused && !inView) {
|
if (!this.state.paused && !inView) {
|
||||||
this.setState({ paused: true }, () => this.audio.pause());
|
this.audio.pause();
|
||||||
|
|
||||||
|
if (this.props.deployPictureInPicture) {
|
||||||
|
this.props.deployPictureInPicture('audio', this._pack());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ paused: true });
|
||||||
}
|
}
|
||||||
}, 150, { trailing: true });
|
}, 150, { trailing: true });
|
||||||
|
|
||||||
@ -261,10 +288,22 @@ class Audio extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleLoadedData = () => {
|
handleLoadedData = () => {
|
||||||
const { autoPlay } = this.props;
|
const { autoPlay, currentTime, volume, muted } = this.props;
|
||||||
|
|
||||||
|
if (currentTime) {
|
||||||
|
this.audio.currentTime = currentTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (volume !== undefined) {
|
||||||
|
this.audio.volume = volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muted !== undefined) {
|
||||||
|
this.audio.muted = muted;
|
||||||
|
}
|
||||||
|
|
||||||
if (autoPlay) {
|
if (autoPlay) {
|
||||||
this.audio.play();
|
this.togglePlay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +389,7 @@ class Audio extends React.PureComponent {
|
|||||||
render () {
|
render () {
|
||||||
const { src, intl, alt, editable, autoPlay } = this.props;
|
const { src, intl, alt, editable, autoPlay } = this.props;
|
||||||
const { paused, muted, volume, currentTime, duration, buffer, dragging } = this.state;
|
const { paused, muted, volume, currentTime, duration, buffer, dragging } = this.state;
|
||||||
const progress = (currentTime / duration) * 100;
|
const progress = Math.min((currentTime / duration) * 100, 100);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames('audio-player', { editable })} ref={this.setPlayerRef} style={{ backgroundColor: this._getBackgroundColor(), color: this._getForegroundColor(), width: '100%', height: this.props.fullscreen ? '100%' : (this.state.height || this.props.height) }} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
<div className={classNames('audio-player', { editable })} ref={this.setPlayerRef} style={{ backgroundColor: this._getBackgroundColor(), color: this._getForegroundColor(), width: '100%', height: this.props.fullscreen ? '100%' : (this.state.height || this.props.height) }} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
|
||||||
@ -399,14 +438,14 @@ class Audio extends React.PureComponent {
|
|||||||
<div className='video-player__controls active'>
|
<div className='video-player__controls active'>
|
||||||
<div className='video-player__buttons-bar'>
|
<div className='video-player__buttons-bar'>
|
||||||
<div className='video-player__buttons left'>
|
<div className='video-player__buttons left'>
|
||||||
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>
|
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} className='player-button' onClick={this.togglePlay}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>
|
||||||
<button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>
|
<button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} className='player-button' onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>
|
||||||
|
|
||||||
<div className={classNames('video-player__volume', { active: this.state.hovered })} ref={this.setVolumeRef} onMouseDown={this.handleVolumeMouseDown}>
|
<div className={classNames('video-player__volume', { active: this.state.hovered })} ref={this.setVolumeRef} onMouseDown={this.handleVolumeMouseDown}>
|
||||||
<div className='video-player__volume__current' style={{ width: `${volume * 100}%`, backgroundColor: this._getAccentColor() }} />
|
<div className='video-player__volume__current' style={{ width: `${volume * 100}%`, backgroundColor: this._getAccentColor() }} />
|
||||||
|
|
||||||
<span
|
<span
|
||||||
className={classNames('video-player__volume__handle')}
|
className='video-player__volume__handle'
|
||||||
tabIndex='0'
|
tabIndex='0'
|
||||||
style={{ left: `${volume * 100}%`, backgroundColor: this._getAccentColor() }}
|
style={{ left: `${volume * 100}%`, backgroundColor: this._getAccentColor() }}
|
||||||
/>
|
/>
|
||||||
@ -415,12 +454,14 @@ class Audio extends React.PureComponent {
|
|||||||
<span className='video-player__time'>
|
<span className='video-player__time'>
|
||||||
<span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
|
<span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
|
||||||
<span className='video-player__time-sep'>/</span>
|
<span className='video-player__time-sep'>/</span>
|
||||||
<span className='video-player__time-total'>{formatTime(this.state.duration || Math.floor(this.props.duration))}</span>
|
<span className='video-player__time-total'>{formatTime(Math.floor(this.state.duration || this.props.duration))}</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='video-player__buttons right'>
|
<div className='video-player__buttons right'>
|
||||||
<button type='button' title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)} onClick={this.handleDownload}><Icon id='download' fixedWidth /></button>
|
<a title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)} className='video-player__download__icon player-button' href={this.props.src} download>
|
||||||
|
<Icon id={'download'} fixedWidth />
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,7 @@ import classNames from 'classnames';
|
|||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import detectPassiveEvents from 'detect-passive-events';
|
import detectPassiveEvents from 'detect-passive-events';
|
||||||
import { buildCustomEmojis, categoriesFromEmojis } from '../../emoji/emoji';
|
import { buildCustomEmojis, categoriesFromEmojis } from '../../emoji/emoji';
|
||||||
|
import { assetHost } from 'mastodon/utils/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' },
|
emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' },
|
||||||
@ -25,7 +26,6 @@ const messages = defineMessages({
|
|||||||
flags: { id: 'emoji_button.flags', defaultMessage: 'Flags' },
|
flags: { id: 'emoji_button.flags', defaultMessage: 'Flags' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const assetHost = process.env.CDN_HOST || '';
|
|
||||||
let EmojiPicker, Emoji; // load asynchronously
|
let EmojiPicker, Emoji; // load asynchronously
|
||||||
|
|
||||||
const backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`;
|
const backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`;
|
||||||
|
@ -6,13 +6,20 @@ import { changeComposeSensitivity } from 'mastodon/actions/compose';
|
|||||||
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
|
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
marked: { id: 'compose_form.sensitive.marked', defaultMessage: 'Media is marked as sensitive' },
|
marked: {
|
||||||
unmarked: { id: 'compose_form.sensitive.unmarked', defaultMessage: 'Media is not marked as sensitive' },
|
id: 'compose_form.sensitive.marked',
|
||||||
|
defaultMessage: '{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}',
|
||||||
|
},
|
||||||
|
unmarked: {
|
||||||
|
id: 'compose_form.sensitive.unmarked',
|
||||||
|
defaultMessage: '{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
active: state.getIn(['compose', 'sensitive']),
|
active: state.getIn(['compose', 'sensitive']),
|
||||||
disabled: state.getIn(['compose', 'spoiler']),
|
disabled: state.getIn(['compose', 'spoiler']),
|
||||||
|
mediaCount: state.getIn(['compose', 'media_attachments']).size,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
@ -28,16 +35,17 @@ class SensitiveButton extends React.PureComponent {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
active: PropTypes.bool,
|
active: PropTypes.bool,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
mediaCount: PropTypes.number,
|
||||||
onClick: PropTypes.func.isRequired,
|
onClick: PropTypes.func.isRequired,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { active, disabled, onClick, intl } = this.props;
|
const { active, disabled, mediaCount, onClick, intl } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='compose-form__sensitive-button'>
|
<div className='compose-form__sensitive-button'>
|
||||||
<label className={classNames('icon-button', { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked)}>
|
<label className={classNames('icon-button', { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked, { count: mediaCount })}>
|
||||||
<input
|
<input
|
||||||
name='mark-sensitive'
|
name='mark-sensitive'
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
@ -48,7 +56,11 @@ class SensitiveButton extends React.PureComponent {
|
|||||||
|
|
||||||
<span className={classNames('checkbox', { active })} />
|
<span className={classNames('checkbox', { active })} />
|
||||||
|
|
||||||
<FormattedMessage id='compose_form.sensitive.hide' defaultMessage='Mark media as sensitive' />
|
<FormattedMessage
|
||||||
|
id='compose_form.sensitive.hide'
|
||||||
|
defaultMessage='{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}'
|
||||||
|
values={{ count: mediaCount }}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import { autoPlayGif } from '../../initial_state';
|
import { autoPlayGif } from '../../initial_state';
|
||||||
import unicodeMapping from './emoji_unicode_mapping_light';
|
import unicodeMapping from './emoji_unicode_mapping_light';
|
||||||
|
import { assetHost } from 'mastodon/utils/config';
|
||||||
import Trie from 'substring-trie';
|
import Trie from 'substring-trie';
|
||||||
|
|
||||||
const trie = new Trie(Object.keys(unicodeMapping));
|
const trie = new Trie(Object.keys(unicodeMapping));
|
||||||
|
|
||||||
const assetHost = process.env.CDN_HOST || '';
|
|
||||||
|
|
||||||
// Convert to file names from emojis. (For different variation selector emojis)
|
// Convert to file names from emojis. (For different variation selector emojis)
|
||||||
const emojiFilenames = (emojis) => {
|
const emojiFilenames = (emojis) => {
|
||||||
return emojis.map(v => unicodeMapping[v].filename);
|
return emojis.map(v => unicodeMapping[v].filename);
|
||||||
|
@ -5,15 +5,17 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import IconButton from 'mastodon/components/icon_button';
|
import IconButton from 'mastodon/components/icon_button';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import { defineMessages, FormattedDate, FormattedMessage, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage, FormattedDate } from 'react-intl';
|
||||||
import { autoPlayGif, mascot, reduceMotion } from 'mastodon/initial_state';
|
import { autoPlayGif, reduceMotion, disableSwiping } from 'mastodon/initial_state';
|
||||||
import elephantUIPlane from 'mastodon/../images/elephant_ui_plane.svg';
|
import elephantUIPlane from 'mastodon/../images/elephant_ui_plane.svg';
|
||||||
|
import { mascot } from 'mastodon/initial_state';
|
||||||
import unicodeMapping from 'mastodon/features/emoji/emoji_unicode_mapping_light';
|
import unicodeMapping from 'mastodon/features/emoji/emoji_unicode_mapping_light';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import EmojiPickerDropdown from 'mastodon/features/compose/containers/emoji_picker_dropdown_container';
|
import EmojiPickerDropdown from 'mastodon/features/compose/containers/emoji_picker_dropdown_container';
|
||||||
import AnimatedNumber from 'mastodon/components/animated_number';
|
import AnimatedNumber from 'mastodon/components/animated_number';
|
||||||
import TransitionMotion from 'react-motion/lib/TransitionMotion';
|
import TransitionMotion from 'react-motion/lib/TransitionMotion';
|
||||||
import spring from 'react-motion/lib/spring';
|
import spring from 'react-motion/lib/spring';
|
||||||
|
import { assetHost } from 'mastodon/utils/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||||
@ -33,7 +35,7 @@ class Content extends ImmutablePureComponent {
|
|||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.node = c;
|
this.node = c;
|
||||||
};
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this._updateLinks();
|
this._updateLinks();
|
||||||
@ -112,7 +114,7 @@ class Content extends ImmutablePureComponent {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.context.router.history.push(`/accounts/${mention.get('id')}`);
|
this.context.router.history.push(`/accounts/${mention.get('id')}`);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
onHashtagClick = (hashtag, e) => {
|
onHashtagClick = (hashtag, e) => {
|
||||||
hashtag = hashtag.replace(/^#/, '');
|
hashtag = hashtag.replace(/^#/, '');
|
||||||
@ -121,22 +123,22 @@ class Content extends ImmutablePureComponent {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.context.router.history.push(`/timelines/tag/${hashtag}`);
|
this.context.router.history.push(`/timelines/tag/${hashtag}`);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
onStatusClick = (status, e) => {
|
onStatusClick = (status, e) => {
|
||||||
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.context.router.history.push(`/statuses/${status.get('id')}`);
|
this.context.router.history.push(`/statuses/${status.get('id')}`);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleEmojiMouseEnter = ({ target }) => {
|
handleEmojiMouseEnter = ({ target }) => {
|
||||||
target.src = target.getAttribute('data-original');
|
target.src = target.getAttribute('data-original');
|
||||||
};
|
}
|
||||||
|
|
||||||
handleEmojiMouseLeave = ({ target }) => {
|
handleEmojiMouseLeave = ({ target }) => {
|
||||||
target.src = target.getAttribute('data-static');
|
target.src = target.getAttribute('data-static');
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { announcement } = this.props;
|
const { announcement } = this.props;
|
||||||
@ -152,8 +154,6 @@ class Content extends ImmutablePureComponent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const assetHost = process.env.CDN_HOST || '';
|
|
||||||
|
|
||||||
class Emoji extends React.PureComponent {
|
class Emoji extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -221,11 +221,11 @@ class Reaction extends ImmutablePureComponent {
|
|||||||
} else {
|
} else {
|
||||||
addReaction(announcementId, reaction.get('name'));
|
addReaction(announcementId, reaction.get('name'));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
handleMouseEnter = () => this.setState({ hovered: true });
|
handleMouseEnter = () => this.setState({ hovered: true })
|
||||||
|
|
||||||
handleMouseLeave = () => this.setState({ hovered: false });
|
handleMouseLeave = () => this.setState({ hovered: false })
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { reaction } = this.props;
|
const { reaction } = this.props;
|
||||||
@ -259,7 +259,7 @@ class ReactionsBar extends ImmutablePureComponent {
|
|||||||
handleEmojiPick = data => {
|
handleEmojiPick = data => {
|
||||||
const { addReaction, announcementId } = this.props;
|
const { addReaction, announcementId } = this.props;
|
||||||
addReaction(announcementId, data.native.replace(/:/g, ''));
|
addReaction(announcementId, data.native.replace(/:/g, ''));
|
||||||
};
|
}
|
||||||
|
|
||||||
willEnter () {
|
willEnter () {
|
||||||
return { scale: reduceMotion ? 1 : 0 };
|
return { scale: reduceMotion ? 1 : 0 };
|
||||||
@ -402,15 +402,15 @@ class Announcements extends ImmutablePureComponent {
|
|||||||
|
|
||||||
handleChangeIndex = index => {
|
handleChangeIndex = index => {
|
||||||
this.setState({ index: index % this.props.announcements.size });
|
this.setState({ index: index % this.props.announcements.size });
|
||||||
};
|
}
|
||||||
|
|
||||||
handleNextClick = () => {
|
handleNextClick = () => {
|
||||||
this.setState({ index: (this.state.index + 1) % this.props.announcements.size });
|
this.setState({ index: (this.state.index + 1) % this.props.announcements.size });
|
||||||
};
|
}
|
||||||
|
|
||||||
handlePrevClick = () => {
|
handlePrevClick = () => {
|
||||||
this.setState({ index: (this.props.announcements.size + this.state.index - 1) % this.props.announcements.size });
|
this.setState({ index: (this.props.announcements.size + this.state.index - 1) % this.props.announcements.size });
|
||||||
};
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { announcements, intl } = this.props;
|
const { announcements, intl } = this.props;
|
||||||
@ -435,8 +435,9 @@ class Announcements extends ImmutablePureComponent {
|
|||||||
removeReaction={this.props.removeReaction}
|
removeReaction={this.props.removeReaction}
|
||||||
intl={intl}
|
intl={intl}
|
||||||
selected={index === idx}
|
selected={index === idx}
|
||||||
|
disabled={disableSwiping}
|
||||||
/>
|
/>
|
||||||
))}
|
)).reverse()}
|
||||||
</ReactSwipeableViews>
|
</ReactSwipeableViews>
|
||||||
|
|
||||||
{announcements.size > 1 && (
|
{announcements.size > 1 && (
|
||||||
|
@ -10,7 +10,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
|||||||
import { me, profile_directory, showTrends } from '../../initial_state';
|
import { me, profile_directory, showTrends } from '../../initial_state';
|
||||||
import { fetchFollowRequests } from 'mastodon/actions/accounts';
|
import { fetchFollowRequests } from 'mastodon/actions/accounts';
|
||||||
import { List as ImmutableList } from 'immutable';
|
import { List as ImmutableList } from 'immutable';
|
||||||
import NavigationBar from '../compose/components/navigation_bar';
|
import NavigationContainer from '../compose/containers/navigation_container';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import LinkFooter from 'mastodon/features/ui/components/link_footer';
|
import LinkFooter from 'mastodon/features/ui/components/link_footer';
|
||||||
import TrendsContainer from './containers/trends_container';
|
import TrendsContainer from './containers/trends_container';
|
||||||
@ -168,7 +168,7 @@ class GettingStarted extends ImmutablePureComponent {
|
|||||||
|
|
||||||
<div className='getting-started'>
|
<div className='getting-started'>
|
||||||
<div className='getting-started__wrapper' style={{ height }}>
|
<div className='getting-started__wrapper' style={{ height }}>
|
||||||
{!multiColumn && <NavigationBar account={myAccount} />}
|
{!multiColumn && <NavigationContainer />}
|
||||||
{navItems}
|
{navItems}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import screenHello from '../../../images/screen_hello.svg';
|
|||||||
import screenFederation from '../../../images/screen_federation.svg';
|
import screenFederation from '../../../images/screen_federation.svg';
|
||||||
import screenInteractions from '../../../images/screen_interactions.svg';
|
import screenInteractions from '../../../images/screen_interactions.svg';
|
||||||
import logoTransparent from '../../../images/logo_transparent.svg';
|
import logoTransparent from '../../../images/logo_transparent.svg';
|
||||||
|
import { disableSwiping } from 'mastodon/initial_state';
|
||||||
|
|
||||||
const FrameWelcome = ({ domain, onNext }) => (
|
const FrameWelcome = ({ domain, onNext }) => (
|
||||||
<div className='introduction__frame'>
|
<div className='introduction__frame'>
|
||||||
@ -171,7 +172,7 @@ class Introduction extends React.PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='introduction'>
|
<div className='introduction'>
|
||||||
<ReactSwipeableViews index={currentIndex} onChangeIndex={this.handleSwipe} className='introduction__pager'>
|
<ReactSwipeableViews index={currentIndex} onChangeIndex={this.handleSwipe} disabled={disableSwiping} className='introduction__pager'>
|
||||||
{pages.map((page, i) => (
|
{pages.map((page, i) => (
|
||||||
<div key={i} className={classNames('introduction__frame-wrapper', { 'active': i === currentIndex })}>{page}</div>
|
<div key={i} className={classNames('introduction__frame-wrapper', { 'active': i === currentIndex })}>{page}</div>
|
||||||
))}
|
))}
|
||||||
|
@ -12,6 +12,10 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
pushSettings: ImmutablePropTypes.map.isRequired,
|
pushSettings: ImmutablePropTypes.map.isRequired,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
onClear: PropTypes.func.isRequired,
|
onClear: PropTypes.func.isRequired,
|
||||||
|
onRequestNotificationPermission: PropTypes.func,
|
||||||
|
alertsEnabled: PropTypes.bool,
|
||||||
|
browserSupport: PropTypes.bool,
|
||||||
|
browserPermission: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
onPushChange = (path, checked) => {
|
onPushChange = (path, checked) => {
|
||||||
@ -19,7 +23,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { settings, pushSettings, onChange, onClear } = this.props;
|
const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission } = this.props;
|
||||||
|
|
||||||
const filterShowStr = <FormattedMessage id='notifications.column_settings.filter_bar.show' defaultMessage='Show' />;
|
const filterShowStr = <FormattedMessage id='notifications.column_settings.filter_bar.show' defaultMessage='Show' />;
|
||||||
const filterAdvancedStr = <FormattedMessage id='notifications.column_settings.filter_bar.advanced' defaultMessage='Display all categories' />;
|
const filterAdvancedStr = <FormattedMessage id='notifications.column_settings.filter_bar.advanced' defaultMessage='Display all categories' />;
|
||||||
@ -32,6 +36,12 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
{alertsEnabled && browserSupport && browserPermission === 'denied' && (
|
||||||
|
<div className='column-settings__row column-settings__row--with-margin'>
|
||||||
|
<span className='warning-hint'><FormattedMessage id='notifications.permission_denied' defaultMessage='Desktop notifications are unavailable due to previously denied browser permissions request' /></span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<ClearColumnButton onClick={onClear} />
|
<ClearColumnButton onClick={onClear} />
|
||||||
</div>
|
</div>
|
||||||
@ -40,6 +50,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-filter-bar' className='column-settings__section'>
|
<span id='notifications-filter-bar' className='column-settings__section'>
|
||||||
<FormattedMessage id='notifications.column_settings.filter_bar.category' defaultMessage='Quick filter bar' />
|
<FormattedMessage id='notifications.column_settings.filter_bar.category' defaultMessage='Quick filter bar' />
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'show']} onChange={onChange} label={filterShowStr} />
|
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'show']} onChange={onChange} label={filterShowStr} />
|
||||||
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'advanced']} onChange={onChange} label={filterAdvancedStr} />
|
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'advanced']} onChange={onChange} label={filterAdvancedStr} />
|
||||||
@ -50,7 +61,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-follow' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
|
<span id='notifications-follow' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'follow']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'follow']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'follow']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'follow']} onChange={onChange} label={soundStr} />
|
||||||
@ -61,7 +72,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-follow-request' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow_request' defaultMessage='New follow requests:' /></span>
|
<span id='notifications-follow-request' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow_request' defaultMessage='New follow requests:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow_request']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow_request']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow_request']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow_request']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'follow_request']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'follow_request']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'follow_request']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'follow_request']} onChange={onChange} label={soundStr} />
|
||||||
@ -72,7 +83,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-favourite' className='column-settings__section'><FormattedMessage id='notifications.column_settings.favourite' defaultMessage='Favourites:' /></span>
|
<span id='notifications-favourite' className='column-settings__section'><FormattedMessage id='notifications.column_settings.favourite' defaultMessage='Favourites:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'favourite']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'favourite']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'favourite']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'favourite']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'favourite']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'favourite']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'favourite']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'favourite']} onChange={onChange} label={soundStr} />
|
||||||
@ -83,7 +94,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-mention' className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
|
<span id='notifications-mention' className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'mention']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'mention']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'mention']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'mention']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'mention']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'mention']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'mention']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'mention']} onChange={onChange} label={soundStr} />
|
||||||
@ -94,7 +105,7 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-reblog' className='column-settings__section'><FormattedMessage id='notifications.column_settings.reblog' defaultMessage='Boosts:' /></span>
|
<span id='notifications-reblog' className='column-settings__section'><FormattedMessage id='notifications.column_settings.reblog' defaultMessage='Boosts:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'reblog']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'reblog']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'reblog']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'reblog']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'reblog']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'reblog']} onChange={onChange} label={soundStr} />
|
||||||
@ -105,12 +116,23 @@ export default class ColumnSettings extends React.PureComponent {
|
|||||||
<span id='notifications-poll' className='column-settings__section'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></span>
|
<span id='notifications-poll' className='column-settings__section'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'poll']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'poll']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'poll']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'poll']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'poll']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'poll']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'poll']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'poll']} onChange={onChange} label={soundStr} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div role='group' aria-labelledby='notifications-status'>
|
||||||
|
<span id='notifications-status' className='column-settings__section'><FormattedMessage id='notifications.column_settings.status' defaultMessage='New toots:' /></span>
|
||||||
|
|
||||||
|
<div className='column-settings__row'>
|
||||||
|
<SettingToggle disabled={browserPermission !== 'granted'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'status']} onChange={onChange} label={alertStr} />
|
||||||
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'status']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'status']} onChange={onChange} label={showStr} />
|
||||||
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'status']} onChange={onChange} label={soundStr} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import AccountContainer from 'mastodon/containers/account_container';
|
|||||||
import FollowRequestContainer from '../containers/follow_request_container';
|
import FollowRequestContainer from '../containers/follow_request_container';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import Permalink from 'mastodon/components/permalink';
|
import Permalink from 'mastodon/components/permalink';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
favourite: { id: 'notification.favourite', defaultMessage: '{name} favourited your status' },
|
favourite: { id: 'notification.favourite', defaultMessage: '{name} favourited your status' },
|
||||||
@ -50,6 +51,7 @@ class Notification extends ImmutablePureComponent {
|
|||||||
updateScrollBottom: PropTypes.func,
|
updateScrollBottom: PropTypes.func,
|
||||||
cacheMediaWidth: PropTypes.func,
|
cacheMediaWidth: PropTypes.func,
|
||||||
cachedMediaWidth: PropTypes.number,
|
cachedMediaWidth: PropTypes.number,
|
||||||
|
unread: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
handleMoveUp = () => {
|
handleMoveUp = () => {
|
||||||
@ -114,11 +116,11 @@ class Notification extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderFollow (notification, account, link) {
|
renderFollow (notification, account, link) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-follow focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.follow, { name: account.get('acct') }), notification.get('created_at'))}>
|
<div className={classNames('notification notification-follow focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.follow, { name: account.get('acct') }), notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='user-plus' fixedWidth />
|
<Icon id='user-plus' fixedWidth />
|
||||||
@ -136,11 +138,11 @@ class Notification extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderFollowRequest (notification, account, link) {
|
renderFollowRequest (notification, account, link) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-follow-request focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.follow_request', defaultMessage: '{name} has requested to follow you' }, { name: account.get('acct') }), notification.get('created_at'))}>
|
<div className={classNames('notification notification-follow-request focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.follow_request', defaultMessage: '{name} has requested to follow you' }, { name: account.get('acct') }), notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='user' fixedWidth />
|
<Icon id='user' fixedWidth />
|
||||||
@ -170,16 +172,17 @@ class Notification extends ImmutablePureComponent {
|
|||||||
updateScrollBottom={this.props.updateScrollBottom}
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
unread={this.props.unread}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderFavourite (notification, link) {
|
renderFavourite (notification, link) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-favourite focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.favourite, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
<div className={classNames('notification notification-favourite focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.favourite, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='star' className='star-icon' fixedWidth />
|
<Icon id='star' className='star-icon' fixedWidth />
|
||||||
@ -207,11 +210,11 @@ class Notification extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderReblog (notification, link) {
|
renderReblog (notification, link) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-reblog focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.reblog, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
<div className={classNames('notification notification-reblog focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.reblog, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='retweet' fixedWidth />
|
<Icon id='retweet' fixedWidth />
|
||||||
@ -239,11 +242,11 @@ class Notification extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderStatus (notification, link) {
|
renderStatus (notification, link) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-status focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.status, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
<div className={classNames('notification notification-status focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.status, { name: notification.getIn(['account', 'acct']) }), notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='home' fixedWidth />
|
<Icon id='home' fixedWidth />
|
||||||
@ -271,13 +274,13 @@ class Notification extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderPoll (notification, account) {
|
renderPoll (notification, account) {
|
||||||
const { intl } = this.props;
|
const { intl, unread } = this.props;
|
||||||
const ownPoll = me === account.get('id');
|
const ownPoll = me === account.get('id');
|
||||||
const message = ownPoll ? intl.formatMessage(messages.ownPoll) : intl.formatMessage(messages.poll);
|
const message = ownPoll ? intl.formatMessage(messages.ownPoll) : intl.formatMessage(messages.poll);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
<div className='notification notification-poll focusable' tabIndex='0' aria-label={notificationForScreenReader(intl, message, notification.get('created_at'))}>
|
<div className={classNames('notification notification-poll focusable', { unread })} tabIndex='0' aria-label={notificationForScreenReader(intl, message, notification.get('created_at'))}>
|
||||||
<div className='notification__message'>
|
<div className='notification__message'>
|
||||||
<div className='notification__favourite-icon-wrapper'>
|
<div className='notification__favourite-icon-wrapper'>
|
||||||
<Icon id='tasks' fixedWidth />
|
<Icon id='tasks' fixedWidth />
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Icon from 'mastodon/components/icon';
|
||||||
|
import Button from 'mastodon/components/button';
|
||||||
|
import { requestBrowserPermission } from 'mastodon/actions/notifications';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
export default @connect(() => {})
|
||||||
|
class NotificationsPermissionBanner extends React.PureComponent {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
handleClick = () => {
|
||||||
|
this.props.dispatch(requestBrowserPermission());
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
return (
|
||||||
|
<div className='notifications-permission-banner'>
|
||||||
|
<h2><FormattedMessage id='notifications_permission_banner.title' defaultMessage='Never miss a thing' /></h2>
|
||||||
|
<p><FormattedMessage id='notifications_permission_banner.how_to_control' defaultMessage="To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled." values={{ icon: <Icon id='sliders' /> }} /></p>
|
||||||
|
<Button onClick={this.handleClick}><FormattedMessage id='notifications_permission_banner.enable' defaultMessage='Enable desktop notifications' /></Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -12,6 +12,7 @@ export default class SettingToggle extends React.PureComponent {
|
|||||||
label: PropTypes.node.isRequired,
|
label: PropTypes.node.isRequired,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
defaultValue: PropTypes.bool,
|
defaultValue: PropTypes.bool,
|
||||||
|
disabled: PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange = ({ target }) => {
|
onChange = ({ target }) => {
|
||||||
@ -19,12 +20,12 @@ export default class SettingToggle extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { prefix, settings, settingPath, label, defaultValue } = this.props;
|
const { prefix, settings, settingPath, label, defaultValue, disabled } = this.props;
|
||||||
const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');
|
const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='setting-toggle'>
|
<div className='setting-toggle'>
|
||||||
<Toggle id={id} checked={settings.getIn(settingPath, defaultValue)} onChange={this.onChange} onKeyDown={this.onKeyDown} />
|
<Toggle disabled={disabled} id={id} checked={settings.getIn(settingPath, defaultValue)} onChange={this.onChange} onKeyDown={this.onKeyDown} />
|
||||||
<label htmlFor={id} className='setting-toggle__label'>{label}</label>
|
<label htmlFor={id} className='setting-toggle__label'>{label}</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -3,28 +3,55 @@ import { defineMessages, injectIntl } from 'react-intl';
|
|||||||
import ColumnSettings from '../components/column_settings';
|
import ColumnSettings from '../components/column_settings';
|
||||||
import { changeSetting } from '../../../actions/settings';
|
import { changeSetting } from '../../../actions/settings';
|
||||||
import { setFilter } from '../../../actions/notifications';
|
import { setFilter } from '../../../actions/notifications';
|
||||||
import { clearNotifications } from '../../../actions/notifications';
|
import { clearNotifications, requestBrowserPermission } from '../../../actions/notifications';
|
||||||
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
|
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
|
||||||
import { openModal } from '../../../actions/modal';
|
import { openModal } from '../../../actions/modal';
|
||||||
|
import { showAlert } from '../../../actions/alerts';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
clearMessage: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all your notifications?' },
|
clearMessage: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all your notifications?' },
|
||||||
clearConfirm: { id: 'notifications.clear', defaultMessage: 'Clear notifications' },
|
clearConfirm: { id: 'notifications.clear', defaultMessage: 'Clear notifications' },
|
||||||
|
permissionDenied: { id: 'notifications.permission_denied_alert', defaultMessage: 'Desktop notifications can\'t be enabled, as browser permission has been denied before' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
settings: state.getIn(['settings', 'notifications']),
|
settings: state.getIn(['settings', 'notifications']),
|
||||||
pushSettings: state.get('push_notifications'),
|
pushSettings: state.get('push_notifications'),
|
||||||
|
alertsEnabled: state.getIn(['settings', 'notifications', 'alerts']).includes(true),
|
||||||
|
browserSupport: state.getIn(['notifications', 'browserSupport']),
|
||||||
|
browserPermission: state.getIn(['notifications', 'browserPermission']),
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { intl }) => ({
|
const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||||
|
|
||||||
onChange (path, checked) {
|
onChange (path, checked) {
|
||||||
if (path[0] === 'push') {
|
if (path[0] === 'push') {
|
||||||
|
if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
|
||||||
|
dispatch(requestBrowserPermission((permission) => {
|
||||||
|
if (permission === 'granted') {
|
||||||
dispatch(changePushNotifications(path.slice(1), checked));
|
dispatch(changePushNotifications(path.slice(1), checked));
|
||||||
|
} else {
|
||||||
|
dispatch(showAlert(undefined, messages.permissionDenied));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
dispatch(changePushNotifications(path.slice(1), checked));
|
||||||
|
}
|
||||||
} else if (path[0] === 'quickFilter') {
|
} else if (path[0] === 'quickFilter') {
|
||||||
dispatch(changeSetting(['notifications', ...path], checked));
|
dispatch(changeSetting(['notifications', ...path], checked));
|
||||||
dispatch(setFilter('all'));
|
dispatch(setFilter('all'));
|
||||||
|
} else if (path[0] === 'alerts' && checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
|
||||||
|
if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
|
||||||
|
dispatch(requestBrowserPermission((permission) => {
|
||||||
|
if (permission === 'granted') {
|
||||||
|
dispatch(changeSetting(['notifications', ...path], checked));
|
||||||
|
} else {
|
||||||
|
dispatch(showAlert(undefined, messages.permissionDenied));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
dispatch(changeSetting(['notifications', ...path], checked));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeSetting(['notifications', ...path], checked));
|
dispatch(changeSetting(['notifications', ...path], checked));
|
||||||
}
|
}
|
||||||
@ -38,6 +65,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onRequestNotificationPermission () {
|
||||||
|
dispatch(requestBrowserPermission());
|
||||||
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ColumnSettings));
|
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ColumnSettings));
|
||||||
|
@ -4,7 +4,15 @@ import PropTypes from 'prop-types';
|
|||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import Column from '../../components/column';
|
import Column from '../../components/column';
|
||||||
import ColumnHeader from '../../components/column_header';
|
import ColumnHeader from '../../components/column_header';
|
||||||
import { expandNotifications, scrollTopNotifications, loadPending, mountNotifications, unmountNotifications } from '../../actions/notifications';
|
import {
|
||||||
|
expandNotifications,
|
||||||
|
scrollTopNotifications,
|
||||||
|
loadPending,
|
||||||
|
mountNotifications,
|
||||||
|
unmountNotifications,
|
||||||
|
markNotificationsAsRead,
|
||||||
|
} from '../../actions/notifications';
|
||||||
|
import { submitMarkers } from '../../actions/markers';
|
||||||
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
|
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
|
||||||
import NotificationContainer from './containers/notification_container';
|
import NotificationContainer from './containers/notification_container';
|
||||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
@ -15,9 +23,13 @@ import { List as ImmutableList } from 'immutable';
|
|||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import ScrollableList from '../../components/scrollable_list';
|
import ScrollableList from '../../components/scrollable_list';
|
||||||
import LoadGap from '../../components/load_gap';
|
import LoadGap from '../../components/load_gap';
|
||||||
|
import Icon from 'mastodon/components/icon';
|
||||||
|
import compareId from 'mastodon/compare_id';
|
||||||
|
import NotificationsPermissionBanner from './components/notifications_permission_banner';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
title: { id: 'column.notifications', defaultMessage: 'Notifications' },
|
title: { id: 'column.notifications', defaultMessage: 'Notifications' },
|
||||||
|
markAsRead : { id: 'notifications.mark_as_read', defaultMessage: 'Mark every notification as read' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const getNotifications = createSelector([
|
const getNotifications = createSelector([
|
||||||
@ -42,6 +54,9 @@ const mapStateToProps = state => ({
|
|||||||
isUnread: state.getIn(['notifications', 'unread']) > 0 || state.getIn(['notifications', 'pendingItems']).size > 0,
|
isUnread: state.getIn(['notifications', 'unread']) > 0 || state.getIn(['notifications', 'pendingItems']).size > 0,
|
||||||
hasMore: state.getIn(['notifications', 'hasMore']),
|
hasMore: state.getIn(['notifications', 'hasMore']),
|
||||||
numPending: state.getIn(['notifications', 'pendingItems'], ImmutableList()).size,
|
numPending: state.getIn(['notifications', 'pendingItems'], ImmutableList()).size,
|
||||||
|
lastReadId: state.getIn(['notifications', 'readMarkerId']),
|
||||||
|
canMarkAsRead: state.getIn(['notifications', 'readMarkerId']) !== '0' && getNotifications(state).some(item => item !== null && compareId(item.get('id'), state.getIn(['notifications', 'readMarkerId'])) > 0),
|
||||||
|
needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default',
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @connect(mapStateToProps)
|
export default @connect(mapStateToProps)
|
||||||
@ -60,6 +75,9 @@ class Notifications extends React.PureComponent {
|
|||||||
multiColumn: PropTypes.bool,
|
multiColumn: PropTypes.bool,
|
||||||
hasMore: PropTypes.bool,
|
hasMore: PropTypes.bool,
|
||||||
numPending: PropTypes.number,
|
numPending: PropTypes.number,
|
||||||
|
lastReadId: PropTypes.string,
|
||||||
|
canMarkAsRead: PropTypes.bool,
|
||||||
|
needsNotificationPermission: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -146,8 +164,13 @@ class Notifications extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleMarkAsRead = () => {
|
||||||
|
this.props.dispatch(markNotificationsAsRead());
|
||||||
|
this.props.dispatch(submitMarkers({ immediate: true }));
|
||||||
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar } = this.props;
|
const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props;
|
||||||
const pinned = !!columnId;
|
const pinned = !!columnId;
|
||||||
const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. Interact with others to start the conversation." />;
|
const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. Interact with others to start the conversation." />;
|
||||||
|
|
||||||
@ -174,6 +197,7 @@ class Notifications extends React.PureComponent {
|
|||||||
accountId={item.get('account')}
|
accountId={item.get('account')}
|
||||||
onMoveUp={this.handleMoveUp}
|
onMoveUp={this.handleMoveUp}
|
||||||
onMoveDown={this.handleMoveDown}
|
onMoveDown={this.handleMoveDown}
|
||||||
|
unread={lastReadId !== '0' && compareId(item.get('id'), lastReadId) > 0}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
@ -190,6 +214,8 @@ class Notifications extends React.PureComponent {
|
|||||||
showLoading={isLoading && notifications.size === 0}
|
showLoading={isLoading && notifications.size === 0}
|
||||||
hasMore={hasMore}
|
hasMore={hasMore}
|
||||||
numPending={numPending}
|
numPending={numPending}
|
||||||
|
prepend={needsNotificationPermission && <NotificationsPermissionBanner />}
|
||||||
|
alwaysPrepend
|
||||||
emptyMessage={emptyMessage}
|
emptyMessage={emptyMessage}
|
||||||
onLoadMore={this.handleLoadOlder}
|
onLoadMore={this.handleLoadOlder}
|
||||||
onLoadPending={this.handleLoadPending}
|
onLoadPending={this.handleLoadPending}
|
||||||
@ -202,6 +228,21 @@ class Notifications extends React.PureComponent {
|
|||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let extraButton = null;
|
||||||
|
|
||||||
|
if (canMarkAsRead) {
|
||||||
|
extraButton = (
|
||||||
|
<button
|
||||||
|
aria-label={intl.formatMessage(messages.markAsRead)}
|
||||||
|
title={intl.formatMessage(messages.markAsRead)}
|
||||||
|
onClick={this.handleMarkAsRead}
|
||||||
|
className='column-header__button'
|
||||||
|
>
|
||||||
|
<Icon id='check' />
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column bindToDocument={!multiColumn} ref={this.setColumnRef} label={intl.formatMessage(messages.title)}>
|
<Column bindToDocument={!multiColumn} ref={this.setColumnRef} label={intl.formatMessage(messages.title)}>
|
||||||
<ColumnHeader
|
<ColumnHeader
|
||||||
@ -213,6 +254,7 @@ class Notifications extends React.PureComponent {
|
|||||||
onClick={this.handleHeaderClick}
|
onClick={this.handleHeaderClick}
|
||||||
pinned={pinned}
|
pinned={pinned}
|
||||||
multiColumn={multiColumn}
|
multiColumn={multiColumn}
|
||||||
|
extraButton={extraButton}
|
||||||
>
|
>
|
||||||
<ColumnSettingsContainer />
|
<ColumnSettingsContainer />
|
||||||
</ColumnHeader>
|
</ColumnHeader>
|
||||||
|
@ -0,0 +1,137 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import IconButton from 'mastodon/components/icon_button';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { me, boostModal } from 'mastodon/initial_state';
|
||||||
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
import { replyCompose } from 'mastodon/actions/compose';
|
||||||
|
import { reblog, favourite, unreblog, unfavourite } from 'mastodon/actions/interactions';
|
||||||
|
import { makeGetStatus } from 'mastodon/selectors';
|
||||||
|
import { openModal } from 'mastodon/actions/modal';
|
||||||
|
|
||||||
|
const messages = defineMessages({
|
||||||
|
reply: { id: 'status.reply', defaultMessage: 'Reply' },
|
||||||
|
replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
|
||||||
|
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
|
||||||
|
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
|
||||||
|
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
|
||||||
|
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
|
||||||
|
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
|
||||||
|
replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
|
||||||
|
replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
|
||||||
|
});
|
||||||
|
|
||||||
|
const makeMapStateToProps = () => {
|
||||||
|
const getStatus = makeGetStatus();
|
||||||
|
|
||||||
|
const mapStateToProps = (state, { statusId }) => ({
|
||||||
|
status: getStatus(state, { id: statusId }),
|
||||||
|
askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
return mapStateToProps;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default @connect(makeMapStateToProps)
|
||||||
|
@injectIntl
|
||||||
|
class Footer extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
static contextTypes = {
|
||||||
|
router: PropTypes.object,
|
||||||
|
};
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
statusId: PropTypes.string.isRequired,
|
||||||
|
status: ImmutablePropTypes.map.isRequired,
|
||||||
|
intl: PropTypes.object.isRequired,
|
||||||
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
askReplyConfirmation: PropTypes.bool,
|
||||||
|
};
|
||||||
|
|
||||||
|
_performReply = () => {
|
||||||
|
const { dispatch, status } = this.props;
|
||||||
|
dispatch(replyCompose(status, this.context.router.history));
|
||||||
|
};
|
||||||
|
|
||||||
|
handleReplyClick = () => {
|
||||||
|
const { dispatch, askReplyConfirmation, intl } = this.props;
|
||||||
|
|
||||||
|
if (askReplyConfirmation) {
|
||||||
|
dispatch(openModal('CONFIRM', {
|
||||||
|
message: intl.formatMessage(messages.replyMessage),
|
||||||
|
confirm: intl.formatMessage(messages.replyConfirm),
|
||||||
|
onConfirm: this._performReply,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
this._performReply();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleFavouriteClick = () => {
|
||||||
|
const { dispatch, status } = this.props;
|
||||||
|
|
||||||
|
if (status.get('favourited')) {
|
||||||
|
dispatch(unfavourite(status));
|
||||||
|
} else {
|
||||||
|
dispatch(favourite(status));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
_performReblog = () => {
|
||||||
|
const { dispatch, status } = this.props;
|
||||||
|
dispatch(reblog(status));
|
||||||
|
}
|
||||||
|
|
||||||
|
handleReblogClick = e => {
|
||||||
|
const { dispatch, status } = this.props;
|
||||||
|
|
||||||
|
if (status.get('reblogged')) {
|
||||||
|
dispatch(unreblog(status));
|
||||||
|
} else if ((e && e.shiftKey) || !boostModal) {
|
||||||
|
this._performReblog();
|
||||||
|
} else {
|
||||||
|
dispatch(openModal('BOOST', { status, onReblog: this._performReblog }));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { status, intl } = this.props;
|
||||||
|
|
||||||
|
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
|
||||||
|
const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private';
|
||||||
|
|
||||||
|
let replyIcon, replyTitle;
|
||||||
|
|
||||||
|
if (status.get('in_reply_to_id', null) === null) {
|
||||||
|
replyIcon = 'reply';
|
||||||
|
replyTitle = intl.formatMessage(messages.reply);
|
||||||
|
} else {
|
||||||
|
replyIcon = 'reply-all';
|
||||||
|
replyTitle = intl.formatMessage(messages.replyAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
let reblogTitle = '';
|
||||||
|
|
||||||
|
if (status.get('reblogged')) {
|
||||||
|
reblogTitle = intl.formatMessage(messages.cancel_reblog_private);
|
||||||
|
} else if (publicStatus) {
|
||||||
|
reblogTitle = intl.formatMessage(messages.reblog);
|
||||||
|
} else if (reblogPrivate) {
|
||||||
|
reblogTitle = intl.formatMessage(messages.reblog_private);
|
||||||
|
} else {
|
||||||
|
reblogTitle = intl.formatMessage(messages.cannot_reblog);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='picture-in-picture__footer'>
|
||||||
|
<IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount />
|
||||||
|
<IconButton className={classNames('status__action-bar-button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={status.get('reblogs_count')} />
|
||||||
|
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={status.get('favourites_count')} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import IconButton from 'mastodon/components/icon_button';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import Avatar from 'mastodon/components/avatar';
|
||||||
|
import DisplayName from 'mastodon/components/display_name';
|
||||||
|
|
||||||
|
const mapStateToProps = (state, { accountId }) => ({
|
||||||
|
account: state.getIn(['accounts', accountId]),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default @connect(mapStateToProps)
|
||||||
|
class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
accountId: PropTypes.string.isRequired,
|
||||||
|
statusId: PropTypes.string.isRequired,
|
||||||
|
account: ImmutablePropTypes.map.isRequired,
|
||||||
|
onClose: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { account, statusId, onClose } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='picture-in-picture__header'>
|
||||||
|
<Link to={`/statuses/${statusId}`} className='picture-in-picture__header__account'>
|
||||||
|
<Avatar account={account} size={36} />
|
||||||
|
<DisplayName account={account} />
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<IconButton icon='times' onClick={onClose} title='Close' />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
85
app/javascript/mastodon/features/picture_in_picture/index.js
Normal file
85
app/javascript/mastodon/features/picture_in_picture/index.js
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import Video from 'mastodon/features/video';
|
||||||
|
import Audio from 'mastodon/features/audio';
|
||||||
|
import { removePictureInPicture } from 'mastodon/actions/picture_in_picture';
|
||||||
|
import Header from './components/header';
|
||||||
|
import Footer from './components/footer';
|
||||||
|
|
||||||
|
const mapStateToProps = state => ({
|
||||||
|
...state.get('picture_in_picture'),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default @connect(mapStateToProps)
|
||||||
|
class PictureInPicture extends React.Component {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
statusId: PropTypes.string,
|
||||||
|
accountId: PropTypes.string,
|
||||||
|
type: PropTypes.string,
|
||||||
|
src: PropTypes.string,
|
||||||
|
muted: PropTypes.bool,
|
||||||
|
volume: PropTypes.number,
|
||||||
|
currentTime: PropTypes.number,
|
||||||
|
poster: PropTypes.string,
|
||||||
|
backgroundColor: PropTypes.string,
|
||||||
|
foregroundColor: PropTypes.string,
|
||||||
|
accentColor: PropTypes.string,
|
||||||
|
dispatch: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
handleClose = () => {
|
||||||
|
const { dispatch } = this.props;
|
||||||
|
dispatch(removePictureInPicture());
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { type, src, currentTime, accountId, statusId } = this.props;
|
||||||
|
|
||||||
|
if (!currentTime) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let player;
|
||||||
|
|
||||||
|
if (type === 'video') {
|
||||||
|
player = (
|
||||||
|
<Video
|
||||||
|
src={src}
|
||||||
|
currentTime={this.props.currentTime}
|
||||||
|
volume={this.props.volume}
|
||||||
|
muted={this.props.muted}
|
||||||
|
autoPlay
|
||||||
|
inline
|
||||||
|
alwaysVisible
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else if (type === 'audio') {
|
||||||
|
player = (
|
||||||
|
<Audio
|
||||||
|
src={src}
|
||||||
|
currentTime={this.props.currentTime}
|
||||||
|
volume={this.props.volume}
|
||||||
|
muted={this.props.muted}
|
||||||
|
poster={this.props.poster}
|
||||||
|
backgroundColor={this.props.backgroundColor}
|
||||||
|
foregroundColor={this.props.foregroundColor}
|
||||||
|
accentColor={this.props.accentColor}
|
||||||
|
autoPlay
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='picture-in-picture'>
|
||||||
|
<Header accountId={accountId} statusId={statusId} onClose={this.handleClose} />
|
||||||
|
|
||||||
|
{player}
|
||||||
|
|
||||||
|
<Footer statusId={statusId} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -15,6 +15,7 @@ import scheduleIdleTask from '../../ui/util/schedule_idle_task';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import AnimatedNumber from 'mastodon/components/animated_number';
|
import AnimatedNumber from 'mastodon/components/animated_number';
|
||||||
|
import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_placeholder';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
public_short: { id: 'privacy.public.short', defaultMessage: 'Public' },
|
public_short: { id: 'privacy.public.short', defaultMessage: 'Public' },
|
||||||
@ -40,6 +41,7 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
domain: PropTypes.string.isRequired,
|
domain: PropTypes.string.isRequired,
|
||||||
compact: PropTypes.bool,
|
compact: PropTypes.bool,
|
||||||
showMedia: PropTypes.bool,
|
showMedia: PropTypes.bool,
|
||||||
|
usingPiP: PropTypes.bool,
|
||||||
onToggleMediaVisibility: PropTypes.func,
|
onToggleMediaVisibility: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -100,7 +102,7 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
render () {
|
render () {
|
||||||
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
|
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
|
||||||
const outerStyle = { boxSizing: 'border-box' };
|
const outerStyle = { boxSizing: 'border-box' };
|
||||||
const { intl, compact } = this.props;
|
const { intl, compact, usingPiP } = this.props;
|
||||||
|
|
||||||
if (!status) {
|
if (!status) {
|
||||||
return null;
|
return null;
|
||||||
@ -116,7 +118,9 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||||||
outerStyle.height = `${this.state.height}px`;
|
outerStyle.height = `${this.state.height}px`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.get('media_attachments').size > 0) {
|
if (usingPiP) {
|
||||||
|
media = <PictureInPicturePlaceholder />;
|
||||||
|
} else if (status.get('media_attachments').size > 0) {
|
||||||
if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
|
||||||
const attachment = status.getIn(['media_attachments', 0]);
|
const attachment = status.getIn(['media_attachments', 0]);
|
||||||
|
|
||||||
|
@ -143,6 +143,7 @@ const makeMapStateToProps = () => {
|
|||||||
descendantsIds,
|
descendantsIds,
|
||||||
askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0,
|
askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0,
|
||||||
domain: state.getIn(['meta', 'domain']),
|
domain: state.getIn(['meta', 'domain']),
|
||||||
|
usingPiP: state.get('picture_in_picture').statusId === props.params.statusId,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -167,6 +168,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
askReplyConfirmation: PropTypes.bool,
|
askReplyConfirmation: PropTypes.bool,
|
||||||
multiColumn: PropTypes.bool,
|
multiColumn: PropTypes.bool,
|
||||||
domain: PropTypes.string.isRequired,
|
domain: PropTypes.string.isRequired,
|
||||||
|
usingPiP: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -492,7 +494,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
let ancestors, descendants;
|
let ancestors, descendants;
|
||||||
const { shouldUpdateScroll, status, ancestorsIds, descendantsIds, intl, domain, multiColumn } = this.props;
|
const { shouldUpdateScroll, status, ancestorsIds, descendantsIds, intl, domain, multiColumn, usingPiP } = this.props;
|
||||||
const { fullscreen } = this.state;
|
const { fullscreen } = this.state;
|
||||||
|
|
||||||
if (status === null) {
|
if (status === null) {
|
||||||
@ -550,6 +552,7 @@ class Status extends ImmutablePureComponent {
|
|||||||
domain={domain}
|
domain={domain}
|
||||||
showMedia={this.state.showMedia}
|
showMedia={this.state.showMedia}
|
||||||
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
onToggleMediaVisibility={this.handleToggleMediaVisibility}
|
||||||
|
usingPiP={usingPiP}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ActionBar
|
<ActionBar
|
||||||
|
@ -75,9 +75,10 @@ class BoostModal extends ImmutablePureComponent {
|
|||||||
<div className={classNames('status', `status-${status.get('visibility')}`, 'light')}>
|
<div className={classNames('status', `status-${status.get('visibility')}`, 'light')}>
|
||||||
<div className='boost-modal__status-header'>
|
<div className='boost-modal__status-header'>
|
||||||
<div className='boost-modal__status-time'>
|
<div className='boost-modal__status-time'>
|
||||||
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'><RelativeTimestamp timestamp={status.get('created_at')} /></a>
|
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
|
||||||
</div>
|
|
||||||
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
|
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
|
||||||
|
<RelativeTimestamp timestamp={status.get('created_at')} /></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a onClick={this.handleAccountClick} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
<a onClick={this.handleAccountClick} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
||||||
<div className='status__avatar'>
|
<div className='status__avatar'>
|
||||||
|
@ -8,6 +8,8 @@ import ReactSwipeableViews from 'react-swipeable-views';
|
|||||||
import TabsBar, { links, getIndex, getLink } from './tabs_bar';
|
import TabsBar, { links, getIndex, getLink } from './tabs_bar';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { disableSwiping } from 'mastodon/initial_state';
|
||||||
|
|
||||||
import BundleContainer from '../containers/bundle_container';
|
import BundleContainer from '../containers/bundle_container';
|
||||||
import ColumnLoading from './column_loading';
|
import ColumnLoading from './column_loading';
|
||||||
import DrawerLoading from './drawer_loading';
|
import DrawerLoading from './drawer_loading';
|
||||||
@ -185,7 +187,7 @@ class ColumnsArea extends ImmutablePureComponent {
|
|||||||
const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><Icon id='pencil' /></Link>;
|
const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><Icon id='pencil' /></Link>;
|
||||||
|
|
||||||
const content = columnIndex !== -1 ? (
|
const content = columnIndex !== -1 ? (
|
||||||
<ReactSwipeableViews key='content' hysteresis={0.2} threshold={15} index={columnIndex} onChangeIndex={this.handleSwipe} onTransitionEnd={this.handleAnimationEnd} animateTransitions={shouldAnimate} springConfig={{ duration: '400ms', delay: '0s', easeFunction: 'ease' }} style={{ height: '100%' }}>
|
<ReactSwipeableViews key='content' hysteresis={0.2} threshold={15} index={columnIndex} onChangeIndex={this.handleSwipe} onTransitionEnd={this.handleAnimationEnd} animateTransitions={shouldAnimate} springConfig={{ duration: '400ms', delay: '0s', easeFunction: 'ease' }} style={{ height: '100%' }} disabled={disableSwiping}>
|
||||||
{links.map(this.renderView)}
|
{links.map(this.renderView)}
|
||||||
</ReactSwipeableViews>
|
</ReactSwipeableViews>
|
||||||
) : (
|
) : (
|
||||||
|
@ -20,6 +20,7 @@ import GIFV from 'mastodon/components/gifv';
|
|||||||
import { me } from 'mastodon/initial_state';
|
import { me } from 'mastodon/initial_state';
|
||||||
import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js';
|
import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js';
|
||||||
import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js';
|
import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js';
|
||||||
|
import { assetHost } from 'mastodon/utils/config';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||||
@ -50,8 +51,6 @@ const removeExtraLineBreaks = str => str.replace(/\n\n/g, '******')
|
|||||||
.replace(/\n/g, ' ')
|
.replace(/\n/g, ' ')
|
||||||
.replace(/\*\*\*\*\*\*/g, '\n\n');
|
.replace(/\*\*\*\*\*\*/g, '\n\n');
|
||||||
|
|
||||||
const assetHost = process.env.CDN_HOST || '';
|
|
||||||
|
|
||||||
class ImageLoader extends React.PureComponent {
|
class ImageLoader extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -10,6 +10,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
|||||||
import ImageLoader from './image_loader';
|
import ImageLoader from './image_loader';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import GIFV from 'mastodon/components/gifv';
|
import GIFV from 'mastodon/components/gifv';
|
||||||
|
import { disableSwiping } from 'mastodon/initial_state';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||||
@ -160,7 +161,7 @@ class MediaModal extends ImmutablePureComponent {
|
|||||||
src={image.get('url')}
|
src={image.get('url')}
|
||||||
width={image.get('width')}
|
width={image.get('width')}
|
||||||
height={image.get('height')}
|
height={image.get('height')}
|
||||||
startTime={time || 0}
|
currentTime={time || 0}
|
||||||
onCloseVideo={onClose}
|
onCloseVideo={onClose}
|
||||||
detailed
|
detailed
|
||||||
alt={image.get('description')}
|
alt={image.get('description')}
|
||||||
@ -212,6 +213,7 @@ class MediaModal extends ImmutablePureComponent {
|
|||||||
containerStyle={containerStyle}
|
containerStyle={containerStyle}
|
||||||
onChangeIndex={this.handleSwipe}
|
onChangeIndex={this.handleSwipe}
|
||||||
index={index}
|
index={index}
|
||||||
|
disabled={disableSwiping}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
</ReactSwipeableViews>
|
</ReactSwipeableViews>
|
||||||
|
@ -1,25 +1,32 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { injectIntl, FormattedMessage } from 'react-intl';
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import Toggle from 'react-toggle';
|
import Toggle from 'react-toggle';
|
||||||
import Button from '../../../components/button';
|
import Button from '../../../components/button';
|
||||||
import { closeModal } from '../../../actions/modal';
|
import { closeModal } from '../../../actions/modal';
|
||||||
import { muteAccount } from '../../../actions/accounts';
|
import { muteAccount } from '../../../actions/accounts';
|
||||||
import { toggleHideNotifications } from '../../../actions/mutes';
|
import { toggleHideNotifications, changeMuteDuration } from '../../../actions/mutes';
|
||||||
|
|
||||||
|
const messages = defineMessages({
|
||||||
|
minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' },
|
||||||
|
hours: { id: 'intervals.full.hours', defaultMessage: '{number, plural, one {# hour} other {# hours}}' },
|
||||||
|
days: { id: 'intervals.full.days', defaultMessage: '{number, plural, one {# day} other {# days}}' },
|
||||||
|
indefinite: { id: 'mute_modal.indefinite', defaultMessage: 'Indefinite' },
|
||||||
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
return {
|
return {
|
||||||
account: state.getIn(['mutes', 'new', 'account']),
|
account: state.getIn(['mutes', 'new', 'account']),
|
||||||
notifications: state.getIn(['mutes', 'new', 'notifications']),
|
notifications: state.getIn(['mutes', 'new', 'notifications']),
|
||||||
|
muteDuration: state.getIn(['mutes', 'new', 'duration']),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => {
|
const mapDispatchToProps = dispatch => {
|
||||||
return {
|
return {
|
||||||
onConfirm(account, notifications) {
|
onConfirm(account, notifications, muteDuration) {
|
||||||
dispatch(muteAccount(account.get('id'), notifications));
|
dispatch(muteAccount(account.get('id'), notifications, muteDuration));
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
@ -29,6 +36,10 @@ const mapDispatchToProps = dispatch => {
|
|||||||
onToggleNotifications() {
|
onToggleNotifications() {
|
||||||
dispatch(toggleHideNotifications());
|
dispatch(toggleHideNotifications());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChangeMuteDuration(e) {
|
||||||
|
dispatch(changeMuteDuration(e.target.value));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -43,6 +54,8 @@ class MuteModal extends React.PureComponent {
|
|||||||
onConfirm: PropTypes.func.isRequired,
|
onConfirm: PropTypes.func.isRequired,
|
||||||
onToggleNotifications: PropTypes.func.isRequired,
|
onToggleNotifications: PropTypes.func.isRequired,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
|
muteDuration: PropTypes.number.isRequired,
|
||||||
|
onChangeMuteDuration: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -51,7 +64,7 @@ class MuteModal extends React.PureComponent {
|
|||||||
|
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
this.props.onClose();
|
this.props.onClose();
|
||||||
this.props.onConfirm(this.props.account, this.props.notifications);
|
this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCancel = () => {
|
handleCancel = () => {
|
||||||
@ -66,8 +79,12 @@ class MuteModal extends React.PureComponent {
|
|||||||
this.props.onToggleNotifications();
|
this.props.onToggleNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeMuteDuration = (e) => {
|
||||||
|
this.props.onChangeMuteDuration(e);
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { account, notifications } = this.props;
|
const { account, notifications, muteDuration, intl } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='modal-root__modal mute-modal'>
|
<div className='modal-root__modal mute-modal'>
|
||||||
@ -91,6 +108,21 @@ class MuteModal extends React.PureComponent {
|
|||||||
<FormattedMessage id='mute_modal.hide_notifications' defaultMessage='Hide notifications from this user?' />
|
<FormattedMessage id='mute_modal.hide_notifications' defaultMessage='Hide notifications from this user?' />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<span><FormattedMessage id='mute_modal.duration' defaultMessage='Duration' />: </span>
|
||||||
|
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/no-onchange */}
|
||||||
|
<select value={muteDuration} onChange={this.changeMuteDuration}>
|
||||||
|
<option value={0}>{intl.formatMessage(messages.indefinite)}</option>
|
||||||
|
<option value={300}>{intl.formatMessage(messages.minutes, { number: 5 })}</option>
|
||||||
|
<option value={1800}>{intl.formatMessage(messages.minutes, { number: 30 })}</option>
|
||||||
|
<option value={3600}>{intl.formatMessage(messages.hours, { number: 1 })}</option>
|
||||||
|
<option value={21600}>{intl.formatMessage(messages.hours, { number: 6 })}</option>
|
||||||
|
<option value={86400}>{intl.formatMessage(messages.days, { number: 1 })}</option>
|
||||||
|
<option value={259200}>{intl.formatMessage(messages.days, { number: 3 })}</option>
|
||||||
|
<option value={604800}>{intl.formatMessage(messages.days, { number: 7 })}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='mute-modal__action-bar'>
|
<div className='mute-modal__action-bar'>
|
||||||
|
@ -66,9 +66,9 @@ export default class VideoModal extends ImmutablePureComponent {
|
|||||||
preview={media.get('preview_url')}
|
preview={media.get('preview_url')}
|
||||||
blurhash={media.get('blurhash')}
|
blurhash={media.get('blurhash')}
|
||||||
src={media.get('url')}
|
src={media.get('url')}
|
||||||
startTime={options.startTime}
|
currentTime={options.startTime}
|
||||||
autoPlay={options.autoPlay}
|
autoPlay={options.autoPlay}
|
||||||
defaultVolume={options.defaultVolume}
|
volume={options.defaultVolume}
|
||||||
onCloseVideo={onClose}
|
onCloseVideo={onClose}
|
||||||
detailed
|
detailed
|
||||||
alt={media.get('description')}
|
alt={media.get('description')}
|
||||||
|
@ -16,11 +16,12 @@ import { expandNotifications } from '../../actions/notifications';
|
|||||||
import { fetchFilters } from '../../actions/filters';
|
import { fetchFilters } from '../../actions/filters';
|
||||||
import { clearHeight } from '../../actions/height_cache';
|
import { clearHeight } from '../../actions/height_cache';
|
||||||
import { focusApp, unfocusApp } from 'mastodon/actions/app';
|
import { focusApp, unfocusApp } from 'mastodon/actions/app';
|
||||||
import { synchronouslySubmitMarkers } from 'mastodon/actions/markers';
|
import { synchronouslySubmitMarkers, submitMarkers, fetchMarkers } from 'mastodon/actions/markers';
|
||||||
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
|
import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
|
||||||
import UploadArea from './components/upload_area';
|
import UploadArea from './components/upload_area';
|
||||||
import ColumnsAreaContainer from './containers/columns_area_container';
|
import ColumnsAreaContainer from './containers/columns_area_container';
|
||||||
import DocumentTitle from './components/document_title';
|
import DocumentTitle from './components/document_title';
|
||||||
|
import PictureInPicture from 'mastodon/features/picture_in_picture';
|
||||||
import {
|
import {
|
||||||
Compose,
|
Compose,
|
||||||
Status,
|
Status,
|
||||||
@ -265,6 +266,7 @@ class UI extends React.PureComponent {
|
|||||||
|
|
||||||
handleWindowFocus = () => {
|
handleWindowFocus = () => {
|
||||||
this.props.dispatch(focusApp());
|
this.props.dispatch(focusApp());
|
||||||
|
this.props.dispatch(submitMarkers({ immediate: true }));
|
||||||
}
|
}
|
||||||
|
|
||||||
handleWindowBlur = () => {
|
handleWindowBlur = () => {
|
||||||
@ -364,10 +366,7 @@ class UI extends React.PureComponent {
|
|||||||
navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage);
|
navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof window.Notification !== 'undefined' && Notification.permission === 'default') {
|
this.props.dispatch(fetchMarkers());
|
||||||
window.setTimeout(() => Notification.requestPermission(), 120 * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.props.dispatch(expandHomeTimeline());
|
this.props.dispatch(expandHomeTimeline());
|
||||||
this.props.dispatch(expandNotifications());
|
this.props.dispatch(expandNotifications());
|
||||||
|
|
||||||
@ -376,7 +375,7 @@ class UI extends React.PureComponent {
|
|||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
|
this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
|
||||||
return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName) && !e.altKey;
|
return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,6 +544,7 @@ class UI extends React.PureComponent {
|
|||||||
{children}
|
{children}
|
||||||
</SwitchingColumnsArea>
|
</SwitchingColumnsArea>
|
||||||
|
|
||||||
|
<PictureInPicture />
|
||||||
<NotificationsContainer />
|
<NotificationsContainer />
|
||||||
<LoadingBarContainer className='loading-bar' />
|
<LoadingBarContainer className='loading-bar' />
|
||||||
<ModalContainer />
|
<ModalContainer />
|
||||||
|
@ -104,20 +104,23 @@ class Video extends React.PureComponent {
|
|||||||
width: PropTypes.number,
|
width: PropTypes.number,
|
||||||
height: PropTypes.number,
|
height: PropTypes.number,
|
||||||
sensitive: PropTypes.bool,
|
sensitive: PropTypes.bool,
|
||||||
startTime: PropTypes.number,
|
currentTime: PropTypes.number,
|
||||||
onOpenVideo: PropTypes.func,
|
onOpenVideo: PropTypes.func,
|
||||||
onCloseVideo: PropTypes.func,
|
onCloseVideo: PropTypes.func,
|
||||||
detailed: PropTypes.bool,
|
detailed: PropTypes.bool,
|
||||||
inline: PropTypes.bool,
|
inline: PropTypes.bool,
|
||||||
editable: PropTypes.bool,
|
editable: PropTypes.bool,
|
||||||
|
alwaysVisible: PropTypes.bool,
|
||||||
cacheWidth: PropTypes.func,
|
cacheWidth: PropTypes.func,
|
||||||
visible: PropTypes.bool,
|
visible: PropTypes.bool,
|
||||||
onToggleVisibility: PropTypes.func,
|
onToggleVisibility: PropTypes.func,
|
||||||
|
deployPictureInPicture: PropTypes.func,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
blurhash: PropTypes.string,
|
blurhash: PropTypes.string,
|
||||||
link: PropTypes.node,
|
link: PropTypes.node,
|
||||||
autoPlay: PropTypes.bool,
|
autoPlay: PropTypes.bool,
|
||||||
defaultVolume: PropTypes.number,
|
volume: PropTypes.number,
|
||||||
|
muted: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -195,7 +198,7 @@ class Video extends React.PureComponent {
|
|||||||
handleTimeUpdate = () => {
|
handleTimeUpdate = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
currentTime: this.video.currentTime,
|
currentTime: this.video.currentTime,
|
||||||
duration: Math.floor(this.video.duration),
|
duration:this.video.duration,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,6 +300,15 @@ class Video extends React.PureComponent {
|
|||||||
document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);
|
document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);
|
||||||
document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true);
|
document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true);
|
||||||
document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true);
|
document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true);
|
||||||
|
|
||||||
|
if (!this.state.paused && this.video && this.props.deployPictureInPicture) {
|
||||||
|
this.props.deployPictureInPicture('video', {
|
||||||
|
src: this.props.src,
|
||||||
|
currentTime: this.video.currentTime,
|
||||||
|
muted: this.video.muted,
|
||||||
|
volume: this.video.volume,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
@ -328,7 +340,18 @@ class Video extends React.PureComponent {
|
|||||||
const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);
|
const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);
|
||||||
|
|
||||||
if (!this.state.paused && !inView) {
|
if (!this.state.paused && !inView) {
|
||||||
this.setState({ paused: true }, () => this.video.pause());
|
this.video.pause();
|
||||||
|
|
||||||
|
if (this.props.deployPictureInPicture) {
|
||||||
|
this.props.deployPictureInPicture('video', {
|
||||||
|
src: this.props.src,
|
||||||
|
currentTime: this.video.currentTime,
|
||||||
|
muted: this.video.muted,
|
||||||
|
volume: this.video.volume,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ paused: true });
|
||||||
}
|
}
|
||||||
}, 150, { trailing: true })
|
}, 150, { trailing: true })
|
||||||
|
|
||||||
@ -361,15 +384,21 @@ class Video extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleLoadedData = () => {
|
handleLoadedData = () => {
|
||||||
if (this.props.startTime) {
|
const { currentTime, volume, muted, autoPlay } = this.props;
|
||||||
this.video.currentTime = this.props.startTime;
|
|
||||||
|
if (currentTime) {
|
||||||
|
this.video.currentTime = currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.defaultVolume !== undefined) {
|
if (volume !== undefined) {
|
||||||
this.video.volume = this.props.defaultVolume;
|
this.video.volume = volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.autoPlay) {
|
if (muted !== undefined) {
|
||||||
|
this.video.muted = muted;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (autoPlay) {
|
||||||
this.video.play();
|
this.video.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,9 +443,9 @@ class Video extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { preview, src, inline, startTime, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, link, editable, blurhash } = this.props;
|
const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, link, editable, blurhash } = this.props;
|
||||||
const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;
|
const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;
|
||||||
const progress = (currentTime / duration) * 100;
|
const progress = Math.min((currentTime / duration) * 100, 100);
|
||||||
const playerStyle = {};
|
const playerStyle = {};
|
||||||
|
|
||||||
let { width, height } = this.props;
|
let { width, height } = this.props;
|
||||||
@ -430,7 +459,7 @@ class Video extends React.PureComponent {
|
|||||||
|
|
||||||
let preload;
|
let preload;
|
||||||
|
|
||||||
if (startTime || fullscreen || dragging) {
|
if (this.props.currentTime || fullscreen || dragging) {
|
||||||
preload = 'auto';
|
preload = 'auto';
|
||||||
} else if (detailed) {
|
} else if (detailed) {
|
||||||
preload = 'metadata';
|
preload = 'metadata';
|
||||||
@ -505,8 +534,8 @@ class Video extends React.PureComponent {
|
|||||||
|
|
||||||
<div className='video-player__buttons-bar'>
|
<div className='video-player__buttons-bar'>
|
||||||
<div className='video-player__buttons left'>
|
<div className='video-player__buttons left'>
|
||||||
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay} autoFocus={detailed}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>
|
<button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} className='player-button' onClick={this.togglePlay} autoFocus={detailed}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>
|
||||||
<button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>
|
<button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} className='player-button' onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>
|
||||||
|
|
||||||
<div className={classNames('video-player__volume', { active: this.state.hovered })} onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>
|
<div className={classNames('video-player__volume', { active: this.state.hovered })} onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>
|
||||||
<div className='video-player__volume__current' style={{ width: `${volume * 100}%` }} />
|
<div className='video-player__volume__current' style={{ width: `${volume * 100}%` }} />
|
||||||
@ -522,7 +551,7 @@ class Video extends React.PureComponent {
|
|||||||
<span className='video-player__time'>
|
<span className='video-player__time'>
|
||||||
<span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
|
<span className='video-player__time-current'>{formatTime(Math.floor(currentTime))}</span>
|
||||||
<span className='video-player__time-sep'>/</span>
|
<span className='video-player__time-sep'>/</span>
|
||||||
<span className='video-player__time-total'>{formatTime(duration)}</span>
|
<span className='video-player__time-total'>{formatTime(Math.floor(duration))}</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -530,10 +559,10 @@ class Video extends React.PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='video-player__buttons right'>
|
<div className='video-player__buttons right'>
|
||||||
{(!onCloseVideo && !editable && !fullscreen) && <button type='button' title={intl.formatMessage(messages.hide)} aria-label={intl.formatMessage(messages.hide)} onClick={this.toggleReveal}><Icon id='eye-slash' fixedWidth /></button>}
|
{(!onCloseVideo && !editable && !fullscreen && !this.props.alwaysVisible) && <button type='button' title={intl.formatMessage(messages.hide)} aria-label={intl.formatMessage(messages.hide)} className='player-button' onClick={this.toggleReveal}><Icon id='eye-slash' fixedWidth /></button>}
|
||||||
{(!fullscreen && onOpenVideo) && <button type='button' title={intl.formatMessage(messages.expand)} aria-label={intl.formatMessage(messages.expand)} onClick={this.handleOpenVideo}><Icon id='expand' fixedWidth /></button>}
|
{(!fullscreen && onOpenVideo) && <button type='button' title={intl.formatMessage(messages.expand)} aria-label={intl.formatMessage(messages.expand)} className='player-button' onClick={this.handleOpenVideo}><Icon id='expand' fixedWidth /></button>}
|
||||||
{onCloseVideo && <button type='button' title={intl.formatMessage(messages.close)} aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}
|
{onCloseVideo && <button type='button' title={intl.formatMessage(messages.close)} aria-label={intl.formatMessage(messages.close)} className='player-button' onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}
|
||||||
<button type='button' title={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} onClick={this.toggleFullscreen}><Icon id={fullscreen ? 'compress' : 'arrows-alt'} fixedWidth /></button>
|
<button type='button' title={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} className='player-button' onClick={this.toggleFullscreen}><Icon id={fullscreen ? 'compress' : 'arrows-alt'} fixedWidth /></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,5 +25,6 @@ export const usePendingItems = getMeta('use_pending_items');
|
|||||||
export const showTrends = getMeta('trends');
|
export const showTrends = getMeta('trends');
|
||||||
export const title = getMeta('title');
|
export const title = getMeta('title');
|
||||||
export const cropImages = getMeta('crop_images');
|
export const cropImages = getMeta('crop_images');
|
||||||
|
export const disableSwiping = getMeta('disable_swiping');
|
||||||
|
|
||||||
export default initialState;
|
export default initialState;
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Barritar",
|
"compose_form.publish": "Barritar",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "El testu nun va anubrise darrera d'una alvertencia",
|
"compose_form.spoiler.marked": "El testu nun va anubrise darrera d'una alvertencia",
|
||||||
"compose_form.spoiler.unmarked": "El testu nun va anubrise",
|
"compose_form.spoiler.unmarked": "El testu nun va anubrise",
|
||||||
"compose_form.spoiler_placeholder": "Escribi equí l'alvertencia",
|
"compose_form.spoiler_placeholder": "Escribi equí l'alvertencia",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Раздумай",
|
"compose_form.publish": "Раздумай",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Content warning",
|
"compose_form.spoiler_placeholder": "Content warning",
|
||||||
|
@ -167,10 +167,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "This page could not be displayed correctly. This error is likely caused by a browser add-on or automatic translation tools.",
|
||||||
|
"id": "error.unexpected_crash.explanation_addons"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Due to a bug in our code or a browser compatibility issue, this page could not be displayed correctly.",
|
"defaultMessage": "Due to a bug in our code or a browser compatibility issue, this page could not be displayed correctly.",
|
||||||
"id": "error.unexpected_crash.explanation"
|
"id": "error.unexpected_crash.explanation"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Try disabling them and refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
||||||
|
"id": "error.unexpected_crash.next_steps_addons"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Try refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
"defaultMessage": "Try refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
||||||
"id": "error.unexpected_crash.next_steps"
|
"id": "error.unexpected_crash.next_steps"
|
||||||
@ -265,6 +273,15 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/components/missing_indicator.json"
|
"path": "app/javascript/mastodon/components/missing_indicator.json"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "Put it back",
|
||||||
|
"id": "picture_in_picture.restore"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"path": "app/javascript/mastodon/components/picture_in_picture_placeholder.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
{
|
{
|
||||||
@ -633,6 +650,15 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/containers/status_container.json"
|
"path": "app/javascript/mastodon/containers/status_container.json"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "Profile unavailable",
|
||||||
|
"id": "empty_column.account_unavailable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"path": "app/javascript/mastodon/features/account_gallery/index.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
{
|
{
|
||||||
@ -796,6 +822,14 @@
|
|||||||
"defaultMessage": "Show boosts from @{name}",
|
"defaultMessage": "Show boosts from @{name}",
|
||||||
"id": "account.show_reblogs"
|
"id": "account.show_reblogs"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Notify me when @{name} posts",
|
||||||
|
"id": "account.enable_notifications"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Stop notifying me when @{name} posts",
|
||||||
|
"id": "account.disable_notifications"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Pinned toots",
|
"defaultMessage": "Pinned toots",
|
||||||
"id": "navigation_bar.pins"
|
"id": "navigation_bar.pins"
|
||||||
@ -1305,15 +1339,15 @@
|
|||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
{
|
{
|
||||||
"defaultMessage": "Media is marked as sensitive",
|
"defaultMessage": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"id": "compose_form.sensitive.marked"
|
"id": "compose_form.sensitive.marked"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Media is not marked as sensitive",
|
"defaultMessage": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"id": "compose_form.sensitive.unmarked"
|
"id": "compose_form.sensitive.unmarked"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Mark media as sensitive",
|
"defaultMessage": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"id": "compose_form.sensitive.hide"
|
"id": "compose_form.sensitive.hide"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -2125,6 +2159,18 @@
|
|||||||
"defaultMessage": "Delete",
|
"defaultMessage": "Delete",
|
||||||
"id": "confirmations.delete_list.confirm"
|
"id": "confirmations.delete_list.confirm"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Any followed user",
|
||||||
|
"id": "lists.replies_policy.all_replies"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "No one",
|
||||||
|
"id": "lists.replies_policy.no_replies"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Members of the list",
|
||||||
|
"id": "lists.replies_policy.list_replies"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Edit list",
|
"defaultMessage": "Edit list",
|
||||||
"id": "lists.edit"
|
"id": "lists.edit"
|
||||||
@ -2133,6 +2179,10 @@
|
|||||||
"defaultMessage": "Delete list",
|
"defaultMessage": "Delete list",
|
||||||
"id": "lists.delete"
|
"id": "lists.delete"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Show replies to:",
|
||||||
|
"id": "lists.replies_policy.title"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "There is nothing in this list yet. When members of this list post new statuses, they will appear here.",
|
"defaultMessage": "There is nothing in this list yet. When members of this list post new statuses, they will appear here.",
|
||||||
"id": "empty_column.list"
|
"id": "empty_column.list"
|
||||||
@ -2218,6 +2268,10 @@
|
|||||||
"defaultMessage": "Push notifications",
|
"defaultMessage": "Push notifications",
|
||||||
"id": "notifications.column_settings.push"
|
"id": "notifications.column_settings.push"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Desktop notifications are unavailable due to previously denied browser permissions request",
|
||||||
|
"id": "notifications.permission_denied"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Quick filter bar",
|
"defaultMessage": "Quick filter bar",
|
||||||
"id": "notifications.column_settings.filter_bar.category"
|
"id": "notifications.column_settings.filter_bar.category"
|
||||||
@ -2245,6 +2299,10 @@
|
|||||||
{
|
{
|
||||||
"defaultMessage": "Poll results:",
|
"defaultMessage": "Poll results:",
|
||||||
"id": "notifications.column_settings.poll"
|
"id": "notifications.column_settings.poll"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "New toots:",
|
||||||
|
"id": "notifications.column_settings.status"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/notifications/components/column_settings.json"
|
"path": "app/javascript/mastodon/features/notifications/components/column_settings.json"
|
||||||
@ -2271,6 +2329,10 @@
|
|||||||
"defaultMessage": "Follows",
|
"defaultMessage": "Follows",
|
||||||
"id": "notifications.filter.follows"
|
"id": "notifications.filter.follows"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Updates from people you follow",
|
||||||
|
"id": "notifications.filter.statuses"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "All",
|
"defaultMessage": "All",
|
||||||
"id": "notifications.filter.all"
|
"id": "notifications.filter.all"
|
||||||
@ -2313,6 +2375,10 @@
|
|||||||
"defaultMessage": "{name} boosted your status",
|
"defaultMessage": "{name} boosted your status",
|
||||||
"id": "notification.reblog"
|
"id": "notification.reblog"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "{name} just posted",
|
||||||
|
"id": "notification.status"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "{name} has requested to follow you",
|
"defaultMessage": "{name} has requested to follow you",
|
||||||
"id": "notification.follow_request"
|
"id": "notification.follow_request"
|
||||||
@ -2320,6 +2386,23 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/notifications/components/notification.json"
|
"path": "app/javascript/mastodon/features/notifications/components/notification.json"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "Never miss a thing",
|
||||||
|
"id": "notifications_permission_banner.title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.",
|
||||||
|
"id": "notifications_permission_banner.how_to_control"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Enable desktop notifications",
|
||||||
|
"id": "notifications_permission_banner.enable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"path": "app/javascript/mastodon/features/notifications/components/notifications_permission_banner.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
{
|
{
|
||||||
@ -2329,6 +2412,10 @@
|
|||||||
{
|
{
|
||||||
"defaultMessage": "Clear notifications",
|
"defaultMessage": "Clear notifications",
|
||||||
"id": "notifications.clear"
|
"id": "notifications.clear"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Desktop notifications can't be enabled, as browser permission has been denied before",
|
||||||
|
"id": "notifications.permission_denied_alert"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/notifications/containers/column_settings_container.json"
|
"path": "app/javascript/mastodon/features/notifications/containers/column_settings_container.json"
|
||||||
@ -2339,6 +2426,10 @@
|
|||||||
"defaultMessage": "Notifications",
|
"defaultMessage": "Notifications",
|
||||||
"id": "column.notifications"
|
"id": "column.notifications"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Mark every notification as read",
|
||||||
|
"id": "notifications.mark_as_read"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "You don't have any notifications yet. Interact with others to start the conversation.",
|
"defaultMessage": "You don't have any notifications yet. Interact with others to start the conversation.",
|
||||||
"id": "empty_column.notifications"
|
"id": "empty_column.notifications"
|
||||||
@ -2346,6 +2437,47 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/notifications/index.json"
|
"path": "app/javascript/mastodon/features/notifications/index.json"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "Reply",
|
||||||
|
"id": "status.reply"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Reply to thread",
|
||||||
|
"id": "status.replyAll"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Boost",
|
||||||
|
"id": "status.reblog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Boost with original visibility",
|
||||||
|
"id": "status.reblog_private"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Unboost",
|
||||||
|
"id": "status.cancel_reblog_private"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "This post cannot be boosted",
|
||||||
|
"id": "status.cannot_reblog"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Favourite",
|
||||||
|
"id": "status.favourite"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Reply",
|
||||||
|
"id": "confirmations.reply.confirm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?",
|
||||||
|
"id": "confirmations.reply.message"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"path": "app/javascript/mastodon/features/picture_in_picture/components/footer.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
{
|
{
|
||||||
@ -2785,6 +2917,14 @@
|
|||||||
"defaultMessage": "Describe for the visually impaired",
|
"defaultMessage": "Describe for the visually impaired",
|
||||||
"id": "upload_form.description"
|
"id": "upload_form.description"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Analyzing picture…",
|
||||||
|
"id": "upload_modal.analyzing_picture"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Preparing OCR…",
|
||||||
|
"id": "upload_modal.preparing_ocr"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Edit media",
|
"defaultMessage": "Edit media",
|
||||||
"id": "upload_modal.edit_media"
|
"id": "upload_modal.edit_media"
|
||||||
@ -2797,10 +2937,6 @@
|
|||||||
"defaultMessage": "Change thumbnail",
|
"defaultMessage": "Change thumbnail",
|
||||||
"id": "upload_form.thumbnail"
|
"id": "upload_form.thumbnail"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"defaultMessage": "Analyzing picture…",
|
|
||||||
"id": "upload_modal.analyzing_picture"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"defaultMessage": "Detect text from picture",
|
"defaultMessage": "Detect text from picture",
|
||||||
"id": "upload_modal.detect_text"
|
"id": "upload_modal.detect_text"
|
||||||
@ -2897,6 +3033,22 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"descriptors": [
|
"descriptors": [
|
||||||
|
{
|
||||||
|
"defaultMessage": "{number, plural, one {# minute} other {# minutes}}",
|
||||||
|
"id": "intervals.full.minutes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "{number, plural, one {# hour} other {# hours}}",
|
||||||
|
"id": "intervals.full.hours"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "{number, plural, one {# day} other {# days}}",
|
||||||
|
"id": "intervals.full.days"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Indefinite",
|
||||||
|
"id": "mute_modal.indefinite"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Are you sure you want to mute {name}?",
|
"defaultMessage": "Are you sure you want to mute {name}?",
|
||||||
"id": "confirmations.mute.message"
|
"id": "confirmations.mute.message"
|
||||||
@ -2909,6 +3061,10 @@
|
|||||||
"defaultMessage": "Hide notifications from this user?",
|
"defaultMessage": "Hide notifications from this user?",
|
||||||
"id": "mute_modal.hide_notifications"
|
"id": "mute_modal.hide_notifications"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Duration",
|
||||||
|
"id": "mute_modal.duration"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"defaultMessage": "Cancel",
|
"defaultMessage": "Cancel",
|
||||||
"id": "confirmation_modal.cancel"
|
"id": "confirmation_modal.cancel"
|
||||||
|
@ -9,8 +9,10 @@
|
|||||||
"account.browse_more_on_origin_server": "Browse more on the original profile",
|
"account.browse_more_on_origin_server": "Browse more on the original profile",
|
||||||
"account.cancel_follow_request": "Cancel follow request",
|
"account.cancel_follow_request": "Cancel follow request",
|
||||||
"account.direct": "Direct message @{name}",
|
"account.direct": "Direct message @{name}",
|
||||||
|
"account.disable_notifications": "Stop notifying me when @{name} posts",
|
||||||
"account.domain_blocked": "Domain blocked",
|
"account.domain_blocked": "Domain blocked",
|
||||||
"account.edit_profile": "Edit profile",
|
"account.edit_profile": "Edit profile",
|
||||||
|
"account.enable_notifications": "Notify me when @{name} posts",
|
||||||
"account.endorse": "Feature on profile",
|
"account.endorse": "Feature on profile",
|
||||||
"account.follow": "Follow",
|
"account.follow": "Follow",
|
||||||
"account.followers": "Followers",
|
"account.followers": "Followers",
|
||||||
@ -96,9 +98,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
@ -166,7 +168,9 @@
|
|||||||
"empty_column.notifications": "You don't have any notifications yet. Interact with others to start the conversation.",
|
"empty_column.notifications": "You don't have any notifications yet. Interact with others to start the conversation.",
|
||||||
"empty_column.public": "There is nothing here! Write something publicly, or manually follow users from other servers to fill it up",
|
"empty_column.public": "There is nothing here! Write something publicly, or manually follow users from other servers to fill it up",
|
||||||
"error.unexpected_crash.explanation": "Due to a bug in our code or a browser compatibility issue, this page could not be displayed correctly.",
|
"error.unexpected_crash.explanation": "Due to a bug in our code or a browser compatibility issue, this page could not be displayed correctly.",
|
||||||
|
"error.unexpected_crash.explanation_addons": "This page could not be displayed correctly. This error is likely caused by a browser add-on or automatic translation tools.",
|
||||||
"error.unexpected_crash.next_steps": "Try refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
"error.unexpected_crash.next_steps": "Try refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
||||||
|
"error.unexpected_crash.next_steps_addons": "Try disabling them and refreshing the page. If that does not help, you may still be able to use Mastodon through a different browser or native app.",
|
||||||
"errors.unexpected_crash.copy_stacktrace": "Copy stacktrace to clipboard",
|
"errors.unexpected_crash.copy_stacktrace": "Copy stacktrace to clipboard",
|
||||||
"errors.unexpected_crash.report_issue": "Report issue",
|
"errors.unexpected_crash.report_issue": "Report issue",
|
||||||
"follow_request.authorize": "Authorize",
|
"follow_request.authorize": "Authorize",
|
||||||
@ -260,6 +264,10 @@
|
|||||||
"lists.edit.submit": "Change title",
|
"lists.edit.submit": "Change title",
|
||||||
"lists.new.create": "Add list",
|
"lists.new.create": "Add list",
|
||||||
"lists.new.title_placeholder": "New list title",
|
"lists.new.title_placeholder": "New list title",
|
||||||
|
"lists.replies_policy.all_replies": "Any followed user",
|
||||||
|
"lists.replies_policy.list_replies": "Members of the list",
|
||||||
|
"lists.replies_policy.no_replies": "No one",
|
||||||
|
"lists.replies_policy.title": "Show replies to:",
|
||||||
"lists.search": "Search among people you follow",
|
"lists.search": "Search among people you follow",
|
||||||
"lists.subheading": "Your lists",
|
"lists.subheading": "Your lists",
|
||||||
"load_pending": "{count, plural, one {# new item} other {# new items}}",
|
"load_pending": "{count, plural, one {# new item} other {# new items}}",
|
||||||
@ -267,7 +275,9 @@
|
|||||||
"media_gallery.toggle_visible": "Hide {number, plural, one {image} other {images}}",
|
"media_gallery.toggle_visible": "Hide {number, plural, one {image} other {images}}",
|
||||||
"missing_indicator.label": "Not found",
|
"missing_indicator.label": "Not found",
|
||||||
"missing_indicator.sublabel": "This resource could not be found",
|
"missing_indicator.sublabel": "This resource could not be found",
|
||||||
|
"mute_modal.duration": "Duration",
|
||||||
"mute_modal.hide_notifications": "Hide notifications from this user?",
|
"mute_modal.hide_notifications": "Hide notifications from this user?",
|
||||||
|
"mute_modal.indefinite": "Indefinite",
|
||||||
"navigation_bar.apps": "Mobile apps",
|
"navigation_bar.apps": "Mobile apps",
|
||||||
"navigation_bar.blocks": "Blocked users",
|
"navigation_bar.blocks": "Blocked users",
|
||||||
"navigation_bar.bookmarks": "Bookmarks",
|
"navigation_bar.bookmarks": "Bookmarks",
|
||||||
@ -298,6 +308,7 @@
|
|||||||
"notification.own_poll": "Your poll has ended",
|
"notification.own_poll": "Your poll has ended",
|
||||||
"notification.poll": "A poll you have voted in has ended",
|
"notification.poll": "A poll you have voted in has ended",
|
||||||
"notification.reblog": "{name} boosted your toot",
|
"notification.reblog": "{name} boosted your toot",
|
||||||
|
"notification.status": "{name} just posted",
|
||||||
"notifications.clear": "Clear notifications",
|
"notifications.clear": "Clear notifications",
|
||||||
"notifications.clear_confirmation": "Are you sure you want to permanently clear all your notifications?",
|
"notifications.clear_confirmation": "Are you sure you want to permanently clear all your notifications?",
|
||||||
"notifications.column_settings.alert": "Desktop notifications",
|
"notifications.column_settings.alert": "Desktop notifications",
|
||||||
@ -313,13 +324,22 @@
|
|||||||
"notifications.column_settings.reblog": "Boosts:",
|
"notifications.column_settings.reblog": "Boosts:",
|
||||||
"notifications.column_settings.show": "Show in column",
|
"notifications.column_settings.show": "Show in column",
|
||||||
"notifications.column_settings.sound": "Play sound",
|
"notifications.column_settings.sound": "Play sound",
|
||||||
|
"notifications.column_settings.status": "New toots:",
|
||||||
"notifications.filter.all": "All",
|
"notifications.filter.all": "All",
|
||||||
"notifications.filter.boosts": "Boosts",
|
"notifications.filter.boosts": "Boosts",
|
||||||
"notifications.filter.favourites": "Favourites",
|
"notifications.filter.favourites": "Favourites",
|
||||||
"notifications.filter.follows": "Follows",
|
"notifications.filter.follows": "Follows",
|
||||||
"notifications.filter.mentions": "Mentions",
|
"notifications.filter.mentions": "Mentions",
|
||||||
"notifications.filter.polls": "Poll results",
|
"notifications.filter.polls": "Poll results",
|
||||||
|
"notifications.filter.statuses": "Updates from people you follow",
|
||||||
"notifications.group": "{count} notifications",
|
"notifications.group": "{count} notifications",
|
||||||
|
"notifications.mark_as_read": "Mark every notification as read",
|
||||||
|
"notifications.permission_denied": "Desktop notifications are unavailable due to previously denied browser permissions request",
|
||||||
|
"notifications.permission_denied_alert": "Desktop notifications can't be enabled, as browser permission has been denied before",
|
||||||
|
"notifications_permission_banner.enable": "Enable desktop notifications",
|
||||||
|
"notifications_permission_banner.how_to_control": "To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.",
|
||||||
|
"notifications_permission_banner.title": "Never miss a thing",
|
||||||
|
"picture_in_picture.restore": "Put it back",
|
||||||
"poll.closed": "Closed",
|
"poll.closed": "Closed",
|
||||||
"poll.refresh": "Refresh",
|
"poll.refresh": "Refresh",
|
||||||
"poll.total_people": "{count, plural, one {# person} other {# people}}",
|
"poll.total_people": "{count, plural, one {# person} other {# people}}",
|
||||||
@ -446,6 +466,7 @@
|
|||||||
"upload_modal.detect_text": "Detect text from picture",
|
"upload_modal.detect_text": "Detect text from picture",
|
||||||
"upload_modal.edit_media": "Edit media",
|
"upload_modal.edit_media": "Edit media",
|
||||||
"upload_modal.hint": "Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.",
|
"upload_modal.hint": "Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.",
|
||||||
|
"upload_modal.preparing_ocr": "Preparing OCR…",
|
||||||
"upload_modal.preview_label": "Preview ({ratio})",
|
"upload_modal.preview_label": "Preview ({ratio})",
|
||||||
"upload_progress.label": "Uploading...",
|
"upload_progress.label": "Uploading...",
|
||||||
"video.close": "Close video",
|
"video.close": "Close video",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "ללחוש",
|
"compose_form.publish": "ללחוש",
|
||||||
"compose_form.publish_loud": "לחצרץ!",
|
"compose_form.publish_loud": "לחצרץ!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "אזהרת תוכן",
|
"compose_form.spoiler_placeholder": "אזהרת תוכן",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Upozorenje o sadržaju",
|
"compose_form.spoiler_placeholder": "Upozorenje o sadržaju",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Siflar",
|
"compose_form.publish": "Siflar",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Averto di kontenajo",
|
"compose_form.spoiler_placeholder": "Averto di kontenajo",
|
||||||
|
@ -268,6 +268,8 @@
|
|||||||
"missing_indicator.label": "見つかりません",
|
"missing_indicator.label": "見つかりません",
|
||||||
"missing_indicator.sublabel": "見つかりませんでした",
|
"missing_indicator.sublabel": "見つかりませんでした",
|
||||||
"mute_modal.hide_notifications": "このユーザーからの通知を隠しますか?",
|
"mute_modal.hide_notifications": "このユーザーからの通知を隠しますか?",
|
||||||
|
"mute_modal.duration": "ミュートする期間",
|
||||||
|
"mute_modal.indefinite": "無期限",
|
||||||
"navigation_bar.apps": "アプリ",
|
"navigation_bar.apps": "アプリ",
|
||||||
"navigation_bar.blocks": "ブロックしたユーザー",
|
"navigation_bar.blocks": "ブロックしたユーザー",
|
||||||
"navigation_bar.bookmarks": "ブックマーク",
|
"navigation_bar.bookmarks": "ブックマーク",
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "ტუტი",
|
"compose_form.publish": "ტუტი",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "მედია მონიშნულია მგრძნობიარედ",
|
"compose_form.sensitive.marked": "მედია მონიშნულია მგრძნობიარედ",
|
||||||
"compose_form.sensitive.unmarked": "მედია არაა მონიშნული მგრძნობიარედ",
|
"compose_form.sensitive.unmarked": "მედია არაა მონიშნული მგრძნობიარედ",
|
||||||
"compose_form.spoiler.marked": "გაფრთხილების უკან ტექსტი დამალულია",
|
"compose_form.spoiler.marked": "გაფრთხილების უკან ტექსტი დამალულია",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Publicēt",
|
"compose_form.publish": "Publicēt",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Mēdijs ir atzīmēts kā sensitīvs",
|
"compose_form.sensitive.marked": "Mēdijs ir atzīmēts kā sensitīvs",
|
||||||
"compose_form.sensitive.unmarked": "Mēdijs nav atzīmēts kā sensitīvs",
|
"compose_form.sensitive.unmarked": "Mēdijs nav atzīmēts kā sensitīvs",
|
||||||
"compose_form.spoiler.marked": "Teksts ir paslēpts aiz brīdinājuma",
|
"compose_form.spoiler.marked": "Teksts ir paslēpts aiz brīdinājuma",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "ടൂട്ട്",
|
"compose_form.publish": "ടൂട്ട്",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "എഴുത്ത് മുന്നറിയിപ്പിനാൽ മറച്ചിരിക്കുന്നു",
|
"compose_form.spoiler.marked": "എഴുത്ത് മുന്നറിയിപ്പിനാൽ മറച്ചിരിക്കുന്നു",
|
||||||
"compose_form.spoiler.unmarked": "എഴുത്ത് മറയ്ക്കപ്പെട്ടിട്ടില്ല",
|
"compose_form.spoiler.unmarked": "എഴുത്ത് മറയ്ക്കപ്പെട്ടിട്ടില്ല",
|
||||||
"compose_form.spoiler_placeholder": "നിങ്ങളുടെ മുന്നറിയിപ്പ് ഇവിടെ എഴുതുക",
|
"compose_form.spoiler_placeholder": "നിങ്ങളുടെ മുന്നറിയിപ്പ് ഇവിടെ എഴുതുക",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Tutni",
|
"compose_form.publish": "Tutni",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Ovde upišite upozorenje",
|
"compose_form.spoiler_placeholder": "Ovde upišite upozorenje",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "టూట్",
|
"compose_form.publish": "టూట్",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "మీడియా సున్నితమైనదిగా గుర్తించబడింది",
|
"compose_form.sensitive.marked": "మీడియా సున్నితమైనదిగా గుర్తించబడింది",
|
||||||
"compose_form.sensitive.unmarked": "మీడియా సున్నితమైనదిగా గుర్తించబడలేదు",
|
"compose_form.sensitive.unmarked": "మీడియా సున్నితమైనదిగా గుర్తించబడలేదు",
|
||||||
"compose_form.spoiler.marked": "హెచ్చరిక వెనుక పాఠ్యం దాచబడింది",
|
"compose_form.spoiler.marked": "హెచ్చరిక వెనుక పాఠ్యం దాచబడింది",
|
||||||
|
@ -96,9 +96,9 @@
|
|||||||
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
"compose_form.poll.switch_to_single": "Change poll to allow for a single choice",
|
||||||
"compose_form.publish": "Toot",
|
"compose_form.publish": "Toot",
|
||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "Mark media as sensitive",
|
"compose_form.sensitive.hide": "{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}",
|
||||||
"compose_form.sensitive.marked": "Media is marked as sensitive",
|
"compose_form.sensitive.marked": "{count, plural, one {Media is marked as sensitive} other {Media is marked as sensitive}}",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -98,7 +98,7 @@
|
|||||||
"compose_form.publish_loud": "{publish}!",
|
"compose_form.publish_loud": "{publish}!",
|
||||||
"compose_form.sensitive.hide": "وسائل کو حساس نشاندہ کریں",
|
"compose_form.sensitive.hide": "وسائل کو حساس نشاندہ کریں",
|
||||||
"compose_form.sensitive.marked": "وسائل حساس نشاندہ ہے",
|
"compose_form.sensitive.marked": "وسائل حساس نشاندہ ہے",
|
||||||
"compose_form.sensitive.unmarked": "Media is not marked as sensitive",
|
"compose_form.sensitive.unmarked": "{count, plural, one {Media is not marked as sensitive} other {Media is not marked as sensitive}}",
|
||||||
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
"compose_form.spoiler.marked": "Text is hidden behind warning",
|
||||||
"compose_form.spoiler.unmarked": "Text is not hidden",
|
"compose_form.spoiler.unmarked": "Text is not hidden",
|
||||||
"compose_form.spoiler_placeholder": "Write your warning here",
|
"compose_form.spoiler_placeholder": "Write your warning here",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import * as registerPushNotifications from './actions/push_notifications';
|
import * as registerPushNotifications from './actions/push_notifications';
|
||||||
|
import { setupBrowserNotifications } from './actions/notifications';
|
||||||
import { default as Mastodon, store } from './containers/mastodon';
|
import { default as Mastodon, store } from './containers/mastodon';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
@ -22,6 +23,7 @@ function main() {
|
|||||||
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
||||||
|
|
||||||
ReactDOM.render(<Mastodon {...props} />, mountNode);
|
ReactDOM.render(<Mastodon {...props} />, mountNode);
|
||||||
|
store.dispatch(setupBrowserNotifications());
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
// avoid offline in dev mode because it's harder to debug
|
// avoid offline in dev mode because it's harder to debug
|
||||||
require('offline-plugin/runtime').install();
|
require('offline-plugin/runtime').install();
|
||||||
|
@ -36,6 +36,7 @@ import trends from './trends';
|
|||||||
import missed_updates from './missed_updates';
|
import missed_updates from './missed_updates';
|
||||||
import announcements from './announcements';
|
import announcements from './announcements';
|
||||||
import markers from './markers';
|
import markers from './markers';
|
||||||
|
import picture_in_picture from './picture_in_picture';
|
||||||
|
|
||||||
const reducers = {
|
const reducers = {
|
||||||
announcements,
|
announcements,
|
||||||
@ -75,6 +76,7 @@ const reducers = {
|
|||||||
trends,
|
trends,
|
||||||
missed_updates,
|
missed_updates,
|
||||||
markers,
|
markers,
|
||||||
|
picture_in_picture,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default combineReducers(reducers);
|
export default combineReducers(reducers);
|
||||||
|
@ -3,12 +3,14 @@ import Immutable from 'immutable';
|
|||||||
import {
|
import {
|
||||||
MUTES_INIT_MODAL,
|
MUTES_INIT_MODAL,
|
||||||
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
|
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
|
||||||
|
MUTES_CHANGE_DURATION,
|
||||||
} from '../actions/mutes';
|
} from '../actions/mutes';
|
||||||
|
|
||||||
const initialState = Immutable.Map({
|
const initialState = Immutable.Map({
|
||||||
new: Immutable.Map({
|
new: Immutable.Map({
|
||||||
account: null,
|
account: null,
|
||||||
notifications: true,
|
notifications: true,
|
||||||
|
duration: 0,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -21,6 +23,8 @@ export default function mutes(state = initialState, action) {
|
|||||||
});
|
});
|
||||||
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
|
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
|
||||||
return state.updateIn(['new', 'notifications'], (old) => !old);
|
return state.updateIn(['new', 'notifications'], (old) => !old);
|
||||||
|
case MUTES_CHANGE_DURATION:
|
||||||
|
return state.setIn(['new', 'duration'], Number(action.duration));
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,9 @@ import {
|
|||||||
NOTIFICATIONS_LOAD_PENDING,
|
NOTIFICATIONS_LOAD_PENDING,
|
||||||
NOTIFICATIONS_MOUNT,
|
NOTIFICATIONS_MOUNT,
|
||||||
NOTIFICATIONS_UNMOUNT,
|
NOTIFICATIONS_UNMOUNT,
|
||||||
|
NOTIFICATIONS_MARK_AS_READ,
|
||||||
|
NOTIFICATIONS_SET_BROWSER_SUPPORT,
|
||||||
|
NOTIFICATIONS_SET_BROWSER_PERMISSION,
|
||||||
} from '../actions/notifications';
|
} from '../actions/notifications';
|
||||||
import {
|
import {
|
||||||
ACCOUNT_BLOCK_SUCCESS,
|
ACCOUNT_BLOCK_SUCCESS,
|
||||||
@ -16,6 +19,13 @@ import {
|
|||||||
FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
|
FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
|
||||||
FOLLOW_REQUEST_REJECT_SUCCESS,
|
FOLLOW_REQUEST_REJECT_SUCCESS,
|
||||||
} from '../actions/accounts';
|
} from '../actions/accounts';
|
||||||
|
import {
|
||||||
|
MARKERS_FETCH_SUCCESS,
|
||||||
|
} from '../actions/markers';
|
||||||
|
import {
|
||||||
|
APP_FOCUS,
|
||||||
|
APP_UNFOCUS,
|
||||||
|
} from '../actions/app';
|
||||||
import { DOMAIN_BLOCK_SUCCESS } from 'mastodon/actions/domain_blocks';
|
import { DOMAIN_BLOCK_SUCCESS } from 'mastodon/actions/domain_blocks';
|
||||||
import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from '../actions/timelines';
|
import { TIMELINE_DELETE, TIMELINE_DISCONNECT } from '../actions/timelines';
|
||||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||||
@ -26,9 +36,14 @@ const initialState = ImmutableMap({
|
|||||||
items: ImmutableList(),
|
items: ImmutableList(),
|
||||||
hasMore: true,
|
hasMore: true,
|
||||||
top: false,
|
top: false,
|
||||||
mounted: false,
|
mounted: 0,
|
||||||
unread: 0,
|
unread: 0,
|
||||||
|
lastReadId: '0',
|
||||||
|
readMarkerId: '0',
|
||||||
|
isTabVisible: true,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
browserSupport: false,
|
||||||
|
browserPermission: 'default',
|
||||||
});
|
});
|
||||||
|
|
||||||
const notificationToMap = notification => ImmutableMap({
|
const notificationToMap = notification => ImmutableMap({
|
||||||
@ -46,8 +61,10 @@ const normalizeNotification = (state, notification, usePendingItems) => {
|
|||||||
return state.update('pendingItems', list => list.unshift(notificationToMap(notification))).update('unread', unread => unread + 1);
|
return state.update('pendingItems', list => list.unshift(notificationToMap(notification))).update('unread', unread => unread + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!top) {
|
if (shouldCountUnreadNotifications(state)) {
|
||||||
state = state.update('unread', unread => unread + 1);
|
state = state.update('unread', unread => unread + 1);
|
||||||
|
} else {
|
||||||
|
state = state.set('lastReadId', notification.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return state.update('items', list => {
|
return state.update('items', list => {
|
||||||
@ -60,6 +77,7 @@ const normalizeNotification = (state, notification, usePendingItems) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const expandNormalizedNotifications = (state, notifications, next, isLoadingRecent, usePendingItems) => {
|
const expandNormalizedNotifications = (state, notifications, next, isLoadingRecent, usePendingItems) => {
|
||||||
|
const lastReadId = state.get('lastReadId');
|
||||||
let items = ImmutableList();
|
let items = ImmutableList();
|
||||||
|
|
||||||
notifications.forEach((n, i) => {
|
notifications.forEach((n, i) => {
|
||||||
@ -87,6 +105,15 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
|
|||||||
mutable.set('hasMore', false);
|
mutable.set('hasMore', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldCountUnreadNotifications(state)) {
|
||||||
|
mutable.update('unread', unread => unread + items.count(item => compareId(item.get('id'), lastReadId) > 0));
|
||||||
|
} else {
|
||||||
|
const mostRecent = items.find(item => item !== null);
|
||||||
|
if (mostRecent && compareId(lastReadId, mostRecent.get('id')) < 0) {
|
||||||
|
mutable.set('lastReadId', mostRecent.get('id'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mutable.set('isLoading', false);
|
mutable.set('isLoading', false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -96,21 +123,93 @@ const filterNotifications = (state, accountIds, type) => {
|
|||||||
return state.update('items', helper).update('pendingItems', helper);
|
return state.update('items', helper).update('pendingItems', helper);
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateTop = (state, top) => {
|
const clearUnread = (state) => {
|
||||||
if (top) {
|
|
||||||
state = state.set('unread', state.get('pendingItems').size);
|
state = state.set('unread', state.get('pendingItems').size);
|
||||||
|
const lastNotification = state.get('items').find(item => item !== null);
|
||||||
|
return state.set('lastReadId', lastNotification ? lastNotification.get('id') : '0');
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateTop = (state, top) => {
|
||||||
|
state = state.set('top', top);
|
||||||
|
|
||||||
|
if (!shouldCountUnreadNotifications(state)) {
|
||||||
|
state = clearUnread(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return state.set('top', top);
|
return state;
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteByStatus = (state, statusId) => {
|
const deleteByStatus = (state, statusId) => {
|
||||||
|
const lastReadId = state.get('lastReadId');
|
||||||
|
|
||||||
|
if (shouldCountUnreadNotifications(state)) {
|
||||||
|
const deletedUnread = state.get('items').filter(item => item !== null && item.get('status') === statusId && compareId(item.get('id'), lastReadId) > 0);
|
||||||
|
state = state.update('unread', unread => unread - deletedUnread.size);
|
||||||
|
}
|
||||||
|
|
||||||
const helper = list => list.filterNot(item => item !== null && item.get('status') === statusId);
|
const helper = list => list.filterNot(item => item !== null && item.get('status') === statusId);
|
||||||
|
const deletedUnread = state.get('pendingItems').filter(item => item !== null && item.get('status') === statusId && compareId(item.get('id'), lastReadId) > 0);
|
||||||
|
state = state.update('unread', unread => unread - deletedUnread.size);
|
||||||
return state.update('items', helper).update('pendingItems', helper);
|
return state.update('items', helper).update('pendingItems', helper);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateMounted = (state) => {
|
||||||
|
state = state.update('mounted', count => count + 1);
|
||||||
|
if (!shouldCountUnreadNotifications(state, state.get('mounted') === 1)) {
|
||||||
|
state = state.set('readMarkerId', state.get('lastReadId'));
|
||||||
|
state = clearUnread(state);
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateVisibility = (state, visibility) => {
|
||||||
|
state = state.set('isTabVisible', visibility);
|
||||||
|
if (!shouldCountUnreadNotifications(state)) {
|
||||||
|
state = state.set('readMarkerId', state.get('lastReadId'));
|
||||||
|
state = clearUnread(state);
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
};
|
||||||
|
|
||||||
|
const shouldCountUnreadNotifications = (state, ignoreScroll = false) => {
|
||||||
|
const isTabVisible = state.get('isTabVisible');
|
||||||
|
const isOnTop = state.get('top');
|
||||||
|
const isMounted = state.get('mounted') > 0;
|
||||||
|
const lastReadId = state.get('lastReadId');
|
||||||
|
const lastItem = state.get('items').findLast(item => item !== null);
|
||||||
|
const lastItemReached = !state.get('hasMore') || lastReadId === '0' || (lastItem && compareId(lastItem.get('id'), lastReadId) <= 0);
|
||||||
|
|
||||||
|
return !(isTabVisible && (ignoreScroll || isOnTop) && isMounted && lastItemReached);
|
||||||
|
};
|
||||||
|
|
||||||
|
const recountUnread = (state, last_read_id) => {
|
||||||
|
return state.withMutations(mutable => {
|
||||||
|
if (compareId(last_read_id, mutable.get('lastReadId')) > 0) {
|
||||||
|
mutable.set('lastReadId', last_read_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (compareId(last_read_id, mutable.get('readMarkerId')) > 0) {
|
||||||
|
mutable.set('readMarkerId', last_read_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.get('unread') > 0 || shouldCountUnreadNotifications(state)) {
|
||||||
|
mutable.set('unread', mutable.get('pendingItems').count(item => item !== null) + mutable.get('items').count(item => item && compareId(item.get('id'), last_read_id) > 0));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export default function notifications(state = initialState, action) {
|
export default function notifications(state = initialState, action) {
|
||||||
switch(action.type) {
|
switch(action.type) {
|
||||||
|
case MARKERS_FETCH_SUCCESS:
|
||||||
|
return action.markers.notifications ? recountUnread(state, action.markers.notifications.last_read_id) : state;
|
||||||
|
case NOTIFICATIONS_MOUNT:
|
||||||
|
return updateMounted(state);
|
||||||
|
case NOTIFICATIONS_UNMOUNT:
|
||||||
|
return state.update('mounted', count => count - 1);
|
||||||
|
case APP_FOCUS:
|
||||||
|
return updateVisibility(state, true);
|
||||||
|
case APP_UNFOCUS:
|
||||||
|
return updateVisibility(state, false);
|
||||||
case NOTIFICATIONS_LOAD_PENDING:
|
case NOTIFICATIONS_LOAD_PENDING:
|
||||||
return state.update('items', list => state.get('pendingItems').concat(list.take(40))).set('pendingItems', ImmutableList()).set('unread', 0);
|
return state.update('items', list => state.get('pendingItems').concat(list.take(40))).set('pendingItems', ImmutableList()).set('unread', 0);
|
||||||
case NOTIFICATIONS_EXPAND_REQUEST:
|
case NOTIFICATIONS_EXPAND_REQUEST:
|
||||||
@ -144,10 +243,13 @@ export default function notifications(state = initialState, action) {
|
|||||||
return action.timeline === 'home' ?
|
return action.timeline === 'home' ?
|
||||||
state.update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items) :
|
state.update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items) :
|
||||||
state;
|
state;
|
||||||
case NOTIFICATIONS_MOUNT:
|
case NOTIFICATIONS_MARK_AS_READ:
|
||||||
return state.set('mounted', true);
|
const lastNotification = state.get('items').find(item => item !== null);
|
||||||
case NOTIFICATIONS_UNMOUNT:
|
return lastNotification ? recountUnread(state, lastNotification.get('id')) : state;
|
||||||
return state.set('mounted', false);
|
case NOTIFICATIONS_SET_BROWSER_SUPPORT:
|
||||||
|
return state.set('browserSupport', action.value);
|
||||||
|
case NOTIFICATIONS_SET_BROWSER_PERMISSION:
|
||||||
|
return state.set('browserPermission', action.value);
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
22
app/javascript/mastodon/reducers/picture_in_picture.js
Normal file
22
app/javascript/mastodon/reducers/picture_in_picture.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { PICTURE_IN_PICTURE_DEPLOY, PICTURE_IN_PICTURE_REMOVE } from 'mastodon/actions/picture_in_picture';
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
statusId: null,
|
||||||
|
accountId: null,
|
||||||
|
type: null,
|
||||||
|
src: null,
|
||||||
|
muted: false,
|
||||||
|
volume: 0,
|
||||||
|
currentTime: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function pictureInPicture(state = initialState, action) {
|
||||||
|
switch(action.type) {
|
||||||
|
case PICTURE_IN_PICTURE_DEPLOY:
|
||||||
|
return { statusId: action.statusId, accountId: action.accountId, type: action.playerType, ...action.props };
|
||||||
|
case PICTURE_IN_PICTURE_REMOVE:
|
||||||
|
return { ...initialState };
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
@ -45,7 +45,7 @@ const initialState = ImmutableMap();
|
|||||||
export default function relationships(state = initialState, action) {
|
export default function relationships(state = initialState, action) {
|
||||||
switch(action.type) {
|
switch(action.type) {
|
||||||
case ACCOUNT_FOLLOW_REQUEST:
|
case ACCOUNT_FOLLOW_REQUEST:
|
||||||
return state.setIn([action.id, action.locked ? 'requested' : 'following'], true);
|
return state.getIn([action.id, 'following']) ? state : state.setIn([action.id, action.locked ? 'requested' : 'following'], true);
|
||||||
case ACCOUNT_FOLLOW_FAIL:
|
case ACCOUNT_FOLLOW_FAIL:
|
||||||
return state.setIn([action.id, action.locked ? 'requested' : 'following'], false);
|
return state.setIn([action.id, action.locked ? 'requested' : 'following'], false);
|
||||||
case ACCOUNT_UNFOLLOW_REQUEST:
|
case ACCOUNT_UNFOLLOW_REQUEST:
|
||||||
|
@ -29,12 +29,13 @@ const initialState = ImmutableMap({
|
|||||||
|
|
||||||
notifications: ImmutableMap({
|
notifications: ImmutableMap({
|
||||||
alerts: ImmutableMap({
|
alerts: ImmutableMap({
|
||||||
follow: true,
|
follow: false,
|
||||||
follow_request: false,
|
follow_request: false,
|
||||||
favourite: true,
|
favourite: false,
|
||||||
reblog: true,
|
reblog: false,
|
||||||
mention: true,
|
mention: false,
|
||||||
poll: true,
|
poll: false,
|
||||||
|
status: false,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
quickFilter: ImmutableMap({
|
quickFilter: ImmutableMap({
|
||||||
@ -50,6 +51,7 @@ const initialState = ImmutableMap({
|
|||||||
reblog: true,
|
reblog: true,
|
||||||
mention: true,
|
mention: true,
|
||||||
poll: true,
|
poll: true,
|
||||||
|
status: true,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
sounds: ImmutableMap({
|
sounds: ImmutableMap({
|
||||||
@ -59,6 +61,7 @@ const initialState = ImmutableMap({
|
|||||||
reblog: true,
|
reblog: true,
|
||||||
mention: true,
|
mention: true,
|
||||||
poll: true,
|
poll: true,
|
||||||
|
status: true,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -53,14 +53,20 @@ import {
|
|||||||
} from 'mastodon/actions/directory';
|
} from 'mastodon/actions/directory';
|
||||||
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
import { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||||
|
|
||||||
|
const initialListState = ImmutableMap({
|
||||||
|
next: null,
|
||||||
|
isLoading: false,
|
||||||
|
items: ImmutableList(),
|
||||||
|
});
|
||||||
|
|
||||||
const initialState = ImmutableMap({
|
const initialState = ImmutableMap({
|
||||||
followers: ImmutableMap(),
|
followers: initialListState,
|
||||||
following: ImmutableMap(),
|
following: initialListState,
|
||||||
reblogged_by: ImmutableMap(),
|
reblogged_by: initialListState,
|
||||||
favourited_by: ImmutableMap(),
|
favourited_by: initialListState,
|
||||||
follow_requests: ImmutableMap(),
|
follow_requests: initialListState,
|
||||||
blocks: ImmutableMap(),
|
blocks: initialListState,
|
||||||
mutes: ImmutableMap(),
|
mutes: initialListState,
|
||||||
});
|
});
|
||||||
|
|
||||||
const normalizeList = (state, path, accounts, next) => {
|
const normalizeList = (state, path, accounts, next) => {
|
||||||
|
10
app/javascript/mastodon/utils/config.js
Normal file
10
app/javascript/mastodon/utils/config.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import ready from '../ready';
|
||||||
|
|
||||||
|
export let assetHost = '';
|
||||||
|
|
||||||
|
ready(() => {
|
||||||
|
const cdnHost = document.querySelector('meta[name=cdn-host]');
|
||||||
|
if (cdnHost) {
|
||||||
|
assetHost = cdnHost.content || '';
|
||||||
|
}
|
||||||
|
});
|
29
app/javascript/mastodon/utils/notifications.js
Normal file
29
app/javascript/mastodon/utils/notifications.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// Handles browser quirks, based on
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API
|
||||||
|
|
||||||
|
const checkNotificationPromise = () => {
|
||||||
|
try {
|
||||||
|
Notification.requestPermission().then();
|
||||||
|
} catch(e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePermission = (permission, callback) => {
|
||||||
|
// Whatever the user answers, we make sure Chrome stores the information
|
||||||
|
if(!('permission' in Notification)) {
|
||||||
|
Notification.permission = permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(Notification.permission);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const requestNotificationPermission = (callback) => {
|
||||||
|
if (checkNotificationPromise()) {
|
||||||
|
Notification.requestPermission().then((permission) => handlePermission(permission, callback));
|
||||||
|
} else {
|
||||||
|
Notification.requestPermission((permission) => handlePermission(permission, callback));
|
||||||
|
}
|
||||||
|
};
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import loadPolyfills from '../mastodon/load_polyfills';
|
import loadPolyfills from '../mastodon/load_polyfills';
|
||||||
import { start } from '../mastodon/common';
|
import { start } from '../mastodon/common';
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import { delegate } from '@rails/ujs';
|
import { delegate } from '@rails/ujs';
|
||||||
import ready from '../mastodon/ready';
|
import ready from '../mastodon/ready';
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import loadPolyfills from '../mastodon/load_polyfills';
|
import loadPolyfills from '../mastodon/load_polyfills';
|
||||||
import { start } from '../mastodon/common';
|
import { start } from '../mastodon/common';
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import ready from '../mastodon/ready';
|
import ready from '../mastodon/ready';
|
||||||
|
|
||||||
ready(() => {
|
ready(() => {
|
||||||
|
21
app/javascript/packs/public-path.js
Normal file
21
app/javascript/packs/public-path.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// Dynamically set webpack's loading path depending on a meta header, in order
|
||||||
|
// to share the same assets regardless of instance configuration.
|
||||||
|
// See https://webpack.js.org/guides/public-path/#on-the-fly
|
||||||
|
|
||||||
|
function removeOuterSlashes(string) {
|
||||||
|
return string.replace(/^\/*/, '').replace(/\/*$/, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPublicPath(host = '', path = '') {
|
||||||
|
let formattedHost = removeOuterSlashes(host);
|
||||||
|
if (formattedHost && !/^http/i.test(formattedHost)) {
|
||||||
|
formattedHost = `//${formattedHost}`;
|
||||||
|
}
|
||||||
|
const formattedPath = removeOuterSlashes(path);
|
||||||
|
return `${formattedHost}/${formattedPath}/`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cdnHost = document.querySelector('meta[name=cdn-host]');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase, no-undef, no-unused-vars
|
||||||
|
__webpack_public_path__ = formatPublicPath(cdnHost ? cdnHost.content : '', process.env.PUBLIC_OUTPUT_PATH);
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import escapeTextContentForBrowser from 'escape-html';
|
import escapeTextContentForBrowser from 'escape-html';
|
||||||
import loadPolyfills from '../mastodon/load_polyfills';
|
import loadPolyfills from '../mastodon/load_polyfills';
|
||||||
import ready from '../mastodon/ready';
|
import ready from '../mastodon/ready';
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import './public-path';
|
||||||
import loadPolyfills from '../mastodon/load_polyfills';
|
import loadPolyfills from '../mastodon/load_polyfills';
|
||||||
import { start } from '../mastodon/common';
|
import { start } from '../mastodon/common';
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user