diff options
Diffstat (limited to 'app')
21 files changed, 58 insertions, 61 deletions
diff --git a/app/javascript/flavours/glitch/styles/_mixins.scss b/app/javascript/flavours/glitch/styles/_mixins.scss index 088b41e76..c92bc8608 100644 --- a/app/javascript/flavours/glitch/styles/_mixins.scss +++ b/app/javascript/flavours/glitch/styles/_mixins.scss @@ -55,7 +55,7 @@ outline: 0; box-sizing: border-box; width: 100%; - border: none; + border: 0; box-shadow: none; font-family: inherit; background: $ui-base-color; diff --git a/app/javascript/flavours/glitch/styles/accessibility.scss b/app/javascript/flavours/glitch/styles/accessibility.scss index 1a2de2f06..cb27497a4 100644 --- a/app/javascript/flavours/glitch/styles/accessibility.scss +++ b/app/javascript/flavours/glitch/styles/accessibility.scss @@ -15,21 +15,21 @@ $emojis-requiring-inversion: 'back' 'copyright' 'curly_loop' 'currency_exchange' .hicolor-privacy-icons { .status__visibility-icon.fa-globe, .composer--options--dropdown--content--item .fa-globe { - color: #1976D2; + color: #1976d2; } .status__visibility-icon.fa-unlock, .composer--options--dropdown--content--item .fa-unlock { - color: #388E3C; + color: #388e3c; } .status__visibility-icon.fa-lock, .composer--options--dropdown--content--item .fa-lock { - color: #FFA000; + color: #ffa000; } .status__visibility-icon.fa-envelope, .composer--options--dropdown--content--item .fa-envelope { - color: #D32F2F; + color: #d32f2f; } } diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 3cf5ee970..4801a4644 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -267,7 +267,7 @@ $content-width: 840px; text-transform: none; padding-bottom: 0; margin-bottom: 0; - border-bottom: none; + border-bottom: 0; } & > p { diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss index c0bbe5633..6dcfbcb02 100644 --- a/app/javascript/flavours/glitch/styles/components/accounts.scss +++ b/app/javascript/flavours/glitch/styles/components/accounts.scss @@ -14,7 +14,7 @@ } &.small { - border: none; + border: 0; padding: 0; & > .account__avatar-wrapper { margin: 0 8px 0 0 } @@ -278,7 +278,7 @@ } .account-gallery__item { - border: none; + border: 0; box-sizing: border-box; display: block; position: relative; diff --git a/app/javascript/flavours/glitch/styles/components/columns.scss b/app/javascript/flavours/glitch/styles/components/columns.scss index 2d080d3b9..90aa5859d 100644 --- a/app/javascript/flavours/glitch/styles/components/columns.scss +++ b/app/javascript/flavours/glitch/styles/components/columns.scss @@ -264,7 +264,7 @@ & > button { margin: 0; - border: none; + border: 0; padding: 15px; color: inherit; background: transparent; diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index 460f75c1f..fd62bb651 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -44,7 +44,7 @@ display: block; box-sizing: border-box; margin: 0; - border: none; + border: 0; border-radius: 4px; padding: 10px; width: 100%; @@ -81,7 +81,9 @@ &:active, &:focus, - &:hover { text-decoration: none } + &:hover { + text-decoration: none; + } } } @@ -256,7 +258,7 @@ display: block; box-sizing: border-box; margin: 0; - border: none; + border: 0; border-radius: 4px 4px 0 0; padding: 10px 32px 0 10px; width: 100%; @@ -277,9 +279,17 @@ all: unset; } - &:disabled { background: $ui-secondary-color } - &:focus { outline: 0 } - @include single-column('screen and (max-width: 630px)') { font-size: 16px } + &:disabled { + background: $ui-secondary-color; + } + + &:focus { + outline: 0; + } + + @include single-column('screen and (max-width: 630px)') { + font-size: 16px; + } @include limited-single-column('screen and (max-width: 600px)') { height: 100px !important; // prevent auto-resize textarea diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index 570813831..edc16e250 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -15,10 +15,16 @@ padding-right: 10px; } - @include single-column('screen and (max-width: 630px)') { flex: auto } + @include single-column('screen and (max-width: 630px)') { + flex: auto; + } @include limited-single-column('screen and (max-width: 630px)') { - &, &:first-child, &:last-child { padding: 0 } + &, + &:first-child, + &:last-child { + padding: 0; + } } .wide & { @@ -234,7 +240,7 @@ display: block; width: 100%; height: 100%; - border: none; + border: 0; cursor: inherit; } diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index 40206c696..aada9a928 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -1038,7 +1038,7 @@ .setting-text { color: $darker-text-color; background: transparent; - border: none; + border: 0; border-bottom: 2px solid $ui-primary-color; box-sizing: border-box; display: block; diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index f504fa91e..6cbcb05bd 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -82,7 +82,7 @@ } .media-gallery__item { - border: none; + border: 0; box-sizing: border-box; display: block; float: left; diff --git a/app/javascript/flavours/glitch/styles/components/modal.scss b/app/javascript/flavours/glitch/styles/components/modal.scss index 0bda305a8..f5acd814e 100644 --- a/app/javascript/flavours/glitch/styles/components/modal.scss +++ b/app/javascript/flavours/glitch/styles/components/modal.scss @@ -876,7 +876,7 @@ box-sizing: border-box; display: block; width: 100%; - border: none; + border: 0; padding: 10px; font-family: 'mastodon-font-monospace', monospace; background: $ui-base-color; diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index e067c9335..c1249d0c4 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -209,7 +209,7 @@ display: inline-block; border-radius: 2px; background: lighten($ui-base-color, 30%); - border: none; + border: 0; color: $inverted-text-color; font-weight: 500; font-size: 11px; @@ -389,8 +389,10 @@ &:after { content: ""; position: absolute; - top: 0; bottom: 0; - left: 0; right: 0; + top: 0; + bottom: 0; + left: 0; + right: 0; background: linear-gradient(rgba($ui-base-color, 0), rgba($ui-base-color, 1)); pointer-events: none; } diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index 0c7cb443b..e641d1709 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -619,7 +619,7 @@ code { box-sizing: border-box; display: block; width: 100%; - border: none; + border: 0; padding: 10px; font-family: $font-monospace, monospace; background: $ui-base-color; diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss index fea64f45c..4801a4644 100644 --- a/app/javascript/styles/mastodon/admin.scss +++ b/app/javascript/styles/mastodon/admin.scss @@ -459,22 +459,6 @@ body, } } -.flavour-screen { - display: block; - margin: 10px auto; - max-width: 100%; -} - -.flavour-description { - display: block; - font-size: 16px; - margin: 10px 0; - - & > p { - margin: 10px 0; - } -} - .report-accounts { display: flex; flex-wrap: wrap; diff --git a/app/lib/language_detector.rb b/app/lib/language_detector.rb index 2cc8ac615..40452eddc 100644 --- a/app/lib/language_detector.rb +++ b/app/lib/language_detector.rb @@ -69,7 +69,7 @@ class LanguageDetector def simplify_text(text) new_text = remove_html(text) - new_text.gsub!(FetchLinkCardService::URL_PATTERN, '') + new_text.gsub!(FetchLinkCardService::URL_PATTERN, '\1') new_text.gsub!(Account::MENTION_RE, '') new_text.gsub!(Tag::HASHTAG_RE) { |string| string.gsub(/[#_]/, '#' => '', '_' => ' ').gsub(/[a-z][A-Z]|[a-zA-Z][\d]/) { |s| s.insert(1, ' ') }.downcase } new_text.gsub!(/:#{CustomEmoji::SHORTCODE_RE_FRAGMENT}:/, '') diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index d4e4931e6..fa1636e41 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -2,12 +2,13 @@ class FetchLinkCardService < BaseService URL_PATTERN = %r{ - ( # $1 URL - (https?:\/\/) # $2 Protocol (required) - (#{Twitter::TwitterText::Regex[:valid_domain]}) # $3 Domain(s) - (?::(#{Twitter::TwitterText::Regex[:valid_port_number]}))? # $4 Port number (optional) - (/#{Twitter::TwitterText::Regex[:valid_url_path]}*)? # $5 URL Path and anchor - (\?#{Twitter::TwitterText::Regex[:valid_url_query_chars]}*#{Twitter::TwitterText::Regex[:valid_url_query_ending_chars]})? # $6 Query String + (#{Twitter::TwitterText::Regex[:valid_url_preceding_chars]}) # $1 preceeding chars + ( # $2 URL + (https?:\/\/) # $3 Protocol (required) + (#{Twitter::TwitterText::Regex[:valid_domain]}) # $4 Domain(s) + (?::(#{Twitter::TwitterText::Regex[:valid_port_number]}))? # $5 Port number (optional) + (/#{Twitter::TwitterText::Regex[:valid_url_path]}*)? # $6 URL Path and anchor + (\?#{Twitter::TwitterText::Regex[:valid_url_query_chars]}*#{Twitter::TwitterText::Regex[:valid_url_query_ending_chars]})? # $7 Query String ) }iox @@ -63,7 +64,7 @@ class FetchLinkCardService < BaseService def parse_urls if @status.local? - urls = @status.text.scan(URL_PATTERN).map { |array| Addressable::URI.parse(array[0]).normalize } + urls = @status.text.scan(URL_PATTERN).map { |array| Addressable::URI.parse(array[1]).normalize } else html = Nokogiri::HTML(@status.text) links = html.css('a') diff --git a/app/validators/note_length_validator.rb b/app/validators/note_length_validator.rb index 7ea2bb3e5..554ad49ce 100644 --- a/app/validators/note_length_validator.rb +++ b/app/validators/note_length_validator.rb @@ -15,7 +15,7 @@ class NoteLengthValidator < ActiveModel::EachValidator return '' if value.nil? value.dup.tap do |new_text| - new_text.gsub!(FetchLinkCardService::URL_PATTERN, 'x' * 23) + new_text.gsub!(FetchLinkCardService::URL_PATTERN, StatusLengthValidator::URL_PLACEHOLDER) new_text.gsub!(Account::MENTION_RE, '@\2') end end diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb index dcbc4a41a..11997024f 100644 --- a/app/validators/status_length_validator.rb +++ b/app/validators/status_length_validator.rb @@ -2,12 +2,6 @@ class StatusLengthValidator < ActiveModel::Validator MAX_CHARS = (ENV['MAX_TOOT_CHARS'] || 500).to_i - URL_PATTERN = %r{ - (?: - (#{Twitter::TwitterText::Regex[:valid_url_preceding_chars]}) - (#{FetchLinkCardService::URL_PATTERN}) - ) - }iox URL_PLACEHOLDER = "\1#{'x' * 23}" def validate(status) @@ -35,7 +29,7 @@ class StatusLengthValidator < ActiveModel::Validator return '' if @status.text.nil? @status.text.dup.tap do |new_text| - new_text.gsub!(URL_PATTERN, URL_PLACEHOLDER) + new_text.gsub!(FetchLinkCardService::URL_PATTERN, URL_PLACEHOLDER) new_text.gsub!(Account::MENTION_RE, '@\2') end end diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index 8eac226e0..398ab4bb4 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -51,6 +51,6 @@ %th= t('admin.accounts.most_recent_activity') %th %tbody - = render @accounts + = render partial: 'account', collection: @accounts = paginate @accounts diff --git a/app/views/admin/action_logs/index.html.haml b/app/views/admin/action_logs/index.html.haml index 937664c4b..347eca166 100644 --- a/app/views/admin/action_logs/index.html.haml +++ b/app/views/admin/action_logs/index.html.haml @@ -20,6 +20,6 @@ = t 'admin.action_logs.empty' - else .announcements-list - = render @action_logs + = render partial: 'action_log', collection: @action_logs = paginate @action_logs diff --git a/app/views/admin/email_domain_blocks/index.html.haml b/app/views/admin/email_domain_blocks/index.html.haml index 6015cfac0..fa5d86b67 100644 --- a/app/views/admin/email_domain_blocks/index.html.haml +++ b/app/views/admin/email_domain_blocks/index.html.haml @@ -14,6 +14,6 @@ %th= t('admin.email_domain_blocks.domain') %th %tbody - = render @email_domain_blocks + = render partial: 'email_domain_block', collection: @email_domain_blocks = paginate @email_domain_blocks diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml index 5f20e7ec0..7c7958786 100644 --- a/app/views/admin/instances/index.html.haml +++ b/app/views/admin/instances/index.html.haml @@ -36,6 +36,6 @@ %div.muted-hint.center-text = t 'admin.instances.empty' - else - = render @instances + = render partial: 'instance', collection: @instances = paginate @instances |