mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-19 10:23:16 +09:00
Make minify option configurable by the site administrator
This commit is contained in:
parent
a4d944f23d
commit
bfaa2c170b
6 changed files with 32 additions and 2 deletions
|
|
@ -423,7 +423,7 @@ class HTMLDisplayHandler
|
|||
$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
|
||||
$original_file_list = array('x.js', 'common.js', 'js_app.js', 'xml_handler.js', 'xml_js_filter.js');
|
||||
|
||||
if(__DEBUG__ || !__XE_VERSION_STABLE__)
|
||||
if(Context::getDBInfo()->minify_scripts === 'N')
|
||||
{
|
||||
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
|
||||
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
|
||||
|
|
|
|||
|
|
@ -143,6 +143,12 @@ class FrontEndFileHandler extends Handler
|
|||
private function getFileInfo($fileName, $targetIe = '', $media = 'all')
|
||||
{
|
||||
static $existsInfo = array();
|
||||
static $autoMinify = null;
|
||||
|
||||
if($autoMinify === null)
|
||||
{
|
||||
$autoMinify = Context::getDBInfo()->minify_scripts === 'N' ? false : true;
|
||||
}
|
||||
|
||||
if(isset($existsInfo[$existsKey]))
|
||||
{
|
||||
|
|
@ -169,7 +175,7 @@ class FrontEndFileHandler extends Handler
|
|||
$file->cdnPath = $this->_normalizeFilePath($pathInfo['dirname']);
|
||||
|
||||
// Minify file
|
||||
if(!__DEBUG__ && __XE_VERSION_STABLE__ && !$file->isMinified && strpos($file->filePath, '://') === false && strpos($file->filePath, 'common/js/plugins') === false)
|
||||
if($autoMinify && !$file->isMinified && strpos($file->filePath, '://') === false && strpos($file->filePath, 'common/js/plugins') === false)
|
||||
{
|
||||
$originalFilePath = $file->fileRealPath . '/' . $pathInfo['basename'];
|
||||
if(($file->fileExtension === 'css' || $file->fileExtension === 'js') && file_exists($originalFilePath))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue