includes/clientside/jsres.php
changeset 594 738c61b498a6
parent 588 20484deb89cd
child 613 c08670a77871
equal deleted inserted replaced
593:4f9bec0d65c1 594:738c61b498a6
   118 header('Content-type: text/javascript');
   118 header('Content-type: text/javascript');
   119 $everything = "/* The code represented in this file is compressed for optimization purposes. The full source code is available in includes/clientside/static/. */\n\nvar ENANO_JSRES_COMPRESSED = true;\n\n";
   119 $everything = "/* The code represented in this file is compressed for optimization purposes. The full source code is available in includes/clientside/static/. */\n\nvar ENANO_JSRES_COMPRESSED = true;\n\n";
   120 
   120 
   121 // if we only want the tiny version of the API (just enough to get by until the full one is loaded), send that
   121 // if we only want the tiny version of the API (just enough to get by until the full one is loaded), send that
   122 // with a simple ETag and far future expires header
   122 // with a simple ETag and far future expires header
       
   123 
       
   124 // note - obfuscated for optimization purposes. The exact same code except properly indented is in enano-lib-basic.
   123 if ( isset($_GET['early']) )
   125 if ( isset($_GET['early']) )
   124 {
   126 {
   125   header('ETag: enanocms-lib-early-r1');
   127   header('ETag: enanocms-lib-early-r2');
   126   header('Expires: Wed, 1 Jan 2020 00:00:00 GMT');
   128   header('Expires: Wed, 1 Jan 2020 00:00:00 GMT');
   127   
   129   
   128   echo <<<JSEOF
   130   echo <<<JSEOF
   129 var onload_hooks = new Array();
   131 var onload_hooks = new Array();function addOnloadHook(func){if ( typeof ( func ) == 'function' ){if ( typeof(onload_hooks.push) == 'function' ){onload_hooks.push(func);}else{onload_hooks[onload_hooks.length] = func;};};}
   130 
       
   131 function addOnloadHook(func)
       
   132 {
       
   133   if ( typeof ( func ) == 'function' )
       
   134   {
       
   135     if ( typeof(onload_hooks.push) == 'function' )
       
   136     {
       
   137       onload_hooks.push(func);
       
   138     }
       
   139     else
       
   140     {
       
   141       onload_hooks[onload_hooks.length] = func;
       
   142     }
       
   143   }
       
   144 }
       
   145 JSEOF;
   132 JSEOF;
   146   
   133   
   147   exit();
   134   exit();
   148 }
   135 }
   149 
   136