Commit:    575ecd0240d1af82a4f3edfd6fcb4edf61a5b057
Author:    Hannes Magnusson <[email protected]>         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&amp;t=2"></script>
- <script type="text/javascript" 
src="/cached.php?f=/js/ext/typeahead.min.js&amp;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.'&amp;t='.@filemtime($path).'"></script>', 
PHP_EOL;
+   echo '<script type="text/javascript" src="' . $MYSITE . 
'cached.php?f=/js/'.$filename.'&amp;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.'&amp;t='.@filemtime($path).'"></script>';
- }
-?>
 </head>
 <body class="<?php print $curr; ?> <?php echo $classes; ?>">


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to