diff options
-rw-r--r-- | html.class | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -357,26 +357,24 @@ function _itjs($files, $mode) if ($files) { + $filenames = itjs::filenames($files); + if ($mode == "files") { - foreach (itjs::filenames($files) as $file) + foreach ($filenames as $file) $result .= tag('script', array('type' => "text/javascript", 'src' => "/itjs/" . basename($file) . "?v=" . itjs::checksum($file))); } else if ($mode == "inline") { $jsfile = ""; - foreach (itjs::filenames($files) as $file) + foreach ($filenames as $file) $jsfile .= @file_get_contents($file); $result .= itjs::strip($jsfile); } else - { - $filenames = itjs::filenames($files); - - $result .= tag('script', array('type' => "text/javascript", 'src' => "/itjs/" . join(",", $files) . "?v=" . itjs::checksum($filenames))); - } + $result .= tag('script', array('type' => "text/javascript", 'src' => "/itjs/$files?v=" . itjs::checksum($filenames))); } return $result; |