diff --git a/Gemfile b/Gemfile index 2e77fb42a69025..1321a1c01a4b30 100644 --- a/Gemfile +++ b/Gemfile @@ -79,7 +79,7 @@ gem 'ruby-progressbar', '~> 1.11' gem 'sanitize', '~> 6.0' gem 'scenic', '~> 1.6' gem 'sidekiq', '~> 6.4' -gem 'sidekiq-scheduler', '~> 4.0' +gem 'sidekiq-scheduler', '~> 5.0' gem 'sidekiq-unique-jobs', '~> 7.1' gem 'sidekiq-bulk', '~> 0.2.0' gem 'simple-navigation', '~> 4.3' @@ -97,6 +97,7 @@ gem 'webauthn', '~> 3.0.0.alpha1' gem 'json-ld' gem 'json-ld-preloaded', '~> 3.2' gem 'rdf-normalize', '~> 0.5' +gem 'ruby-bbcode' group :development, :test do gem 'fabrication', '~> 2.28' diff --git a/Gemfile.lock b/Gemfile.lock index e12fdc237dc4a4..e0f02b4377d0c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,7 +263,7 @@ GEM fog-json (>= 1.0) ipaddress (>= 0.8) formatador (0.2.5) - fugit (1.5.3) + fugit (1.8.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) fuubar (2.5.1) @@ -583,12 +583,14 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) + ruby-bbcode (2.0.2) + activesupport (>= 3.2.3) ruby-progressbar (1.11.0) ruby-saml (1.13.0) nokogiri (>= 1.10.5) rexml ruby2_keywords (0.0.5) - rufus-scheduler (3.8.1) + rufus-scheduler (3.9.0) fugit (~> 1.1, >= 1.1.6) safety_net_attestation (0.4.0) jwt (~> 2.0) @@ -606,10 +608,9 @@ GEM redis (>= 4.2.0) sidekiq-bulk (0.2.0) sidekiq - sidekiq-scheduler (4.0.0) - redis (>= 4.2.0) + sidekiq-scheduler (5.0.3) rufus-scheduler (~> 3.2) - sidekiq (>= 4) + sidekiq (>= 6, < 8) tilt (>= 1.4.0) sidekiq-unique-jobs (7.1.22) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) @@ -653,7 +654,7 @@ GEM terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.2.1) - tilt (2.0.10) + tilt (2.2.0) tpm-key_attestation (0.9.0) bindata (~> 2.4) openssl-signature_algorithm (~> 0.4.0) @@ -670,7 +671,7 @@ GEM twitter-text (3.1.0) idn-ruby unf (~> 0.1.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2022.1) tzinfo (>= 1.0.0) @@ -822,12 +823,13 @@ DEPENDENCIES rspec_junit_formatter (~> 0.5) rubocop (~> 1.29) rubocop-rails (~> 2.14) + ruby-bbcode ruby-progressbar (~> 1.11) sanitize (~> 6.0) scenic (~> 1.6) sidekiq (~> 6.4) sidekiq-bulk (~> 0.2.0) - sidekiq-scheduler (~> 4.0) + sidekiq-scheduler (~> 5.0) sidekiq-unique-jobs (~> 7.1) simple-navigation (~> 4.3) simple_form (~> 5.1) @@ -846,3 +848,9 @@ DEPENDENCIES webpacker (~> 5.4) webpush (~> 0.3) xorcist (~> 1.1) + +RUBY VERSION + ruby 3.0.3p157 + +BUNDLED WITH + 2.2.32 diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 9270117dad5842..e25e5eca1edd0d 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -48,6 +48,7 @@ def create scheduled_at: status_params[:scheduled_at], application: doorkeeper_token.application, poll: status_params[:poll], + public_in_local: status_params[:public_in_local], idempotency: request.headers['Idempotency-Key'], with_rate_limit: true ) @@ -107,6 +108,7 @@ def status_params :in_reply_to_id, :sensitive, :spoiler_text, + :public_in_local, :visibility, :language, :scheduled_at, diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3d2f8280b15f21..8151ff87486c84 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,6 +14,20 @@ class ApplicationController < ActionController::Base helper_method :current_account helper_method :current_session helper_method :current_theme + helper_method :current_emoji_size_simple + helper_method :current_emoji_size_detailed + helper_method :current_emoji_size_name + helper_method :current_column_size + helper_method :current_bbcode_spin + helper_method :current_bbcode_flip + helper_method :current_bbcode_size + helper_method :current_bbcode_color + helper_method :current_bbcode_pulse + helper_method :current_bbcode_large + helper_method :current_bbcode_i + helper_method :current_bbcode_b + helper_method :current_bbcode_s + helper_method :current_bbcode_u helper_method :single_user_mode? helper_method :use_seamless_external_login? helper_method :whitelist_mode? @@ -138,6 +152,62 @@ def current_theme return Setting.theme unless Themes.instance.names.include? current_user&.setting_theme current_user.setting_theme end + + def current_emoji_size_simple + return current_user&.setting_emoji_size_simple + end + + def current_emoji_size_detailed + return current_user&.setting_emoji_size_detailed + end + + def current_emoji_size_name + return current_user&.setting_emoji_size_name + end + + def current_column_size + return current_user&.setting_column_size + end + + def current_bbcode_spin + return current_user&.setting_bbcode_spin + end + + def current_bbcode_pulse + return current_user&.setting_bbcode_pulse + end + + def current_bbcode_flip + return current_user&.setting_bbcode_flip + end + + def current_bbcode_color + return current_user&.setting_bbcode_color + end + + def current_bbcode_large + return current_user&.setting_bbcode_large + end + + def current_bbcode_size + return current_user&.setting_bbcode_size + end + + def current_bbcode_b + return current_user&.setting_bbcode_b + end + + def current_bbcode_i + return current_user&.setting_bbcode_i + end + + def current_bbcode_u + return current_user&.setting_bbcode_u + end + + def current_bbcode_s + return current_user&.setting_bbcode_s + end def respond_with_error(code) respond_to do |format| diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 1c3adbd786bd91..5424b17f34e977 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -22,6 +22,12 @@ def new super(&:build_invite_request) end + def create + super do |resource| + UserSettingsDecorator.new(resource).update(params.require(:user).permit(:setting_advanced_layout).to_h) unless resource.id.nil? + end + end + def destroy not_found end diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index bfe651bc667554..9a7a8b779ebf9f 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -55,6 +55,21 @@ def user_settings_params :setting_trends, :setting_crop_images, :setting_always_send_emails, + :setting_emoji_size_simple, + :setting_emoji_size_detailed, + :setting_emoji_size_name, + :setting_column_size, + :setting_bbcode_spin, + :setting_bbcode_pulse, + :setting_bbcode_flip, + :setting_bbcode_large, + :setting_bbcode_size, + :setting_bbcode_color, + :setting_bbcode_b, + :setting_bbcode_i, + :setting_bbcode_u, + :setting_bbcode_s, + :setting_show_cw_box, notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account trending_tag appeal), interactions: %i(must_be_follower must_be_following must_be_following_dm) ) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bba7070d0d6def..701da84d7a5e6e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -209,7 +209,7 @@ def render_initial_state text: [params[:title], params[:text], params[:url]].compact.join(' '), } - permit_visibilities = %w(public unlisted private direct) + permit_visibilities = %w(public local unlisted private direct) default_privacy = current_account&.user&.setting_default_privacy permit_visibilities.shift(permit_visibilities.index(default_privacy) + 1) if default_privacy.present? state_params[:visibility] = params[:visibility] if permit_visibilities.include? params[:visibility] diff --git a/app/javascript/fonts/VCR_OSD_MONO.ttf b/app/javascript/fonts/VCR_OSD_MONO.ttf new file mode 100644 index 00000000000000..dcca687a434d5c Binary files /dev/null and b/app/javascript/fonts/VCR_OSD_MONO.ttf differ diff --git a/app/javascript/fonts/galyon/Galyon-Bold.otf b/app/javascript/fonts/galyon/Galyon-Bold.otf new file mode 100644 index 00000000000000..a4a6be4489bed7 Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Bold.otf differ diff --git a/app/javascript/fonts/galyon/Galyon-Bold.woff b/app/javascript/fonts/galyon/Galyon-Bold.woff new file mode 100644 index 00000000000000..fde62a5e355322 Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Bold.woff differ diff --git a/app/javascript/fonts/galyon/Galyon-Italic.otf b/app/javascript/fonts/galyon/Galyon-Italic.otf new file mode 100644 index 00000000000000..551a667e2a684e Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Italic.otf differ diff --git a/app/javascript/fonts/galyon/Galyon-Italic.woff b/app/javascript/fonts/galyon/Galyon-Italic.woff new file mode 100644 index 00000000000000..94377d73618e64 Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Italic.woff differ diff --git a/app/javascript/fonts/galyon/Galyon-Regular.otf b/app/javascript/fonts/galyon/Galyon-Regular.otf new file mode 100644 index 00000000000000..30cca18ee168db Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Regular.otf differ diff --git a/app/javascript/fonts/galyon/Galyon-Regular.woff b/app/javascript/fonts/galyon/Galyon-Regular.woff new file mode 100644 index 00000000000000..2544b3adb637d6 Binary files /dev/null and b/app/javascript/fonts/galyon/Galyon-Regular.woff differ diff --git a/app/javascript/fonts/opensans/LICENSE.txt b/app/javascript/fonts/opensans/LICENSE.txt new file mode 100644 index 00000000000000..d645695673349e --- /dev/null +++ b/app/javascript/fonts/opensans/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/app/javascript/fonts/opensans/OpenSans-Bold.ttf b/app/javascript/fonts/opensans/OpenSans-Bold.ttf new file mode 100644 index 00000000000000..efdd5e84a0397e Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Bold.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-Bold.woff2 b/app/javascript/fonts/opensans/OpenSans-Bold.woff2 new file mode 100644 index 00000000000000..e98487337fd7a8 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Bold.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-BoldItalic.ttf b/app/javascript/fonts/opensans/OpenSans-BoldItalic.ttf new file mode 100644 index 00000000000000..9bf9b4e97b6576 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-BoldItalic.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-BoldItalic.woff2 b/app/javascript/fonts/opensans/OpenSans-BoldItalic.woff2 new file mode 100644 index 00000000000000..68666ea6f66034 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-BoldItalic.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-ExtraBold.ttf b/app/javascript/fonts/opensans/OpenSans-ExtraBold.ttf new file mode 100644 index 00000000000000..67fcf0fb2af0c0 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-ExtraBold.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-ExtraBold.woff2 b/app/javascript/fonts/opensans/OpenSans-ExtraBold.woff2 new file mode 100644 index 00000000000000..abdc7b7cab5786 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-ExtraBold.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.ttf b/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 00000000000000..086722809c74d5 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.woff2 b/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.woff2 new file mode 100644 index 00000000000000..6e83375232655e Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-ExtraBoldItalic.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-Italic.ttf b/app/javascript/fonts/opensans/OpenSans-Italic.ttf new file mode 100644 index 00000000000000..117856707b9b86 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Italic.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-Italic.woff2 b/app/javascript/fonts/opensans/OpenSans-Italic.woff2 new file mode 100644 index 00000000000000..9398fd5da0866b Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Italic.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-Light.ttf b/app/javascript/fonts/opensans/OpenSans-Light.ttf new file mode 100644 index 00000000000000..6580d3a169e895 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Light.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-Light.woff2 b/app/javascript/fonts/opensans/OpenSans-Light.woff2 new file mode 100644 index 00000000000000..8496eb0f918cad Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Light.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-LightItalic.ttf b/app/javascript/fonts/opensans/OpenSans-LightItalic.ttf new file mode 100644 index 00000000000000..1e0c3319810ad7 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-LightItalic.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-LightItalic.woff2 b/app/javascript/fonts/opensans/OpenSans-LightItalic.woff2 new file mode 100644 index 00000000000000..3ccefa9cbdd18b Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-LightItalic.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-Regular.ttf b/app/javascript/fonts/opensans/OpenSans-Regular.ttf new file mode 100644 index 00000000000000..29bfd35a2bfdd9 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Regular.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-Regular.woff2 b/app/javascript/fonts/opensans/OpenSans-Regular.woff2 new file mode 100644 index 00000000000000..a8b53198935fc9 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-Regular.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-SemiBold.ttf b/app/javascript/fonts/opensans/OpenSans-SemiBold.ttf new file mode 100644 index 00000000000000..54e7059cf36359 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-SemiBold.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-SemiBold.woff2 b/app/javascript/fonts/opensans/OpenSans-SemiBold.woff2 new file mode 100644 index 00000000000000..90d827308feda3 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-SemiBold.woff2 differ diff --git a/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.ttf b/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 00000000000000..aebcf1421226d0 Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.ttf differ diff --git a/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.woff2 b/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.woff2 new file mode 100644 index 00000000000000..ca7c2011a4fc2d Binary files /dev/null and b/app/javascript/fonts/opensans/OpenSans-SemiBoldItalic.woff2 differ diff --git a/app/javascript/fonts/premillenium/MSSansSerif.ttf b/app/javascript/fonts/premillenium/MSSansSerif.ttf new file mode 100644 index 00000000000000..3afd76ff2db50d Binary files /dev/null and b/app/javascript/fonts/premillenium/MSSansSerif.ttf differ diff --git a/app/javascript/fonts/pressstart2p/PressStart2P-Regular.ttf b/app/javascript/fonts/pressstart2p/PressStart2P-Regular.ttf new file mode 100644 index 00000000000000..39adf42efa5979 Binary files /dev/null and b/app/javascript/fonts/pressstart2p/PressStart2P-Regular.ttf differ diff --git a/app/javascript/images/background/fundo3invertido.png b/app/javascript/images/background/fundo3invertido.png new file mode 100644 index 00000000000000..6c429ae6fa21f0 Binary files /dev/null and b/app/javascript/images/background/fundo3invertido.png differ diff --git a/app/javascript/images/background/fundo3plus.png b/app/javascript/images/background/fundo3plus.png new file mode 100644 index 00000000000000..18a6c6b759772d Binary files /dev/null and b/app/javascript/images/background/fundo3plus.png differ diff --git a/app/javascript/images/background/fundo_rosa_bolinhas.png b/app/javascript/images/background/fundo_rosa_bolinhas.png new file mode 100644 index 00000000000000..ef7e07a7d1c8e5 Binary files /dev/null and b/app/javascript/images/background/fundo_rosa_bolinhas.png differ diff --git a/app/javascript/images/background/fundo_rosa_brilhos.png b/app/javascript/images/background/fundo_rosa_brilhos.png new file mode 100644 index 00000000000000..c4510ddee873e6 Binary files /dev/null and b/app/javascript/images/background/fundo_rosa_brilhos.png differ diff --git a/app/javascript/images/clippy_frame.png b/app/javascript/images/clippy_frame.png new file mode 100644 index 00000000000000..7f2cd6a59dd4ed Binary files /dev/null and b/app/javascript/images/clippy_frame.png differ diff --git a/app/javascript/images/clippy_wave.gif b/app/javascript/images/clippy_wave.gif new file mode 100644 index 00000000000000..4d2e38a3df4aa7 Binary files /dev/null and b/app/javascript/images/clippy_wave.gif differ diff --git a/app/javascript/images/colorwave_mascot.png b/app/javascript/images/colorwave_mascot.png new file mode 100644 index 00000000000000..59f2eb2b545863 Binary files /dev/null and b/app/javascript/images/colorwave_mascot.png differ diff --git a/app/javascript/images/envelope_closed-0.png b/app/javascript/images/envelope_closed-0.png new file mode 100644 index 00000000000000..04e0248f32cf34 Binary files /dev/null and b/app/javascript/images/envelope_closed-0.png differ diff --git a/app/javascript/images/icon_about.png b/app/javascript/images/icon_about.png new file mode 100644 index 00000000000000..08b76dcd9ddbe1 Binary files /dev/null and b/app/javascript/images/icon_about.png differ diff --git a/app/javascript/images/icon_blocks.png b/app/javascript/images/icon_blocks.png new file mode 100644 index 00000000000000..8b1490875fc271 Binary files /dev/null and b/app/javascript/images/icon_blocks.png differ diff --git a/app/javascript/images/icon_follow_requests.png b/app/javascript/images/icon_follow_requests.png new file mode 100644 index 00000000000000..4123e2a6909a3d Binary files /dev/null and b/app/javascript/images/icon_follow_requests.png differ diff --git a/app/javascript/images/icon_home.png b/app/javascript/images/icon_home.png new file mode 100644 index 00000000000000..66ce779c0d7e4a Binary files /dev/null and b/app/javascript/images/icon_home.png differ diff --git a/app/javascript/images/icon_keyboard_shortcuts.png b/app/javascript/images/icon_keyboard_shortcuts.png new file mode 100644 index 00000000000000..d66f3939e104c2 Binary files /dev/null and b/app/javascript/images/icon_keyboard_shortcuts.png differ diff --git a/app/javascript/images/icon_likes.png b/app/javascript/images/icon_likes.png new file mode 100644 index 00000000000000..17d7a9c59bd180 Binary files /dev/null and b/app/javascript/images/icon_likes.png differ diff --git a/app/javascript/images/icon_lists.png b/app/javascript/images/icon_lists.png new file mode 100644 index 00000000000000..3828946e81b86f Binary files /dev/null and b/app/javascript/images/icon_lists.png differ diff --git a/app/javascript/images/icon_local.png b/app/javascript/images/icon_local.png new file mode 100644 index 00000000000000..5f82df395659a4 Binary files /dev/null and b/app/javascript/images/icon_local.png differ diff --git a/app/javascript/images/icon_logout.png b/app/javascript/images/icon_logout.png new file mode 100644 index 00000000000000..7ff806f58623f2 Binary files /dev/null and b/app/javascript/images/icon_logout.png differ diff --git a/app/javascript/images/icon_mutes.png b/app/javascript/images/icon_mutes.png new file mode 100644 index 00000000000000..c2225e966eb718 Binary files /dev/null and b/app/javascript/images/icon_mutes.png differ diff --git a/app/javascript/images/icon_pin.png b/app/javascript/images/icon_pin.png new file mode 100644 index 00000000000000..2329d8c54d8b17 Binary files /dev/null and b/app/javascript/images/icon_pin.png differ diff --git a/app/javascript/images/icon_public.png b/app/javascript/images/icon_public.png new file mode 100644 index 00000000000000..3c09460dba5428 Binary files /dev/null and b/app/javascript/images/icon_public.png differ diff --git a/app/javascript/images/icon_settings.png b/app/javascript/images/icon_settings.png new file mode 100644 index 00000000000000..07f5c45192a959 Binary files /dev/null and b/app/javascript/images/icon_settings.png differ diff --git a/app/javascript/images/palmeiras.png b/app/javascript/images/palmeiras.png new file mode 100644 index 00000000000000..fcf3b626c6e8a8 Binary files /dev/null and b/app/javascript/images/palmeiras.png differ diff --git a/app/javascript/images/screenshot.jpg b/app/javascript/images/screenshot.jpg new file mode 100644 index 00000000000000..45b270fbb0a662 Binary files /dev/null and b/app/javascript/images/screenshot.jpg differ diff --git a/app/javascript/images/start.png b/app/javascript/images/start.png new file mode 100644 index 00000000000000..7843455b60d86e Binary files /dev/null and b/app/javascript/images/start.png differ diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index bd4c1d0024fd93..0b7b3a5b740c2e 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -155,6 +155,13 @@ export function submitCompose(routerHistory) { if ((!status || !status.length) && media.size === 0) { return; } + + var visibility = getState().getIn(['compose', 'privacy']); + var publicInLocal = false; + if (visibility === 'local') { + visibility = 'unlisted'; + publicInLocal = true; + } dispatch(submitComposeRequest()); @@ -168,6 +175,7 @@ export function submitCompose(routerHistory) { sensitive: getState().getIn(['compose', 'sensitive']), spoiler_text: getState().getIn(['compose', 'spoiler']) ? getState().getIn(['compose', 'spoiler_text'], '') : '', visibility: getState().getIn(['compose', 'privacy']), + public_in_local: publicInLocal, poll: getState().getIn(['compose', 'poll'], null), language: getState().getIn(['compose', 'language']), }, @@ -200,6 +208,8 @@ export function submitCompose(routerHistory) { insertIfOnline('community'); insertIfOnline('public'); insertIfOnline(`account:${response.data.account.id}`); + } else if (response.data.in_reply_to_id === null && response.data.visibility === 'unlisted' && response.data.public_in_local === true) { + insertIfOnline('community'); } }).catch(function (error) { dispatch(submitComposeFail(error)); diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 2e7ce2e608f928..df722df66feb13 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -236,6 +236,7 @@ class MediaGallery extends React.PureComponent { visible: PropTypes.bool, autoplay: PropTypes.bool, onToggleVisibility: PropTypes.func, + parentHidden: PropTypes.bool, }; static defaultProps = { @@ -271,6 +272,12 @@ class MediaGallery extends React.PureComponent { trailing: true, }); + componentDidUpdate () { + if (!this.props.parentHidden && this.elementRef && this.elementRef.offsetWidth && this.elementRef.offsetWidth !== this.state.containerWidth) { + this._setDimensions() + } + } + handleOpen = () => { if (this.props.onToggleVisibility) { this.props.onToggleVisibility(); diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 76609322667a81..393fc641666949 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -57,6 +57,7 @@ const messages = defineMessages({ unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' }, private_short: { id: 'privacy.private.short', defaultMessage: 'Followers-only' }, direct_short: { id: 'privacy.direct.short', defaultMessage: 'Mentioned people only' }, + local_short: { id: 'privacy.local.short', defaultMessage: 'Local' }, edited: { id: 'status.edited', defaultMessage: 'Edited {date}' }, }); @@ -298,6 +299,7 @@ class Status extends ImmutablePureComponent { let statusAvatar, prepend, rebloggedByText; const { intl, hidden, featured, otherAccounts, unread, showThread, scrollKey, pictureInPicture } = this.props; + let mediaIcon = null; let { status, account, ...other } = this.props; @@ -368,6 +370,10 @@ class Status extends ImmutablePureComponent { status = status.get('reblog'); } + if (status.get('poll')) { + mediaIcon = 'tasks'; + } + if (pictureInPicture.get('inUse')) { media = ; } else if (status.get('media_attachments').size > 0) { @@ -421,10 +427,12 @@ class Status extends ImmutablePureComponent { deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined} visible={this.state.showMedia} onToggleVisibility={this.handleToggleMediaVisibility} + parentHidden={status.get('hidden')} /> )} ); + mediaIcon = 'video-camera'; } else { media = ( @@ -438,10 +446,12 @@ class Status extends ImmutablePureComponent { defaultWidth={this.props.cachedMediaWidth} visible={this.state.showMedia} onToggleVisibility={this.handleToggleMediaVisibility} + parentHidden={status.get('hidden')} /> )} ); + mediaIcon = 'picture-o'; } } else if (status.get('spoiler_text').length === 0 && status.get('card')) { media = ( @@ -469,9 +479,10 @@ class Status extends ImmutablePureComponent { 'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) }, 'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) }, 'direct': { icon: 'at', text: intl.formatMessage(messages.direct_short) }, + 'local': { icon: 'users', text: intl.formatMessage(messages.local_short) }, }; - const visibilityIcon = visibilityIconInfo[status.get('visibility')]; + const visibilityIcon = status.get('public_in_local') ? visibilityIconInfo.local : visibilityIconInfo[status.get('visibility')]; return ( @@ -496,9 +507,11 @@ class Status extends ImmutablePureComponent { - + + + {media} - {media} + diff --git a/app/javascript/mastodon/components/status_action_bar.js b/app/javascript/mastodon/components/status_action_bar.js index 1d8fe23dae8685..04d232be11bf4f 100644 --- a/app/javascript/mastodon/components/status_action_bar.js +++ b/app/javascript/mastodon/components/status_action_bar.js @@ -261,7 +261,7 @@ class StatusActionBar extends ImmutablePureComponent { } if (writtenByMe) { - // menu.push({ text: intl.formatMessage(messages.edit), action: this.handleEditClick }); + menu.push({ text: intl.formatMessage(messages.edit), action: this.handleEditClick }); menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick }); } else { diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index d01365afbfe659..4794d6245a1f71 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -24,6 +24,8 @@ export default class StatusContent extends React.PureComponent { onClick: PropTypes.func, collapsable: PropTypes.bool, onCollapsedToggle: PropTypes.func, + mediaIcon: PropTypes.string, + children: PropTypes.element, }; state = { @@ -168,7 +170,7 @@ export default class StatusContent extends React.PureComponent { } render () { - const { status } = this.props; + const { status, children, mediaIcon } = this.props; const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; const renderReadMore = this.props.onClick && status.get('collapsed'); @@ -203,7 +205,7 @@ export default class StatusContent extends React.PureComponent { )).reduce((aggregate, item) => [...aggregate, item, ' '], []); - const toggleText = hidden ? : ; + const toggleText = hidden ? [, mediaIcon ?