File: _loading_hints.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (23 lines) | stat: -rw-r--r-- 2,076 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
= cache([ActionController::Base.asset_host, user_application_color_mode, user_color_scheme, Gitlab::Tracking.enabled?, Gitlab::Tracking.collector_hostname], expires_in: 1.minute) do
  - css_crossorigin = ActionController::Base.asset_host ? 'anonymous' : nil

  - if ActionController::Base.asset_host
    %link{ rel: 'dns-prefetch', href: ActionController::Base.asset_host }
    %link{ rel: 'preconnect', href: ActionController::Base.asset_host, crossorigin: '' }
  - if user_application_dark_mode?
    = preload_link_tag(universal_path_to_stylesheet('application_utilities_dark'), as: 'style', crossorigin: css_crossorigin)
    = preload_link_tag(universal_path_to_stylesheet('application_dark'), as: 'style', crossorigin: css_crossorigin)
  - else
    = preload_link_tag(universal_path_to_stylesheet('application_utilities'), as: 'style', crossorigin: css_crossorigin)
    = preload_link_tag(universal_path_to_stylesheet('application'), as: 'style', crossorigin: css_crossorigin)
  = preload_link_tag(universal_path_to_stylesheet("highlight/themes/#{user_color_scheme}"), as: 'style', crossorigin: css_crossorigin)
  - if Gitlab::Tracking.enabled? && Gitlab::Tracking.collector_hostname
    - unless Rails.env.development?
      %link{ rel: 'preconnect', href: "https://#{Gitlab::Tracking.collector_hostname}", crossorigin: '' }
    -# Do not use preload_link_tag for fonts, to work around Firefox double-fetch bug.
    -# See https://github.com/web-platform-tests/wpt/pull/36930
    %link{ rel: 'preload', href: font_path('gitlab-sans/GitLabSans.woff2'), as: 'font', crossorigin: css_crossorigin }
    %link{ rel: 'preload', href: font_path('gitlab-sans/GitLabSans-Italic.woff2'), as: 'font', crossorigin: css_crossorigin }
    %link{ rel: 'preload', href: font_path('gitlab-mono/GitLabMono.woff2'), as: 'font', crossorigin: css_crossorigin }
    %link{ rel: 'preload', href: font_path('gitlab-mono/GitLabMono-Italic.woff2'), as: 'font', crossorigin: css_crossorigin }
    = preload_link_tag(universal_path_to_stylesheet('fonts'), as: 'style', crossorigin: css_crossorigin)