}
?>

<head>
<script src="./jsxcompressor.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css" href="./jsxgraph.css" />
<script type="text/javascript">
<?php 
jxgcompress("./prototype.js");
?>
   
eval(JXG.decompress(jxgcompressed));

<?php 
jxgcompress("../distrib/jsxgraphcore.js");
?>
   
eval(JXG.decompress(jxgcompressed));
</script>
</head>

<body>
<h1>Bezier curves with the JSX Compressor</h1>
<div id="jxgbox" class="jxgbox" style="width:600px; height:600px;"></div>
<div id="debug" style="display:block;"></div>
<script type="text/javascript">
    /* <![CDATA[ */

        var board, i, p, col;
        board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-4,4,4,-4], keepaspectratio:true, axis:true});
Example #2
0
<html>
<?php 
function jxgcompress($filename)
{
    if (file_exists($filename)) {
        $base64 = base64_encode(gzcompress(rawurlencode(file_get_contents($filename)), 9));
        echo "var jxgcompressed = \"{$base64}\";\n";
    } else {
        throw new Exception("{$filename} not found");
    }
}
?>

<head>
<script src="./jsxcompressor.min.js" type="text/javascript"></script>
</head>
<body>
<h1>Using the JSX Compressor</h1>
<script type="text/javascript">
<?php 
jxgcompress("./helloworld.js");
?>
   

eval(JXG.decompress(jxgcompressed));
</script>
</body>
</html>

    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
        header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
    }
}
//////////////////////////
include "mysql.class.php";
$databaseXmltv = new MySQL();
if ($databaseXmltv->Query("SELECT xmltv_canal.id,\n                                    xmltv_canal.nombre,\n                                    xmltv_canal.file\n                                     FROM xmltv_canal WHERE activo = 1 ORDER BY orden")) {
    $canales = $databaseXmltv->GetJSON();
} else {
    $canales = "''";
}
//CONCAT(UNIX_TIMESTAMP (fecha_inicio), '000') as inicio,
//CONCAT(UNIX_TIMESTAMP (fecha_fin), '000') as fin,
if ($databaseXmltv->Query("SELECT id,\n                                  id_canal,\n                                     titulo,\n                                     descripcion,\n                                      tipo,\n                                      CONCAT(UNIX_TIMESTAMP (CONCAT(CURDATE(), ' ', '12:00:00')), '000') as inicio,\n                                      CONCAT(UNIX_TIMESTAMP (CONCAT(CURDATE(), ' ', '13:00:00')), '000') as fin,\n                                     duracion,\n                                     file\n                                     FROM xmltv_programa WHERE activo = 1 ORDER BY id_canal;")) {
    $programas = $databaseXmltv->GetJSON();
} else {
    $programas = "''";
}
//////////////////////////
$json = '[{
"categoria": "canal",
"items":' . $canales . '},
{
"categoria": "programa",
"items":  ' . $programas . '}]';
echo jxgcompress($json);
function jxgcompress($json)
{
    return base64_encode(gzcompress($json, 9));
}