com web/php: Move modernizr.js out of <head> and reuse the same cached.php loop: include/footer.inc include/header.inc
| From: | Hannes Magnusson | Date: | Wed, 04 Dec 2013 22:11:39 +0000 |
| Subject: | com web/php: Move modernizr.js out of <head> and reuse the same cached.php loop: include/footer.inc include/header.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-17371@lists.php.net to get a copy of this message | ||
Commit: 575ecd0240d1af82a4f3edfd6fcb4edf61a5b057
Author: Hannes Magnusson <bjori@mongodb.com> Wed, 4 Dec 2013 14:11:39 -0800
Parents: 4fd94007707a5c82b83e57dccb118029049744a9
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=575ecd0240d1af82a4f3edfd6fcb4edf61a5b057
Log:
Move modernizr.js out of <head> and reuse the same cached.php loop
Changed paths:
M include/footer.inc
M include/header.inc
Diff:
diff --git a/include/footer.inc b/include/footer.inc
index db2545b..b5d52f6 100644
--- a/include/footer.inc
+++ b/include/footer.inc
@@ -44,17 +44,13 @@
<!-- External and third party libraries. -->
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
- <script type="text/javascript"
src="/cached.php?f=/js/ext/hogan-2.0.0.min.js&t=2"></script>
- <script type="text/javascript"
src="/cached.php?f=/js/ext/typeahead.min.js&t=2"></script>
-
- <?php
- // Nick bjori's last modified code for our own JS files.
- $jsfiles = array('search.js', 'common.js');
+<?php
+ $jsfiles = array("ext/modernizr.js", "ext/hogan-2.0.0.min.js",
"ext/typeahead.min.js", "search..js", "common.js");
foreach ($jsfiles as $filename) {
$path = dirname(dirname(__FILE__)).'/js/'.$filename;
- echo '<script type="text/javascript"
src="/cached.php?f=/js/'.$filename.'&t='.@filemtime($path).'"></script>',
PHP_EOL;
+ echo '<script type="text/javascript" src="' . $MYSITE .
'cached.php?f=/js/'.$filename.'&t='.@filemtime($path).'"></script>'."\n";
}
- ?>
+?>
<!-- GoSquared stats -->
<script type="text/javascript">
diff --git a/include/header.inc b/include/header.inc
index fbb91c7..0b904b4 100755
--- a/include/header.inc
+++ b/include/header.inc
@@ -62,13 +62,6 @@ if (isset($shortname) && $shortname) {
<base href="<?php echo $_SERVER["BASE_HREF"] ?>">
<?php endif ?>
-<?php
- $jsfiles = array('ext/modernizr.js');
- foreach ($jsfiles as $filename) {
- $path = dirname(dirname(__FILE__)).'/js/'.$filename;
- echo '<script type="text/javascript" src="' . $MYSITE .
'cached.php?f=/js/'.$filename.'&t='.@filemtime($path).'"></script>';
- }
-?>
</head>
<body class="<?php print $curr; ?> <?php echo $classes; ?>">