1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Issue #5192 - Javascript defer option. (experimental)

This commit is contained in:
camer0n
2024-02-09 16:46:16 -08:00
parent 209f0ea898
commit 8921e92aa6
6 changed files with 98 additions and 52 deletions

View File

@@ -0,0 +1,20 @@
<?php
$_E107['minimal'] = true;
require_once("../../../class2.php");
ob_start();
ob_implicit_flush(0);
header("last-modified: " . gmdate("D, d M Y H:i:s",mktime(0,0,0,15,2,2004)) . " GMT");
header('Content-type: text/javascript');
$tp = e107::getParser();
$json = $tp->toJSON(e107::getJs()->getSettings());
$js = '$(document).ready(function() {';
$js .= "var e107 = e107 || {'settings': {}, 'behaviors': {}};\n";
$js .= "jQuery.extend(e107.settings, " . $json . ");\n";
$js .= '});';
header ('ETag: "' . md5($js).'"' );
echo $js;
echo_gzipped_page();