93 'flyin.js', |
93 'flyin.js', |
94 'rank-manager.js', |
94 'rank-manager.js', |
95 'userpage.js', |
95 'userpage.js', |
96 'template-compiler.js', |
96 'template-compiler.js', |
97 'toolbar.js', |
97 'toolbar.js', |
|
98 'upload.js' |
98 ); |
99 ); |
99 |
100 |
100 // Files that should NOT be compressed due to already being compressed, licensing, or invalid produced code |
101 // Files that should NOT be compressed due to already being compressed, licensing, or invalid produced code |
101 $compress_unsafe = array('json.js', 'fat.js', 'admin-menu.js', 'autofill.js', 'jquery.js', 'jquery-ui.js'); |
102 $compress_unsafe = array('json.js', 'fat.js', 'admin-menu.js', 'autofill.js', 'jquery.js', 'jquery-ui.js'); |
102 |
103 |
103 require_once('includes/js-compressor.php'); |
104 require_once('includes/js-compressor.php'); |
104 |
105 |
105 // try to gzip the output |
106 // try to gzip the output |
106 if ( !defined('ENANO_JSRES_SETUP_ONLY') ): |
107 if ( !defined('ENANO_JSRES_SETUP_ONLY') ): |
107 $do_gzip = false; |
108 $do_gzip = true; |
108 if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) && getConfig('gzip_output', false) == 1 ) |
|
109 { |
|
110 $acceptenc = str_replace(' ', '', strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])); |
|
111 $acceptenc = explode(',', $acceptenc); |
|
112 if ( in_array('gzip', $acceptenc) ) |
|
113 { |
|
114 $do_gzip = true; |
|
115 ob_start(); |
|
116 } |
|
117 } |
|
118 |
109 |
119 // Output format will always be JS |
110 // Output format will always be JS |
120 header('Content-type: text/javascript'); |
111 header('Content-type: text/javascript'); |
121 |
112 |
122 endif; // ENANO_JSRES_SETUP_ONLY |
113 endif; // ENANO_JSRES_SETUP_ONLY |