public function init() { self::$css = []; self::$js = []; $ci =& get_instance(); $config = empty($ci->config->config) ? [] : $ci->config->config; $auto_pick = empty($config['minify_auto']) ? true : (bool) $config['minify_auto']; $this->auto_pick = $auto_pick === null ? true : $this->auto_pick; }
function process($html) { // setup $min = new Minify(); // map the dom $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; @$dom->loadHTML($html); // minification if (!DEBUG) { $dom = $min->less($dom, $this->template); $dom = $min->css($dom, $this->template); $dom = $min->js($dom, $this->template); } else { if ($this->useRequire()) { // require is "on" in debug mode $dom = $min->requireDebug($dom, $this->template); } } // process require configuration $this->createClient($dom); $output = $dom->saveHTML(); // output the final markup - minify if not in debug return DEBUG ? $output : $min->html($output); }
<!-- Flot (Charts) JS --> <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="theme/scripts/flot/excanvas.min.js"></script><![endif]--> <?php echo Minify::js(array('theme/scripts/flot/jquery.flot.js', 'theme/scripts/flot/jquery.flot.pie.js', 'theme/scripts/flot/jquery.flot.tooltip.js', 'theme/scripts/flot/jquery.flot.selection.js', 'theme/scripts/flot/jquery.flot.resize.js', 'theme/scripts/flot/jquery.flot.orderBars.js')); $dates1 = array(); $dates2 = array(); for ($i = 30; $i > 0; $i--) { $dates1[] = "[" . mktime(0, 0, 0, date('n'), date('j') - $i, date('Y')) * 1000 . ", " . mt_rand(2000, 4000) . "]"; $dates2[] = "[" . mktime(0, 0, 0, date('n'), date('j') - $i, date('Y')) * 1000 . ", " . mt_rand(400, 700) . "]"; } ?> <script> var charts = { // init all charts init: function() { <?php if ($page == 'index') { ?> // mark weekends on the website traffic main graph this.website_traffic_graph.options.markings = this.utility.weekendAreas; // init website traffic main graph this.website_traffic_graph.init(); // init website traffic toolbar this.utility.website_traffic_toolbar();