Simple Minify JS & CSS file. This just is using jsMin & cssMin library.
With Minify Engine Generator we can develop our js file and keep min file by easy.
Get More info Like this page :
https://www.facebook.com/omapslab
Follow Twitter
@omapslab
Enable cache by TRUE or FALSE
This is to set how long cache will be expired
For example 60 * 60 * 24 * 7 (This is will be expired one week)
/** * Cache Enable * This is to enable cache with TRUE / FALSE * if TRUE cache will enable * * Default FALSE */ $config['cache_enable'] = FALSE; /** * Cache Offset * This is to set how long cache will be expired * For example 60 * 60 * 24 * 7 (This is will be expired one week) * * Default 0 */ $config['cache_offset'] = 0;
Download & place minify folder on document root directory.
minify?style=YOUR_STYLE_PATH
<link href="YOUR_SITE/minify?style=tes/style.testsource.css"/>
minify?js=YOUR_JS_PATH
<script type="text/javascript" src="YOUR_SITE/minify?js=tes/jquery.form.testsource.js"></script>
sparated by coma (,)
minify?js=YOUR_JS_PATH_1,YOUR_JS_PATH_2,YOUR_JS_PATH_3
minify?style=YOUR_STYLE_PATH_1,YOUR_STYLE_PATH_2,YOUR_STYLE_PATH_3
Minify Js
We have file.js in assets/js/ folder
$(document).ready(function(){ $("#show").hide(); $("button").click(function(){ $("#show").animate({ height:'toggle' }); }); }); function submitForm(){ var url = "http://yoursite.com/"; var template = "template/mytemp"; $('#box-alert').html('<div align="center"><img src="http://yoursite.com/template/mytemp/images/loading/loading.gif"/><br><font color="black">Loading..</font></div>').fadeIn(); $('#myForms').ajaxSubmit({ success: function(response) { $('#box-alert').hide(); if(response.indexOf('err_null') > -1) { $('#box-alert').text('Kamu belum memasukan inputan apapun..!!').fadeIn(); } else if(response.indexOf('err_order') > -1) { $('#box-alert').text('Tolong isi Pesanan/Order Kamu dulu..!!').fadeIn(); } else if(response.indexOf('err_nama') > -1) { $('#box-alert').text('Tolong isi nama lengkap kamu dulu..!!').fadeIn(); } else if(response.indexOf('err_hp') > -1) { $('#box-alert').text('Tolong isi no HP Kamu dulu..!!').fadeIn(); } else if(response.indexOf('err_alamat') > -1) { $('#box-alert').text('Tolong isi Alamat Lengkap Kamu dulu..!!').fadeIn(); } else if (response.indexOf('ss_ins') > -1) { window.location = url + "index.php/mod_order_finish?n=from_order"; } else if (response.indexOf('ss_udt') > -1) { window.location = url + "index.php/mod_order_finish?n=from_order"; } else if (response.indexOf('ss_ins_admin') > -1) { window.location = url + "index.php/order"; } else if (response.indexOf('ss_udt_admin') > -1) { window.location = url + "index.php/order"; } } }); return false; }
In script src call source file.js with minify
<script src="http://yoursite.com/minify/?js=assets/js/file.js"></script>
The result will be
$(document).ready(function(){$("#show").hide();$("button").click(function(){$("#show").animate({height:'toggle'});});});function submitForm(){var url="http://yoursite.com/";var template="template/mytemp";$('#box-alert').html('<div align="center"><img src="http://yoursite.com/template/mytemp/images/loading/loading.gif"/><br><font color="black">Tunggu dulu sebentar</font></div>').fadeIn();$('#myForms').ajaxSubmit({success:function(response){$('#box-alert').hide();if(response.indexOf('err_null')>-1){$('#box-alert').text('Kamu belum memasukan inputan apapun..!!').fadeIn();}else if(response.indexOf('err_order')>-1){$('#box-alert').text('Tolong isi Pesanan/Order Kamu dulu..!!').fadeIn();}else if(response.indexOf('err_nama')>-1){$('#box-alert').text('Tolong isi nama lengkap kamu dulu..!!').fadeIn();}else if(response.indexOf('err_hp')>-1){$('#box-alert').text('Tolong isi no HP Kamu dulu..!!').fadeIn();}else if(response.indexOf('err_alamat')>-1){$('#box-alert').text('Tolong isi Alamat Lengkap Kamu dulu..!!').fadeIn();}else if(response.indexOf('ss_ins')>-1){window.location=url+"index.php/mod_order_finish?n=from_order";}else if(response.indexOf('ss_udt')>-1){window.location=url+"index.php/mod_order_finish?n=from_order";}else if(response.indexOf('ss_ins_admin')>-1){window.location=url+"index.php/order";}else if(response.indexOf('ss_udt_admin')>-1){window.location=url+"index.php/order";}}});return false;}