aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/exe/jquery.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exe/jquery.php')
-rw-r--r--lib/exe/jquery.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/exe/jquery.php b/lib/exe/jquery.php
index b8638ecc0..7b0fceb72 100644
--- a/lib/exe/jquery.php
+++ b/lib/exe/jquery.php
@@ -2,10 +2,10 @@
use dokuwiki\Cache\Cache;
-if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/../../');
-if(!defined('NOSESSION')) define('NOSESSION', true); // we do not use a session or authentication here (better caching)
-if(!defined('NL')) define('NL', "\n");
-if(!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT', 1); // we gzip ourself here
+if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../');
+if (!defined('NOSESSION')) define('NOSESSION', true); // we do not use a session or authentication here (better caching)
+if (!defined('NL')) define('NL', "\n");
+if (!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT', 1); // we gzip ourself here
require_once(DOKU_INC . 'inc/init.php');
// MAIN
@@ -20,23 +20,24 @@ jquery_out();
*
* uses cache or fills it
*/
-function jquery_out() {
+function jquery_out()
+{
$cache = new Cache('jquery', '.js');
- $files = array(
+ $files = [
DOKU_INC . 'lib/scripts/jquery/jquery.min.js',
- DOKU_INC . 'lib/scripts/jquery/jquery-ui.min.js',
- );
+ DOKU_INC . 'lib/scripts/jquery/jquery-ui.min.js'
+ ];
$cache_files = $files;
$cache_files[] = __FILE__;
// check cache age & handle conditional request
// This may exit if a cache can be used
- $cache_ok = $cache->useCache(array('files' => $cache_files));
+ $cache_ok = $cache->useCache(['files' => $cache_files]);
http_cached($cache->cache, $cache_ok);
$js = '';
- foreach($files as $file) {
- $js .= file_get_contents($file)."\n";
+ foreach ($files as $file) {
+ $js .= file_get_contents($file) . "\n";
}
stripsourcemaps($js);