]> source.dussan.org Git - nextcloud-server.git/commitdiff
Moving the inline js before the CSS 4054/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Sat, 25 Mar 2017 14:33:28 +0000 (15:33 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 28 Mar 2017 20:02:22 +0000 (22:02 +0200)
This allows browsers to do smarted parallel downloads

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
core/templates/layout.base.php
core/templates/layout.guest.php
core/templates/layout.user.php

index 8f376619a1eabf1b391a2f44cc8ae3682f60b2f6..4ae33341e2f8318d4835563c8500893d944edbe6 100644 (file)
                <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; ?>
index ee844047a11196b5541681b0e893ef0960b00612..9b89ed6300f81f203d3f9520bd90624317b91fe1 100644 (file)
                <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; ?>
index 339903f1eaf23a6ebfd5e29cd0d3f46372e4e5ef..31a5a1764f16e3b8303421d5ea9e60b961c244ce 100644 (file)
                <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; ?>