summaryrefslogtreecommitdiffstats
path: root/core/templates
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-03-25 15:33:28 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-03-28 22:02:22 +0200
commit1ae56b054bd2c327242d128cfd4dd3dcb8416578 (patch)
treef311dd4c62223283bebfd73b685c2f8cdffe738b /core/templates
parente26f138fc596492da88b8a0d57749f5703e1d100 (diff)
downloadnextcloud-server-1ae56b054bd2c327242d128cfd4dd3dcb8416578.tar.gz
nextcloud-server-1ae56b054bd2c327242d128cfd4dd3dcb8416578.zip
Moving the inline js before the CSS
This allows browsers to do smarted parallel downloads Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/layout.base.php10
-rw-r--r--core/templates/layout.guest.php10
-rw-r--r--core/templates/layout.user.php10
3 files changed, 15 insertions, 15 deletions
diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php
index 8f376619a1e..4ae33341e2f 100644
--- a/core/templates/layout.base.php
+++ b/core/templates/layout.base.php
@@ -12,17 +12,17 @@
<link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>">
+ <?php if (isset($_['inline_ocjs'])): ?>
+ <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
+ <?php print_unescaped($_['inline_ocjs']); ?>
+ </script>
+ <?php endif; ?>
<?php foreach ($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
<?php endforeach; ?>
<?php foreach($_['printcssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
<?php endforeach; ?>
- <?php if (isset($_['inline_ocjs'])): ?>
- <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
- <?php print_unescaped($_['inline_ocjs']); ?>
- </script>
- <?php endif; ?>
<?php foreach ($_['jsfiles'] as $jsfile): ?>
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="<?php print_unescaped($jsfile); ?>"></script>
<?php endforeach; ?>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index ee844047a11..9b89ed6300f 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -13,17 +13,17 @@
<link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>">
+ <?php if (isset($_['inline_ocjs'])): ?>
+ <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
+ <?php print_unescaped($_['inline_ocjs']); ?>
+ </script>
+ <?php endif; ?>
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
<?php endforeach; ?>
<?php foreach($_['printcssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
<?php endforeach; ?>
- <?php if (isset($_['inline_ocjs'])): ?>
- <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
- <?php print_unescaped($_['inline_ocjs']); ?>
- </script>
- <?php endif; ?>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="<?php print_unescaped($jsfile); ?>"></script>
<?php endforeach; ?>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 339903f1eaf..31a5a1764f1 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -20,17 +20,17 @@
<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
<link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>">
<link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>">
+ <?php if (isset($_['inline_ocjs'])): ?>
+ <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
+ <?php print_unescaped($_['inline_ocjs']); ?>
+ </script>
+ <?php endif; ?>
<?php foreach($_['cssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
<?php endforeach; ?>
<?php foreach($_['printcssfiles'] as $cssfile): ?>
<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
<?php endforeach; ?>
- <?php if (isset($_['inline_ocjs'])): ?>
- <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript">
- <?php print_unescaped($_['inline_ocjs']); ?>
- </script>
- <?php endif; ?>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="<?php print_unescaped($jsfile); ?>"></script>
<?php endforeach; ?>