<?php


	error_reporting(0);

	require_once "../../lib/composer.php";
	require_once "../../lib/minify.php";
	require_once "../../lib/common.php";
	require_once "../../lib/include/file.php";
	require_once "../../lib/include/dir.php";
	require_once "../../lib/debug.php";



	$dir = dirname(__FILE__);
	$conf	= CFile::GetJson("../../../upload/conf/assets.json");

	$minify = CMinify::newInstance()
		->setTypeJs()
		->setMinify($conf["js"]["type"] == "prod")
		->setConcatenate($conf["js"]["type"] == "prod")
		->addFiles(			
			array(
				$dir . "/jquery.min.js",
		        $dir . "/bootstrap.min.js",
		        $dir . "/jquery.ui.min.js",
			),
			"first"
		)
		->addFilesByPrefix(
			$dir , 
			"plugin." , 
			"js"
		)
		->addFilesByPrefix(
			$dir , 
			"custom." , 
			"js" , 
			"last"
		)
		->setCacheFile("../../../upload/_cache/admin-" . $conf["js"]["type"] . "-" . $conf["js"]["ver"] . ".js")
		->setVersion($conf["js"]["ver"])
		->setNoCache(!$conf["js"]["cache"])
		->output();
