about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorNolan Lawson <nolan@nolanlawson.com>2017-10-11 10:20:55 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-10-11 19:20:55 +0200
commit6a50329a9c8204803ba3a85b0acb41836a5e355e (patch)
treebba16bfefadb69eddc5f125ecbff9eb43b9f0063 /app/views
parentb17e571bc291a1f989004bf9adf36e2d1b0c60db (diff)
Only preload JS in /web pages (#5325)
Diffstat (limited to 'app/views')
-rw-r--r--app/views/home/index.html.haml6
-rwxr-xr-xapp/views/layouts/application.html.haml8
2 files changed, 6 insertions, 8 deletions
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index 6c93281db..659295ebf 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -1,4 +1,10 @@
 - content_for :header_tags do
+  %link{ href: asset_pack_path('features/getting_started.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
+  %link{ href: asset_pack_path('features/compose.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
+  %link{ href: asset_pack_path('features/home_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
+  %link{ href: asset_pack_path('features/notifications.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
+  %link{ href: asset_pack_path('features/community_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
+  %link{ href: asset_pack_path('features/public_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
   %meta{name: 'applicationServerKey', content: Rails.configuration.x.vapid_public_key}
   %script#initial-state{ type: 'application/json' }!= json_escape(@initial_state_json)
 
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 8c6fc27df..ee995c987 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -21,14 +21,6 @@
     = stylesheet_pack_tag 'common', media: 'all'
     = stylesheet_pack_tag current_theme, media: 'all'
     = javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
-
-    %link{ href: asset_pack_path('features/getting_started.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-    %link{ href: asset_pack_path('features/compose.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-    %link{ href: asset_pack_path('features/home_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-    %link{ href: asset_pack_path('features/notifications.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-    %link{ href: asset_pack_path('features/community_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-    %link{ href: asset_pack_path('features/public_timeline.js'), crossorigin: 'anonymous', rel: 'preload', as: 'script' }/
-
     = javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
     = csrf_meta_tags